/* ============================================================
   PDAM BELINYU - MAIN STYLESHEET (REVAMPED)
   Konsisten, rapi, dan modern.
   ============================================================ */

:root {
    --primary: #0066CC;
    --primary-dark: #004C99;
    --primary-light: #E6F0FA;
    --secondary: #00A8E8;
    --accent: #00C9A7;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --dark: #1e293b;
    --gray-900: #0f172a;
    --gray-700: #334155;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --light: #f8fafc;
    --border: #e2e8f0;

    --sidebar-bg: #1a2942;
    --sidebar-hover: #243859;
    --sidebar-active: #2d4671;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
    --shadow-lg: 0 10px 30px rgba(15,23,42,0.08), 0 4px 12px rgba(15,23,42,0.05);

    --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background-color: #f5f7fa;
    color: var(--dark);
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary { color: var(--primary) !important; }
.bg-primary   { background-color: var(--primary) !important; }
.cursor-pointer { cursor: pointer; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: var(--radius);
    padding: 9px 18px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border-width: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn i { font-size: 0.95em; }

.btn-sm { padding: 6px 12px; font-size: 0.825rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,102,204,0.25);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-outline-secondary {
    color: var(--gray-700);
    border-color: var(--gray-300);
    background: white;
}
.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

.btn:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(0,102,204,0.18) !important;
    outline: none;
}

/* ============================================================
   FORMS (input, textarea, select) - CONSISTENT
   ============================================================ */
.form-control,
.form-select {
    border-radius: var(--radius);
    padding: 10px 14px;
    border: 1px solid var(--border);
    font-size: 0.92rem;
    background-color: white;
    color: var(--gray-900);
    transition: var(--transition);
    box-shadow: none;
}

.form-control::placeholder { color: var(--gray-400); }

.form-control:hover,
.form-select:hover {
    border-color: var(--gray-300);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
    background-color: white;
}

.form-control:disabled,
.form-select:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-control-sm,
.form-select-sm {
    padding: 7px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* ===== CUSTOM SELECT ARROW (FIX DROPDOWN JELEK) ===== */
.form-select {
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230066CC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
}
.form-select-sm {
    padding-right: 32px;
    background-position: right 10px center;
    background-size: 14px;
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.input-group-text {
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--gray-500);
    border-radius: var(--radius);
    font-size: 0.92rem;
}
.input-group > .form-control,
.input-group > .form-select { border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--radius) !important; border-bottom-left-radius: var(--radius) !important; }
.input-group > :last-child  { border-top-right-radius: var(--radius) !important; border-bottom-right-radius: var(--radius) !important; }

.form-text { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

/* Radio button toggle (prioritas) */
.btn-check:checked + .btn-outline-success {
    background: var(--success); border-color: var(--success); color: white;
}
.btn-check:checked + .btn-outline-warning {
    background: var(--warning); border-color: var(--warning); color: white;
}
.btn-check:checked + .btn-outline-danger {
    background: var(--danger); border-color: var(--danger); color: white;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #0066CC 0%, #00A8E8 100%);
    color: white;
    padding: 80px 0 120px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M0,50 Q25,30 50,50 T100,50 L100,100 L0,100 Z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E") repeat-x;
    background-size: 100px 50px;
    opacity: 0.3;
}
.hero-content { position: relative; z-index: 2; }
.hero-section h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1.5rem; line-height: 1.2; }
.hero-section p  { font-size: 1.15rem; opacity: 0.95; }
.hero-section .btn-light {
    background: white; color: var(--primary);
    border: none; padding: 14px 32px; font-weight: 600;
}
.hero-section .btn-outline-light { border: 2px solid white; padding: 12px 32px; font-weight: 600; }
.hero-image img { max-width: 100%; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15)); }

/* ============================================================
   STATS / SECTION
   ============================================================ */
.stats-section { margin-top: -60px; position: relative; z-index: 3; }
.section-padding { padding: 80px 0; }
.section-title    { font-size: 2.25rem; font-weight: 700; color: var(--dark); margin-bottom: 1rem; text-align: center; }
.section-subtitle { color: var(--gray-500); text-align: center; margin-bottom: 3rem; font-size: 1.05rem; }

/* Landing page stat-card (besar, di tengah hero) */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transition: var(--transition);
    border-top: 4px solid var(--primary);
    height: 100%;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card .stat-icon {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; margin-bottom: 15px;
}
.stat-card .stat-number { font-size: 2.5rem; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-card .stat-label  { color: var(--gray-500); font-size: 0.95rem; margin-top: 5px; }

/* ============================================================
   STEPS / FAQ / CTA  (landing)
   ============================================================ */
.step-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px 25px;
    text-align: center;
    height: 100%;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}
.step-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

.step-number {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 40px;
    background: var(--primary); color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(0,102,204,0.3);
}
.step-icon {
    width: 80px; height: 80px;
    background: var(--primary-light); color: var(--primary);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 32px; margin: 15px 0 20px;
}
.step-card h5 { font-weight: 700; margin-bottom: 10px; }
.step-card p  { color: var(--gray-500); font-size: 0.95rem; margin: 0; }

.accordion-item {
    border: 1px solid var(--border);
    border-radius: 12px !important;
    margin-bottom: 12px;
    overflow: hidden;
}
.accordion-button { font-weight: 600; padding: 18px 20px; background: white; }
.accordion-button:not(.collapsed) { background: var(--primary-light); color: var(--primary); box-shadow: none; }
.accordion-button:focus { box-shadow: none; border: none; }

.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white; padding: 60px 0; border-radius: var(--radius-xl); margin: 40px 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-main { background: #0f1c30; color: white; }
.footer-links, .footer-contact { list-style: none; padding: 0; }
.footer-links li, .footer-contact li { margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-contact li { color: rgba(255,255,255,0.7); font-size: 0.95rem; }
.footer-contact i  { color: var(--secondary); width: 20px; margin-right: 8px; }
.social-icons a {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1); color: white;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; margin-right: 8px;
    transition: var(--transition); text-decoration: none;
}
.social-icons a:hover { background: var(--secondary); transform: translateY(-3px); }
.footer-bottom { background: #0a1422; border-top: 1px solid rgba(255,255,255,0.05); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0066CC 0%, #00A8E8 100%);
    display: flex; align-items: center; padding: 40px 0;
}
.auth-card {
    background: white; border-radius: var(--radius-xl);
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
    overflow: hidden; max-width: 1000px; margin: 0 auto;
}
.auth-image {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; padding: 50px 40px; position: relative; overflow: hidden;
}
.auth-image::before {
    content: ''; position: absolute; top: -50px; right: -50px;
    width: 200px; height: 200px; background: rgba(255,255,255,0.1); border-radius: 50%;
}
.auth-image::after {
    content: ''; position: absolute; bottom: -80px; left: -80px;
    width: 250px; height: 250px; background: rgba(255,255,255,0.05); border-radius: 50%;
}
.auth-image h3 { font-weight: 700; font-size: 1.75rem; position: relative; z-index: 2; }

.auth-form { padding: 50px 40px; }
.auth-form h2 { font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.auth-form .form-label { font-weight: 500; font-size: 0.875rem; color: var(--gray-700); }
.auth-form .input-group-text { background: var(--light); border: 1px solid var(--border); color: var(--gray-500); }

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */
.dashboard-wrapper,
.dashboard-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Custom scrollbar untuk sidebar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}

.sidebar-brand {
    color: white; font-weight: 700; font-size: 1.15rem;
    text-decoration: none;
    display: flex; align-items: center; gap: 10px;
}
.sidebar-brand i { color: var(--secondary); font-size: 1.4rem; }

.btn-close-sidebar {
    background: transparent; border: none; color: white; font-size: 18px;
    width: 32px; height: 32px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-close-sidebar:hover { background: rgba(255,255,255,0.1); }

.sidebar-user {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
}

.avatar-circle {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.95rem;
    flex-shrink: 0;
}
.avatar-circle-lg {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.3rem;
}

.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section {
    padding: 15px 20px 6px;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1.2px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: white; }
.sidebar-link.active {
    background: var(--sidebar-active);
    color: white;
    border-left-color: var(--secondary);
}
.sidebar-link i { width: 20px; text-align: center; font-size: 0.95rem; }

.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    background: #f5f7fa;
}

/* ============================================================
   TOP NAVBAR (DASHBOARD)
   ============================================================ */
.navbar-dashboard {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.navbar-dashboard .container-fluid { padding-left: 28px; padding-right: 28px; }

/* Notification & profile dropdown TRIGGER */
.navbar-dashboard .nav-icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gray-700);
    background: transparent;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    border: none;
}
.navbar-dashboard .nav-icon-btn:hover { background: var(--gray-100); color: var(--primary); }

.navbar-dashboard .nav-profile-btn {
    display: inline-flex; align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--gray-900);
    transition: var(--transition);
}
.navbar-dashboard .nav-profile-btn:hover {
    background: var(--gray-100);
    border-color: var(--border);
}
.navbar-dashboard .nav-profile-btn .chev { font-size: 0.7rem; color: var(--gray-500); }

/* Notif badge */
.notif-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.62rem;
    font-weight: 600;
    height: 18px; min-width: 18px;
    border-radius: 999px;
    padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid white;
}

.content-wrapper { padding: 28px; }

.page-header { margin-bottom: 22px; }
.page-header h1,
.page-header h3 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}
.page-header p { color: var(--gray-500); margin: 0; font-size: 0.92rem; }

/* ============================================================
   DROPDOWN MENU (notifikasi & profile) — REWORKED
   ============================================================ */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(15,23,42,0.12), 0 2px 8px rgba(15,23,42,0.06);
    padding: 8px;
    min-width: 240px;
    margin-top: 8px !important;
    font-size: 0.9rem;
    animation: dropdownFade 0.15s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-menu .dropdown-header {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
    padding: 10px 12px 8px;
    text-transform: none;
    letter-spacing: 0;
}

.dropdown-divider {
    border-color: var(--border);
    margin: 6px 0;
    opacity: 1;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.88rem;
    color: var(--gray-700);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--gray-100);
    color: var(--primary);
}
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-item i { color: var(--gray-400); width: 16px; text-align: center; }
.dropdown-item:hover i { color: var(--primary); }
.dropdown-item.text-danger i { color: var(--danger); }

/* Notification dropdown */
.notif-dropdown {
    width: 340px;
    max-width: 90vw;
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
}
.notif-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.notif-item {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray-700);
    margin-bottom: 2px;
    transition: var(--transition);
    white-space: normal;
    border-left: 3px solid transparent;
}
.notif-item:hover { background: var(--gray-100); color: var(--gray-900); }
.notif-item.unread {
    background: var(--primary-light);
    border-left-color: var(--primary);
}
.notif-item.unread:hover { background: #d8e8f7; }
.notif-item .notif-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; color: var(--gray-900); }
.notif-item .notif-msg   { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 4px; line-height: 1.4; }
.notif-item .notif-time  { font-size: 0.7rem; color: var(--gray-400); }
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--gray-400);
}
.notif-empty i { font-size: 2rem; opacity: 0.4; margin-bottom: 8px; display: block; }
.notif-empty p { font-size: 0.85rem; margin: 0; }

/* Profile dropdown */
.profile-dropdown { width: 240px; }
.profile-dropdown .profile-info {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.profile-dropdown .profile-name { font-weight: 600; color: var(--gray-900); font-size: 0.9rem; }
.profile-dropdown .profile-role {
    color: var(--gray-500);
    font-size: 0.75rem;
    text-transform: capitalize;
    margin-top: 2px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: white;
}
.card-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}
.card-body { padding: 20px; }
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }

/* ============================================================
   STAT BOX (UNIFIED) — SATU POLA UNTUK SEMUA DASHBOARD
   ============================================================ */
.stat-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.stat-box::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
}
.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-box .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}

.stat-box .stat-label {
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 4px;
}
.stat-box .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.1;
}

/* Variants */
.stat-box.stat-success::before { background: var(--success); }
.stat-box.stat-success .stat-icon { background: var(--success-light); color: var(--success); }

.stat-box.stat-warning::before { background: var(--warning); }
.stat-box.stat-warning .stat-icon { background: var(--warning-light); color: var(--warning); }

.stat-box.stat-danger::before { background: var(--danger); }
.stat-box.stat-danger .stat-icon { background: var(--danger-light); color: var(--danger); }

.stat-box.stat-info::before { background: var(--info); }
.stat-box.stat-info .stat-icon { background: var(--info-light); color: var(--info); }

/* Legacy support — di pelanggan dashboard format <h3>/<p>, akan ditampilkan rapi juga */
.stat-box h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
    line-height: 1.1;
}
.stat-box p {
    color: var(--gray-500);
    margin: 4px 0 0;
    font-size: 0.82rem;
    font-weight: 500;
}
.stat-box .stat-icon-sm {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}
.stat-box.stat-success .stat-icon-sm { background: var(--success-light); color: var(--success); }
.stat-box.stat-warning .stat-icon-sm { background: var(--warning-light); color: var(--warning); }
.stat-box.stat-danger  .stat-icon-sm { background: var(--danger-light); color: var(--danger); }
.stat-box.stat-info    .stat-icon-sm { background: var(--info-light); color: var(--info); }

/* Soft backgrounds (untuk admin dashboard yang pakai class .bg-*-soft) */
.bg-primary-soft   { background-color: rgba(0, 102, 204, 0.05) !important; }
.bg-info-soft      { background-color: rgba(59, 130, 246, 0.05) !important; }
.bg-success-soft   { background-color: rgba(16, 185, 129, 0.05) !important; }
.bg-warning-soft   { background-color: rgba(245, 158, 11, 0.05) !important; }
.bg-danger-soft    { background-color: rgba(239, 68, 68, 0.05) !important; }
.bg-secondary-soft { background-color: rgba(108, 117, 125, 0.05) !important; }

.bg-primary-soft.stat-box::before  { background: var(--primary); }
.bg-info-soft.stat-box::before     { background: var(--info); }
.bg-success-soft.stat-box::before  { background: var(--success); }
.bg-warning-soft.stat-box::before  { background: var(--warning); }
.bg-danger-soft.stat-box::before   { background: var(--danger); }

.bg-primary-soft.stat-box .stat-icon  { background: var(--primary); color: white; }
.bg-info-soft.stat-box .stat-icon     { background: var(--info); color: white; }
.bg-success-soft.stat-box .stat-icon  { background: var(--success); color: white; }
.bg-warning-soft.stat-box .stat-icon  { background: var(--warning); color: white; }
.bg-danger-soft.stat-box .stat-icon   { background: var(--danger); color: white; }

/* ============================================================
   TABLE
   ============================================================ */
.table {
    color: var(--gray-900);
    margin-bottom: 0;
    font-size: 0.9rem;
}
.table thead th {
    background: var(--light);
    border-bottom: 1px solid var(--border);
    border-top: none;
    font-weight: 600;
    color: var(--gray-700);
    padding: 12px 14px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.table tbody td {
    padding: 13px 14px;
    vertical-align: middle;
    border-color: var(--border);
}
.table-hover tbody tr:hover {
    background-color: var(--gray-100) !important;
}
.table-light, .table > :not(caption) > * > * {
    background-color: transparent;
}
.table thead.table-light th { background: var(--light); }

code {
    font-size: 0.85em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.2px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(15,23,42,0.2);
}
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 22px;
}
.modal-title { font-weight: 600; font-size: 1.05rem; color: var(--gray-900); }
.modal-body { padding: 22px; }
.modal-footer {
    border-top: 1px solid var(--border);
    padding: 14px 22px;
    background: var(--light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.btn-close { padding: 0.5rem; }

/* ============================================================
   ALERT
   ============================================================ */
.alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.alert-success { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--info-light);    color: #1e40af; border-color: #bfdbfe; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px; top: 5px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item.success::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.warning::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-item.danger::before  { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger); }
.timeline-content {
    background: var(--light);
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.timeline-date { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 5px; }

/* ============================================================
   DETAIL ITEMS / EMPTY STATE / IMAGE PREVIEW
   ============================================================ */
.detail-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.detail-item:last-child { border-bottom: none; }
.detail-label { font-size: 0.8rem; color: var(--gray-500); margin-bottom: 4px; font-weight: 500; }
.detail-value { font-weight: 500; color: var(--gray-900); }

.empty-state { text-align: center; padding: 56px 20px; }
.empty-state i { font-size: 3.5rem; color: var(--gray-300); margin-bottom: 12px; }
.empty-state h5 { color: var(--gray-700); margin-bottom: 4px; font-weight: 600; }
.empty-state p  { color: var(--gray-500); margin: 0; font-size: 0.9rem; }

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius);
    margin-top: 10px;
    border: 1px solid var(--border);
}

/* ============================================================
   SIDEBAR OVERLAY (MOBILE)
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 1029;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   DATATABLES OVERRIDE
   ============================================================ */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 0.85rem;
    background-color: white;
    transition: var(--transition);
}
.dataTables_wrapper .dataTables_length select {
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 6 8 10 12 6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    appearance: none;
    -webkit-appearance: none;
}
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
    color: var(--gray-500);
    font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_paginate {
    margin-top: 12px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px !important;
    border: 1px solid var(--border) !important;
    padding: 5px 10px !important;
    font-size: 0.82rem !important;
    color: var(--gray-700) !important;
    background: white !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-900) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: var(--gray-300) !important;
    background: white !important;
    cursor: not-allowed;
}
table.dataTable.no-footer { border-bottom: 1px solid var(--border); }
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc { cursor: pointer; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hero-section h1 { font-size: 2.25rem; }
    .stats-section { margin-top: 30px; }
}
@media (max-width: 575.98px) {
    .content-wrapper { padding: 16px; }
    .hero-section { padding: 50px 0 80px; }
    .stat-card { padding: 20px; }
    .stat-card .stat-number { font-size: 2rem; }
    .stat-box { padding: 16px; }
    .stat-box .stat-number, .stat-box h3 { font-size: 1.5rem; }
    .stat-box .stat-icon, .stat-box .stat-icon-sm { width: 44px; height: 44px; font-size: 18px; }
    .auth-form { padding: 30px 20px; }
    .section-title { font-size: 1.75rem; }
    .notif-dropdown { width: 300px; }
    .dropdown-menu { font-size: 0.92rem; }
    .modal-body { padding: 18px; }
    .navbar-dashboard .container-fluid { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar, .navbar-dashboard, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content-wrapper { padding: 0 !important; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }
