/* ==========================================
   STYLE.CSS - PREMIUM DESIGN SYSTEM FOR MASUK PAK EKO
   ========================================== */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: #6366f1;
    --accent-primary: #4f46e5;
    --accent-primary-light: rgba(79, 70, 229, 0.08);
    --accent-success: #10b981;
    --accent-success-light: rgba(16, 185, 129, 0.08);
    --accent-danger: #ef4444;
    --accent-danger-light: rgba(239, 68, 68, 0.08);
    --accent-warning: #f59e0b;
    --accent-warning-light: rgba(245, 158, 11, 0.08);
    --accent-info: #06b6d4;
    --accent-info-light: rgba(6, 182, 212, 0.08);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.03), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    
    --shadow-glow-primary: 0 4px 20px rgba(79, 70, 229, 0.15);
    --shadow-glow-success: 0 4px 20px rgba(16, 185, 129, 0.15);
    --shadow-glow-warning: 0 4px 20px rgba(245, 158, 11, 0.15);
}

/* --- Global Reset & Scrollbars --- */
body {
    background-color: var(--bg-main) !important;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #0f172a;
}

/* --- Sidebar Desktop --- */
.sidebar {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    width: 280px;
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    padding-bottom: 20px;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    padding: 30px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.slogan-text {
    color: #94a3b8 !important;
}

.sidebar nav {
    padding: 20px 16px;
}

.sidebar nav a, .offcanvas-body nav a {
    color: var(--sidebar-text) !important;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    padding: 12px 18px;
    border-left: none !important; /* Hilangkan model garis sidebar lama */
    display: flex;
    align-items: center;
    transition: var(--transition-smooth);
}

.sidebar nav a i, .offcanvas-body nav a i {
    font-size: 1.1rem;
    margin-right: 14px;
    transition: var(--transition-smooth);
}

.sidebar nav a:hover, .offcanvas-body nav a:hover {
    background: var(--sidebar-hover);
    color: #ffffff !important;
}

.sidebar nav a.active, .offcanvas-body nav a.active {
    background: var(--sidebar-active) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.sidebar nav a.active i, .offcanvas-body nav a.active i {
    color: #ffffff !important;
}

/* Sidebar User Info */
.sidebar-user {
    margin: auto 16px 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--sidebar-active);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--sidebar-text);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-user-role .status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-success);
}

/* --- Main Content area --- */
.main-content {
    margin-left: 280px;
    padding: 40px 30px;
    transition: var(--transition-smooth);
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 20px 16px;
        padding-top: 80px;
    }
}

/* --- Mobile Navigation --- */
.navbar-mobile {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.offcanvas {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* --- Card Dashboard & General Cards --- */
.card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition-smooth) !important;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
}

.card-stats {
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color) !important;
}

.card-stats:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
}

.card-stats.stat-primary:hover {
    box-shadow: var(--shadow-glow-primary), var(--shadow-lg) !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
}

.card-stats.stat-success:hover {
    box-shadow: var(--shadow-glow-success), var(--shadow-lg) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.card-stats.stat-warning:hover {
    box-shadow: var(--shadow-glow-warning), var(--shadow-lg) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.icon-box {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.card-stats:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

/* --- Buttons Design --- */
.btn {
    border-radius: var(--radius-md) !important;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth) !important;
}

.btn:active, .btn:focus {
    box-shadow: none !important;
}

.btn-primary {
    background-color: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2) !important;
}

.btn-primary:hover {
    background-color: #4338ca !important;
    border-color: #4338ca !important;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3) !important;
    transform: translateY(-1px);
}

.btn-success {
    background-color: var(--accent-success) !important;
    border-color: var(--accent-success) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3) !important;
    transform: translateY(-1px);
}

.btn-outline-success {
    color: var(--accent-success) !important;
    border-color: var(--accent-success) !important;
}

.btn-outline-success:hover {
    background-color: var(--accent-success) !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: var(--accent-danger) !important;
    border-color: var(--accent-danger) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3) !important;
    transform: translateY(-1px);
}

.btn-white {
    background: #ffffff !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-white:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* --- Forms & Pill Filters --- */
.form-control, .form-select {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    padding: 11px 16px;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    background-color: #ffffff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sidebar-active) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

label.fw-bold {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* --- Tables & Lists --- */
.table-responsive {
    border-radius: var(--radius-lg);
    background: #ffffff;
}

table.table {
    margin-bottom: 0 !important;
}

table.table thead th {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color) !important;
}

table.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #334155;
    font-size: 0.875rem;
}

table.table tbody tr {
    transition: var(--transition-smooth);
}

table.table tbody tr:hover {
    background-color: #f8fafc !important;
}

/* --- Modern Badges --- */
.badge {
    padding: 6px 12px !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    border-radius: 50px !important;
    letter-spacing: 0.3px;
}

.bg-primary-subtle {
    background-color: var(--accent-primary-light) !important;
    color: var(--accent-primary) !important;
}

.bg-success-subtle {
    background-color: var(--accent-success-light) !important;
    color: var(--accent-success) !important;
}

.bg-danger-subtle {
    background-color: var(--accent-danger-light) !important;
    color: var(--accent-danger) !important;
}

.bg-warning-subtle {
    background-color: var(--accent-warning-light) !important;
    color: var(--accent-warning) !important;
}

.bg-info-subtle {
    background-color: var(--accent-info-light) !important;
    color: var(--accent-info) !important;
}

/* --- Modals Redesign --- */
.modal-content {
    border-radius: var(--radius-lg) !important;
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
}

.modal-header {
    padding: 24px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-header.bg-primary {
    background-color: var(--sidebar-bg) !important;
    color: #ffffff !important;
}

.modal-header.bg-success {
    background-color: var(--sidebar-bg) !important;
    color: #ffffff !important;
}

.modal-body {
    padding: 30px 24px !important;
}

.modal-footer {
    padding: 20px 24px !important;
    border-top: 1px solid var(--border-color) !important;
}

/* --- Login Page Modern (Glassmorphism + Mesh) --- */
.login-bg {
    background: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                radial-gradient(at 50% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                #0f172a;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: rgba(30, 41, 59, 0.7) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-lg) !important;
    color: #ffffff;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
    width: 100%;
    max-width: 420px;
}

.login-card .form-control {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.login-card .form-control:focus {
    border-color: var(--sidebar-active) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25) !important;
}

.login-card .input-group-text {
    background-color: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

.login-card label {
    color: #94a3b8;
}

.brand-logo-modern {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-login-modern {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
}

.btn-login-modern:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6) !important;
    transform: translateY(-1px);
}

/* --- Donation QRIS popup on login --- */
.donation-modal {
   position: fixed;
   inset: 0;
   z-index: 2000;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 20px;
   background: rgba(2, 6, 23, 0.82);
}

.donation-modal-content {
   position: relative;
   width: min(560px, 100%);
   max-height: calc(100vh - 40px);
   overflow-y: auto;
   padding: 24px;
   border: 1px solid rgba(255, 255, 255, 0.14);
   border-radius: var(--radius-lg);
   background: #ffffff;
   color: var(--text-main);
   box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.donation-modal-header {
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 16px;
   margin-bottom: 16px;
}

.donation-modal-header h2 {
   margin: 0 0 6px;
   color: #0f172a;
   font-size: 1.35rem;
}

.donation-modal-header p,
.donation-modal-footer p {
   margin: 0;
   color: var(--text-muted);
   font-size: 0.9rem;
}

.donation-modal-close {
   flex: 0 0 auto;
   width: 36px;
   height: 36px;
   border: 0;
   border-radius: 50%;
   background: #e2e8f0;
   color: #334155;
   cursor: pointer;
   transition: var(--transition-smooth);
}

.donation-modal-close:hover {
   background: #cbd5e1;
   color: #0f172a;
}

.donation-qris {
   display: block;
   width: min(100%, 390px);
   max-height: 55vh;
   margin: 0 auto 18px;
   object-fit: contain;
   border-radius: var(--radius-md);
}

.donation-modal-footer {
   padding-top: 16px;
   border-top: 1px solid var(--border-color);
   text-align: center;
}

.donation-modal-footer a {
   color: #2563eb;
   font-weight: 600;
   text-decoration: none;
}

.donation-modal-footer a:hover {
   text-decoration: underline;
}

.donation-modal-footer small {
   display: block;
   margin-top: 10px;
   color: var(--text-muted);
}

@media (max-width: 576px) {
   .donation-modal {
       padding: 12px;
   }

   .donation-modal-content {
       padding: 18px;
   }

   .donation-modal-header h2 {
       font-size: 1.1rem;
   }

   .donation-qris {
       max-height: 52vh;
   }
}

/* --- Compact buttons for tables --- */
.btn-sm {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-sm) !important;
}
.btn-group .btn-sm {
    padding: 8px 14px !important;
}

/* --- Expandable Table Rows --- */
tr.clickable-row {
    cursor: pointer;
}
tr.clickable-row:hover {
    background-color: #f8fafc !important;
}
.collapse-row-content {
    background-color: #f8fafc !important;
}
.collapse-row-content td {
    padding: 0 !important; /* Reset padding for smooth collapse transition */
    border: none !important;
}
.collapse-card {
    padding: 24px;
    background: #fdfdfd;
    border-bottom: 2px solid var(--border-color) !important;
}
.transition-icon {
    display: inline-block;
    transition: transform 0.2s ease-in-out;
    color: var(--text-muted);
}
tr[aria-expanded="true"] .transition-icon {
    transform: rotate(90deg);
    color: var(--accent-primary);
}
.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
}

