:root {
    --primary-color: #0f172a; /* Slate 900 - Deep Midnight */
    --secondary-color: #1e293b; /* Slate 800 */
    --accent-color: #3b82f6; /* Bright Blue */
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc; /* Slate 50 */
    --text-color: #334155; /* Slate 700 */
    --sidebar-width: 280px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; /* Modern typeface */
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar: Deep Ocean Gradient */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #94a3b8;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}

/* Scrollbar Sidebar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.sidebar-header {
    padding: 32px 28px;
    margin-bottom: 10px;
}

.brand { display: flex; align-items: center; margin-bottom: 24px; }
.brand-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; margin-right: 14px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); /* Glow effect */
}
.brand-logo img { border-radius: 10px; }
.brand-name { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: -0.025em; }

.user-mini { 
    background: rgba(255,255,255,0.03);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}
.user-mini .user-name { font-weight: 700; color: #f1f5f9; font-size: 14px; margin-bottom: 4px; }
.user-mini .user-role { font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.sidebar-menu {
    list-style: none;
    padding: 0 16px;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-menu li { position: relative; }

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.sidebar-menu li a i {
    font-size: 20px;
    margin-right: 14px;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: all 0.3s;
}

.sidebar-menu li a .arrow {
    margin-left: auto;
    font-size: 18px;
    color: #475569;
    transition: transform 0.3s;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.03);
    color: #f8fafc;
}
.sidebar-menu li a:hover i { color: #f8fafc; }

/* Active State: "Glow" Pill */
.sidebar-menu li a.active {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); /* Blue Glow */
}
.sidebar-menu li a.active i { color: #ffffff; }
.sidebar-menu li a.active .arrow { color: rgba(255,255,255,0.7); }

/* Submenu Styling */
.sidebar-menu .submenu {
    display: none;
    padding: 5px 0 5px 10px;
    margin-top: 5px;
    background: rgba(0,0,0,0.2); /* Darker inset */
    border-radius: 12px;
}

.sidebar-menu li:hover .submenu,
.sidebar-menu li a.active + .submenu, 
.sidebar-menu li:focus-within .submenu {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-menu li:hover > a .arrow { transform: rotate(90deg); color: #fff; }

.sidebar-menu .submenu a {
    padding: 10px 16px;
    font-size: 13px;
    color: #94a3b8;
    border-radius: 8px;
    border: none;
}
.sidebar-menu .submenu a:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    padding-left: 20px; /* Slight movement */
}
.sidebar-menu .submenu a.active {
    color: #38bdf8; /* Sky Blue text for active submenu */
    font-weight: 600;
    background: transparent;
    box-shadow: none;
}

/* Logout */
.sidebar-menu li:last-child {
    margin-top: auto;
    margin-bottom: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.sidebar-menu li a[href="logout.php"] { color: #ef4444; }
.sidebar-menu li a[href="logout.php"]:hover { background: rgba(239, 68, 68, 0.1); color: #fca5a5; }
.sidebar-menu li a[href="logout.php"] i { color: #ef4444; }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px;
    width: calc(100% - var(--sidebar-width));
    background: #f8fafc;
}

/* Top Bar: Clean & Minimal */
.top-bar {
    background: transparent;
    padding: 0 0 30px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border: none;
    box-shadow: none;
}
.top-bar h2 { 
    margin: 0; 
    font-weight: 800; 
    color: #0f172a; 
    font-size: 1.8rem; 
    letter-spacing: -0.03em; 
}
.top-bar-subtitle { 
    font-size: 15px; 
    color: #64748b; 
    margin-top: 6px; 
    font-weight: 500; 
}

/* Cards: Soft & Floating */
.card-modern, .card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.3s ease;
    margin-bottom: 24px;
}
.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(59, 130, 246, 0.2);
}

.card h3 {
    margin-top: 0;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

/* Stat Cards */
.stat-card-compact {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}
.stat-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(59, 130, 246, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon i {
    font-size: 24px;
    color: #fff;
}

/* Icon Gradients */
.bg-grad-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-grad-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-grad-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bg-grad-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.bg-grad-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-grad-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.stat-content {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

.stat-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    color: #0f172a;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}
.text-green { color: #10b981; }
.text-red { color: #ef4444; }
.text-neutral { color: #94a3b8; }


/* Buttons: Modern Pills */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px; /* Pill shape */
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-primary { 
    background: var(--accent-gradient); 
    color: white; 
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover { 
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary { background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; color: #1e293b; }

.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Inputs */
input, select, textarea {
    border: 2px solid #e2e8f0 !important; /* Thicker border */
    background: #fff !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 15px;
    color: #1e293b;
    transition: all 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
    outline: none;
}

/* Tables */
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
}
td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}
tr:hover td { background: #f8fafc; }

/* Responsive */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
}

@media (max-width: 992px) {
    .menu-toggle { display: block; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 80px 20px; }
    .sidebar-overlay { background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); }
}

/* Utilities */
.badge { padding: 6px 10px; border-radius: 6px; font-weight: 700; font-size: 11px; letter-spacing: 0.02em; }
.badge-in { background: #dcfce7; color: #166534; }
.badge-out { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* Action Pills */
.action-pill {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.action-pill:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}
.action-pill.primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
}
.action-pill.primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* --- TOOLS PAGE STYLES --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.tool-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tool-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: #cbd5e1;
}

.tool-box h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
    color: #1e293b;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tool-box h3 i {
    color: #3b82f6;
    font-size: 24px;
}

.tool-box p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1; /* Pushes content down */
}

/* Section Title */
.tool-section-title {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-top: 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tool-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Danger Zone */
.tool-box-danger {
    border-left: 4px solid #ef4444;
    background: #fffafa;
}
.tool-box-danger h3 { color: #b91c1c; }
.tool-box-danger h3 i { color: #ef4444; }

/* File Input Wrapper */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}
.file-input-name {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* --- DASHBOARD SPECIFIC --- */
.trend-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
    background: rgba(255,255,255,0.25);
    width: fit-content;
    backdrop-filter: blur(4px);
    color: white;
}
.trend-badge i {
    font-size: 12px;
    margin-right: 4px;
}

/* --- BANK ICONS --- */
.bank-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    margin-right: 8px;
    min-width: 32px;
    height: 20px;
    color: white;
    vertical-align: middle;
    text-transform: uppercase;
}
.bank-icon-bri { background-color: #00529c; }
.bank-icon-bca { background-color: #0060af; }
.bank-icon-mandiri { background-color: #ffb700; color: #003d79; }
.bank-icon-bni { background-color: #005e6a; }
.bank-icon-bsi { background-color: #00a39d; }

/* Form Group Utilities (from mutasi.php) */
.form-group {
    margin-bottom: 15px;
    display: block;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}
.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
}
