/**
 * ============================================
 * ADMIN CUSTOM CSS - KOPERASIQU
 * ============================================
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
}

/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #333;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* Card Styles */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0 30px rgba(0,0,0,0.1) !important;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e3e6f0;
}

/* Border Left Cards */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.border-left-danger {
    border-left: 0.25rem solid #e74a3b !important;
}

.border-left-secondary {
    border-left: 0.25rem solid #858796 !important;
}

/* Button Styles */
.btn {
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-group .btn {
    transform: none;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select {
    padding: 5px 10px;
    border: 1px solid #d1d3e2;
    border-radius: 5px;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 5px 10px;
    border: 1px solid #d1d3e2;
    border-radius: 5px;
    margin-left: 5px;
}

table.dataTable thead th {
    background: var(--light-color);
    font-weight: 600;
    border-bottom: 2px solid #e3e6f0;
}

table.dataTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Badge Styles */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Form Styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 5px;
}

/* Modal Styles */
.modal-header {
    border-bottom: 2px solid #e3e6f0;
}

.modal-footer {
    border-top: 2px solid #e3e6f0;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.alert-dismissible .btn-close {
    padding: 1rem;
}

/* Progress Bar */
.progress {
    height: 1.5rem;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    line-height: 1.5rem;
    font-weight: 600;
    font-size: 0.8rem;
}

/* User Avatar */
.user-avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 2.5rem;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
}

/* Status Badges */
.status-active {
    background-color: var(--success-color);
    color: white;
}

.status-pending {
    background-color: var(--warning-color);
    color: #333;
}

.status-inactive {
    background-color: var(--secondary-color);
    color: white;
}

/* Table Responsive */
.table-responsive {
    border-radius: 10px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

.rounded-lg {
    border-radius: 10px !important;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 5px !important;
        margin-bottom: 5px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/**
 * ============================================
 * CSS CUSTOM - UNIT USAHA MODULE
 * ============================================
 * File CSS tambahan untuk modul Unit Usaha
 * Bisa digabungkan dengan admin.css atau sebagai file terpisah
 */

/* ============================================
   STATISTICS CARDS
============================================ */
.stats-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15) !important;
}

.stats-card .card-body {
    padding: 1.5rem;
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

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

/* Icon Colors */
.stats-icon.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-icon.bg-success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.stats-icon.bg-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stats-icon.bg-info {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* ============================================
   FILTER SECTION
============================================ */
.card-header {
    border-bottom: 2px solid #f0f0f0;
}

.card-header h5 {
    color: #2c3e50;
    font-weight: 600;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-select,
.form-control {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-select:focus,
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ============================================
   TABLE STYLING
============================================ */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
}

.table tbody td {
    vertical-align: middle;
    padding: 0.75rem;
}

/* Badge Styling */
.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%) !important;
}

/* ============================================
   BUTTON STYLING
============================================ */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1.25rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
    border: none;
}

/* Button Group */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-group-sm .btn i {
    font-size: 0.875rem;
}

/* ============================================
   MODAL STYLING
============================================ */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-radius: 12px 12px 0 0;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}

.modal-header.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.modal-header.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.modal-header.bg-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.modal-header h5 {
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid #f0f0f0;
    padding: 1rem 1.5rem;
}

/* ============================================
   BREADCRUMB
============================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

.breadcrumb-item a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ============================================
   PAGE HEADER
============================================ */
.container-fluid h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.container-fluid h2 i {
    font-size: 1.75rem;
    vertical-align: middle;
}

/* ============================================
   LOADING SPINNER
============================================ */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* ============================================
   DATATABLE CUSTOM
============================================ */
div.dataTables_wrapper div.dataTables_length select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

div.dataTables_wrapper div.dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
    color: white !important;
}

/* ============================================
   ALERT CUSTOM
============================================ */
.alert {
    border-radius: 8px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-info {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    color: #00695c;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
============================================ */
@media (max-width: 768px) {
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .btn-group-sm {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group-sm .btn {
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* ============================================
   ANIMATION
============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease;
}

/* ============================================
   SCROLLBAR CUSTOM
============================================ */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* ============================================
   PRINT STYLES
============================================ */
@media print {
    .btn, .modal, .sidebar, .top-navbar, .breadcrumb {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* ============================================
   UTILITY CLASSES
============================================ */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 4px 6px rgba(0,0,0,0.07), 0 5px 15px rgba(0,0,0,0.1);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
}
/* ============================================
   SIDEBAR SUB-HEADER (pemisah grup menu)
============================================ */
.menu-sub-header {
    padding: 6px 16px 2px;
    margin-top: 4px;
    pointer-events: none;
}

.menu-sub-header small {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================
   LAYOUT SIDEBAR & NAVBAR — design system v3
   Hijau tua + aksen lime, selaras dashboard baru.
   Struktur class & perilaku (collapsed / mobile) TIDAK berubah.
   ============================================ */

:root {
    --sidebar-width:   280px;
    --navbar-height:    64px;
    --accent-color:   #047857;
    --hover-color:    rgba(255, 255, 255, 0.06);
    --sb-lime:        #bef264;
    --sb-text:        #c3d9cf;
    --sb-mute:        #6f9a8a;
    --sb-line:        rgba(190, 242, 100, 0.12);
}

body {
    overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
    position:   fixed;
    top:        0;
    left:       0;
    height:     100vh;
    width:      var(--sidebar-width);
    background: linear-gradient(180deg, #0b3228 0%, #082820 100%);
    padding-top:0;
    z-index:    1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 1px 0 0 rgba(190,242,100,0.08), 10px 0 30px -14px rgba(8,40,32,0.55);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(190,242,100,0.25) transparent;
}
.sidebar::-webkit-scrollbar       { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(190,242,100,0.22); border-radius: 3px; }

.sidebar.collapsed { width: 70px; }

/* Logo — horizontal: chip ikon/logo + nama koperasi, motif kawung halus */
.sidebar .logo {
    position:      relative;
    overflow:      hidden;
    display:       grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:   "ic nm" "ic ct";
    column-gap:    12px;
    align-items:   center;
    text-align:    left;
    padding:       20px 18px;
    color:         #fff;
    background:    #082820;
    border-bottom: 1px solid var(--sb-line);
}
.sidebar .logo::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23bef264' stroke-opacity='.2' stroke-width='1'%3E%3Cellipse cx='22' cy='11' rx='5.5' ry='11'/%3E%3Cellipse cx='22' cy='33' rx='5.5' ry='11'/%3E%3Cellipse cx='11' cy='22' rx='11' ry='5.5'/%3E%3Cellipse cx='33' cy='22' rx='11' ry='5.5'/%3E%3C/g%3E%3Ccircle cx='22' cy='22' r='1.6' fill='%23bef264' fill-opacity='.35'/%3E%3C/svg%3E");
    background-size: 44px 44px;
    -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
            mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
}
.sidebar .logo > * { position: relative; z-index: 1; }
.sidebar .logo > i,
.sidebar .logo > img {
    grid-area: ic;
    width: 46px; height: 46px; margin: 0 !important;
    border-radius: 14px;
}
.sidebar .logo > i {
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; background: var(--sb-lime); color: #0a2e25;
}
.sidebar .logo > img {
    max-height: 46px !important; max-width: 46px !important;
    padding: 4px; background: #fff; object-fit: contain;
}
.sidebar .logo h4 {
    grid-area: nm; margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar .logo p {
    grid-area: ct; margin: 2px 0 0 !important; font-size: 0.75rem; color: var(--sb-mute); opacity: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar.collapsed .logo {
    grid-template-columns: 1fr; grid-template-areas: "ic"; justify-items: center; padding: 16px 8px;
}
.sidebar.collapsed .logo h4,
.sidebar.collapsed .logo p { display: none; }

/* Menu Container */
.sidebar-menu { list-style: none; padding: 14px 0; margin: 0; }

/* Menu Group Header */
.menu-header {
    padding:        18px 24px 8px;
    color:          var(--sb-mute);
    font-size:      0.68rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition:     all 0.3s;
}
.sidebar.collapsed .menu-header          { padding: 10px; text-align: center; }
.sidebar.collapsed .menu-header span     { display: none; }
.sidebar.collapsed .menu-header::after   { content: '•'; color: rgba(190,242,100,0.35); }
.sidebar .menu-sub-header small          { color: var(--sb-mute); opacity: .8; }

/* Menu Item — pill dengan indikator di tepi kiri sidebar */
.sidebar-menu li { margin-bottom: 2px; }
.sidebar-menu a {
    display:         flex;
    align-items:     center;
    margin:          0 12px;
    padding:         12px 14px;
    border-radius:   12px;
    color:           var(--sb-text);
    text-decoration: none;
    transition:      background .2s, color .2s;
    position:        relative;
    font-size:       0.9rem;
    font-weight:     500;
}
.sidebar-menu a::before {
    content:       '';
    position:      absolute;
    left:          -12px;
    top:           50%;
    transform:     translateY(-50%);
    width:         3px;
    height:        0;
    background:    var(--sb-lime);
    transition:    height 0.25s;
    border-radius: 0 3px 3px 0;
}
.sidebar-menu a:hover            { background: var(--hover-color); color: #fff; }
.sidebar-menu a:hover::before    { height: 35%; }
.sidebar-menu a:focus-visible    { outline: 2px solid var(--sb-lime); outline-offset: -2px; }
.sidebar-menu a.active {
    background:  rgba(190,242,100,0.12);
    color:       #fff;
    font-weight: 600;
}
.sidebar-menu a.active::before   { height: 60%; }
.sidebar-menu a i                { width: 22px; font-size: 1rem; text-align: center; margin-right: 12px; color: var(--sb-mute); transition: color .2s; }
.sidebar-menu a:hover i          { color: #d9f99d; }
.sidebar-menu a.active i         { color: var(--sb-lime); }
.sidebar-menu a span             { transition: all 0.3s; }

/* Collapsed */
.sidebar.collapsed .sidebar-menu a       { padding: 12px; margin: 0 10px; justify-content: center; }
.sidebar.collapsed .sidebar-menu a::before { left: -10px; }
.sidebar.collapsed .sidebar-menu a span  { display: none; }
.sidebar.collapsed .sidebar-menu a i     { margin-right: 0; }
.sidebar.collapsed .menu-toggle .toggle-icon { display: none; }

/* Dropdown — garis pemandu + titik penanda */
.menu-dropdown {
    list-style:  none;
    padding:     2px 0 6px;
    margin:      0;
    max-height:  0;
    overflow:    hidden;
    transition:  max-height 0.3s ease;
    position:    relative;
}
.menu-dropdown.show              { max-height: 600px; }
.menu-dropdown::before {
    content: ""; position: absolute; left: 37px; top: 4px; bottom: 10px; width: 1px; background: var(--sb-line);
}
.sidebar-menu .menu-dropdown a            { padding-left: 52px; font-size: 0.86rem; color: #a9c4b8; font-weight: 500; }
.sidebar-menu .menu-dropdown a:hover      { color: #fff; }
.sidebar-menu .menu-dropdown a::before {
    left: 35px; top: 50%; width: 5px; height: 5px; border-radius: 50%;
    background: rgba(190,242,100,0.28); transition: background .2s, box-shadow .2s;
}
.sidebar-menu .menu-dropdown a:hover::before { height: 5px; background: var(--sb-lime); }
.sidebar-menu .menu-dropdown a.active {
    background: rgba(190,242,100,0.1); color: var(--sb-lime); font-weight: 600;
}
.sidebar-menu .menu-dropdown a.active::before {
    height: 5px; background: var(--sb-lime); box-shadow: 0 0 0 4px rgba(190,242,100,0.18);
}
.sidebar.collapsed .menu-dropdown { display: none; }

/* Toggle icon */
.menu-toggle                     { cursor: pointer; }
.sidebar-menu .menu-toggle .toggle-icon { transition: transform 0.3s; margin-left: auto; margin-right: 0; width: auto; font-size: 0.7rem; }
.menu-toggle.active .toggle-icon { transform: rotate(180deg); }
/* Grup yang sedang dibuka: ditandai halus; sorotan kuat dipakai item anak */
.sidebar-menu a.menu-toggle.active          { background: rgba(255,255,255,0.05); font-weight: 600; }
.sidebar-menu a.menu-toggle.active::before  { height: 0; }
.sidebar-menu a.menu-toggle.active i        { color: var(--sb-lime); }

/* ── Navbar ── */
.top-navbar {
    position:        fixed;
    top:             0;
    left:            var(--sidebar-width);
    right:           0;
    height:          var(--navbar-height);
    background:      rgba(255,255,255,0.86);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
            backdrop-filter: saturate(180%) blur(12px);
    border-bottom:   1px solid #e8ecf3;
    box-shadow:      none;
    padding:         0 28px;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    z-index:         999;
    transition:      all 0.3s;
    font-family:     'Inter', 'Segoe UI', system-ui, sans-serif;
}
.sidebar.collapsed ~ .top-navbar   { left: 70px; }

/* Tombol ikon (toggle sidebar & lonceng) */
.top-navbar .btn-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px;
    color: #334155 !important; text-decoration: none; background: transparent;
    transform: none !important; box-shadow: none !important; transition: background .15s;
}
.top-navbar .btn-link:hover,
.top-navbar .btn-link[aria-expanded="true"] { background: #f1f5f9; }
.top-navbar .btn-link .fa-lg { font-size: 1.05rem; }

/* Dropdown navbar */
.top-navbar .dropdown-menu {
    --bs-dropdown-spacer: .6rem;
    border: 1px solid #e8ecf3; border-radius: 16px; padding: .4rem; font-size: .88rem;
    box-shadow: 0 28px 56px -24px rgba(15,23,42,0.35);
}
.top-navbar .dropdown-item        { border-radius: 10px; padding: .55rem .75rem; }
.top-navbar .dropdown-item:hover,
.top-navbar .dropdown-item:focus  { background: #f1f5f9; color: #0f172a; }
.top-navbar .dropdown-header      { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.top-navbar .dropdown-divider     { margin: .35rem .2rem; border-color: #eef2f7; }

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top:  var(--navbar-height);
    padding:     28px 30px;
    min-height:  calc(100vh - var(--navbar-height));
    background:  #f6f8fb;
    transition:  all 0.3s;
}
.sidebar.collapsed ~ .main-content { margin-left: 70px; }

/* ── Notification ── */
.notification-badge {
    position:      absolute;
    top:           3px;
    right:         3px;
    background:    #e11d48;
    color:         white;
    font-size:     10px;
    font-weight:   700;
    line-height:   1.2;
    padding:       2px 5px;
    border-radius: 999px;
    border:        2px solid #fff;
    min-width:     19px;
    text-align:    center;
}
.notification-icon {
    width:           36px;
    height:          36px;
    border-radius:   12px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      #f1f5f9;
    flex-shrink:     0;
}
.notification-item               { border-bottom: 1px solid #eef2f7; }
.notification-item:hover         { background: #f8fafc; }
.notification-item:last-child    { border-bottom: none; }
.notification-title              { font-size: 14px; }
.notification-message            { font-size: 13px; line-height: 1.4; }
.notification-time               { font-size: 12px; }
#notificationDropdown            { max-height: 400px; overflow-y: auto; min-width: 350px; }

/* ── User Dropdown ── */
.user-info {
    display:       flex;
    align-items:   center;
    cursor:        pointer;
    padding:       4px 14px 4px 4px;
    background:    #fff;
    border:        1px solid #e8ecf3;
    border-radius: 999px;
    transition:    all 0.2s;
}
.user-info:hover { background: #f8fafc; border-color: #cbd5e1; }
.user-info .fw-bold              { font-size: .84rem; line-height: 1.2; color: #0f172a; }
.user-info small                 { font-size: .72rem; }
.user-info .fa-chevron-down      { font-size: .62rem; color: #94a3b8; }
.user-avatar {
    width:           38px;
    height:          38px;
    border-radius:   50%;
    background:      #0a2e25;
    color:           var(--sb-lime);
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-weight:     700;
    margin-right:    10px;
    font-size:       1rem;
    flex-shrink:     0;
    box-shadow:      0 0 0 2px #fff, 0 0 0 3.5px rgba(190,242,100,0.6);
}

/* ── Badge Menu (NPL, SB, SHU) ── */
.menu-badge {
    margin-left:   auto;
    padding:       2px 8px;
    border-radius: 999px;
    font-size:     0.68rem;
    font-weight:   700;
    line-height:   1.5;
    margin-right:  8px;
}
.badge-danger-custom  { background: #e11d48; color: white; animation: dqBadgePulse 2s infinite; }
.badge-warning-custom { background: #fbbf24; color: #422006; }
.badge-success-custom { background: #10b981; color: white; }

/* Animasi lama dipertahankan (bisa dipakai halaman lain) */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.7; }
}
/* Nama khusus supaya tidak bentrok dengan keyframes "pulse" lain di halaman */
@keyframes dqBadgePulse {
    0%   { box-shadow: 0 0 0 0 rgba(225,29,72,0.5); }
    70%  { box-shadow: 0 0 0 7px rgba(225,29,72,0); }
    100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); }
}

/* Menu Pengaturan yang dipin di bawah (menimpa inline <style> main.php) */
.sidebar ul.sidebar-menu.sidebar-pinned {
    background: #082820 !important;
    border-top: 1px solid var(--sb-line) !important;
    padding:    8px 0 !important;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index:   1050;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 2px 0 20px rgba(0,0,0,0.3);
    }
    .top-navbar  { left: 0; }
    .main-content { margin-left: 0; }

    body.sidebar-open::before {
        content:    '';
        position:   fixed;
        inset:      0;
        background: rgba(0,0,0,0.5);
        z-index:    1040;
    }

    #notificationDropdown { min-width: 300px; }
}

/* ── Print ── */
@media print {
    .sidebar, .top-navbar { display: none !important; }
    .main-content         { margin: 0 !important; }
}
/* ============================================
   PERBAIKAN TOGGLE + MOBILE RESPONSIVE
   (tambahan di bawah — tidak mengubah CSS di atas)
   ============================================ */

/* Desktop toggle: body class sebagai fallback selector
   karena banner trial ada di antara .sidebar dan .main-content
   sehingga CSS sibling ~ kadang tidak reliable */
body.sidebar-collapsed .top-navbar   { left: 70px; }
body.sidebar-collapsed .main-content { margin-left: 70px; }

/* Mobile: perkuat responsive */
@media (max-width: 768px) {

    /* Collapsed tidak berlaku di mobile — sidebar tetap full width & slide */
    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
    }
    .sidebar.collapsed .logo h4,
    .sidebar.collapsed .logo p        { display: block !important; }
    .sidebar.collapsed .menu-header   { padding: 20px 20px 10px; text-align: left; }
    .sidebar.collapsed .menu-header span { display: inline !important; }
    .sidebar.collapsed .menu-header::after { content: none; }
    .sidebar.collapsed .sidebar-menu a    { padding: 12px 20px; justify-content: flex-start; }
    .sidebar.collapsed .sidebar-menu a span { display: inline !important; }
    .sidebar.collapsed .sidebar-menu a i  { margin-right: 12px; }
    .sidebar.collapsed .menu-dropdown     { display: block; }
    body.sidebar-collapsed .top-navbar    { left: 0 !important; }
    body.sidebar-collapsed .main-content  { margin-left: 0 !important; }

    /* Konten utama */
    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
        overflow-x: hidden;
    }
    .top-navbar { left: 0 !important; padding: 0 16px; }

    /* Banner trial lebih compact di HP */
    #bannerTrialInfo,
    #bannerTrial {
        font-size: 0.78rem;
        padding:   6px 12px;
    }

    /* Tabel & modal */
    .modal-dialog   { margin: 8px; }
    .card-body      { padding: 1rem; }

    /* Beri ruang di bawah supaya konten terakhir tidak ketutup bottom nav */
    .main-content { padding-bottom: 78px !important; }
}

/* ── Mobile Bottom Navigation (baru) ──────────────────────────────────────
   Tampil hanya di HP. Desktop tidak terpengaruh sama sekali (display:none).
   z-index 1030: di bawah sidebar overlay (1050) & backdrop (1040), supaya
   saat sidebar dibuka dari tombol "Lainnya", backdrop ikut menutupinya. */
.mobile-bottom-nav {
    display: none;
}
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display:    flex;
        position:   fixed;
        left: 0; right: 0; bottom: 0;
        height:     64px;
        background: #fff;
        border-top: 1px solid #e3e6f0;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        z-index:    1030;
    }
    .mobile-bottom-nav a {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #6c757d;
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 600;
        padding: 6px 2px;
    }
    .mobile-bottom-nav a i { font-size: 1.15rem; }
    .mobile-bottom-nav a.active { color: var(--accent-color, #4a90e2); }
}


/* Tablet (768px–992px): sidebar tetap muncul tapi lebih sempit */
@media (min-width: 769px) and (max-width: 992px) {
    :root { --sidebar-width: 220px; }
}
/* ── Jarak tombol X banner trial — paksa override Bootstrap ── */
#bannerTrialInfo .btn-close,
#bannerTrial .btn-close {
    margin-left:  12px !important;
    margin-right: 4px !important;
    position:     static !important;
}