:root {
    --primary: #00529C; /* Bank BRI Deep Blue */
    --primary-light: #0073D4;
    --primary-dark: #003B73;
    
    --secondary: #F97316; /* Vibrant Orange for PPOB Actions */
    --secondary-dark: #EA580C;
    
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    
    --text-dark: #0f172a;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove old bg-pattern for a cleaner SaaS look */
.bg-pattern {
    background: var(--bg-color);
}

/* Rebranding glass-panel into premium card */
.glass-panel, .card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}
.glass-panel:hover, .card:hover {
    box-shadow: var(--shadow-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    margin-top: 0;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background-color: var(--secondary); /* Changed to Orange for Action Buttons */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}
.btn-primary:active {
    transform: translateY(0);
}

/* Inputs */
.input-glass {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
    margin-bottom: 16px;
}
.input-glass:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
}
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo h1 {
    color: var(--text-dark);
    margin: 12px 0 4px 0;
    font-size: 24px;
    font-weight: 700;
}
.auth-logo p {
    color: var(--text-muted);
    margin: 0;
    font-size: 14px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--primary); /* BRILink Deep Blue */
    color: #ffffff;
    border-right: none;
    border-radius: 0;
    box-shadow: var(--shadow-md);
    overflow-y: auto;
}
/* Scrollbar styling untuk sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.sidebar .brand-text h2 {
    color: #ffffff !important;
}
.sidebar .brand-text p {
    color: #93c5fd !important; /* Lighter blue */
}
.sidebar .nav-category {
    color: #93c5fd !important;
}
.sidebar .desktop-toggle-btn {
    color: #ffffff !important;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: #e0f2fe; /* Light blueish white */
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.nav-item i {
    font-size: 20px;
    color: inherit;
    transition: transform 0.2s;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
.nav-item:hover i {
    transform: scale(1.1);
}
.nav-item.active {
    background: var(--secondary); /* BRILink Orange for Active */
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}
.nav-item.active i {
    color: #ffffff !important;
}

.main-content {
    flex: 1;
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive Grids */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-flex-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Metric Cards */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.metric-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.metric-title {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}
table th {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}
table td {
    padding: 16px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
table tbody tr {
    transition: background-color 0.2s;
}
table tbody tr:hover {
    background-color: #f8fafc;
}

/* Text Colors */
.text-green { color: #16a34a; }
.text-blue { color: var(--primary); }
.text-red { color: #ef4444; }

/* Collapsed Sidebar (Desktop) */
.sidebar.collapsed {
    width: 80px;
    padding: 24px 10px;
}
.sidebar.collapsed .sidebar-brand {
    display: none !important;
}
.sidebar.collapsed .desktop-toggle-btn {
    margin: 0 auto;
    width: 100%;
}
.sidebar.collapsed .nav-category {
    display: none;
}
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-accordion-btn {
    justify-content: center !important;
    padding: 12px 0 !important;
    gap: 0 !important;
}
.sidebar.collapsed .nav-item i,
.sidebar.collapsed .nav-accordion-btn i,
.sidebar.collapsed .nav-accordion-btn span i {
    font-size: 24px !important;
    margin: 0;
}
.sidebar.collapsed .nav-text {
    display: none !important;
}
.sidebar.collapsed .nav-accordion-btn > i.ph-caret-down,
.sidebar.collapsed .nav-accordion-btn > i.ph-caret-up {
    display: none;
}
.sidebar.collapsed .nav-submenu {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin-bottom: 5px !important;
}
.sidebar.collapsed .nav-submenu .nav-item {
    background: transparent !important;
    margin-bottom: 2px !important;
    border-radius: 8px !important;
}
.sidebar.collapsed .nav-submenu .nav-item i {
    color: #e0f2fe !important;
}
.sidebar.collapsed .nav-submenu .nav-item:hover i {
    color: #ffffff !important;
}
.sidebar.collapsed .nav-submenu .nav-item.active {
    background: var(--secondary) !important;
}
.sidebar.collapsed .nav-submenu .nav-item.active i {
    color: #ffffff !important;
}
.sidebar.collapsed .branch-switcher {
    display: none;
}

/* Mobile Header */
.mobile-header {
    display: none;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}
.mobile-header-title {
    flex: 1;
    text-align: center;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 18px;
    margin: 0;
}
.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.2s;
}
.mobile-menu-btn:hover {
    background: #f1f5f9;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 998;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s;
}

/* Responsiveness */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        bottom: 0;
        width: 280px;
        height: 100vh;
        z-index: 999;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: 24px;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        transform: translateX(300px);
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .main-content {
        padding: 16px;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-flex-wrap {
        flex-direction: column;
    }
}

/* Sidebar Dropdown (Accordion) Styles */
.nav-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s;
    opacity: 0.9;
}
.nav-accordion-btn:hover, .nav-accordion-btn.active {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}
.nav-submenu {
    display: none;
    flex-direction: column;
    padding-left: 20px;
    margin-bottom: 5px;
}
.nav-submenu.open {
    display: flex;
}
.nav-submenu .nav-item {
    padding: 10px 16px;
    font-size: 14px;
    margin-bottom: 2px;
}

/* Action Tiles for BRILink Style UI */
.action-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.action-tile {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.action-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.action-tile .icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 5px;
}
.action-tile .tile-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.tile-blue .icon-wrapper { background: #e0f2fe; color: #0284c7; }
.tile-orange .icon-wrapper { background: #ffedd5; color: #ea580c; }
.tile-green .icon-wrapper { background: #dcfce7; color: #16a34a; }
.tile-purple .icon-wrapper { background: #f3e8ff; color: #9333ea; }
.tile-red .icon-wrapper { background: #fee2e2; color: #dc2626; }
.tile-gray .icon-wrapper { background: #f1f5f9; color: #475569; }
