/* ============================================
   RAHARSA CRM - Main Stylesheet
   Brand: Dark Red #7A0C1E | White #FFFFFF
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:       #7A0C1E;
    --primary-dark:  #5A0916;
    --primary-light: #9B1229;
    --accent:        #C41E3A;
    --white:         #FFFFFF;
    --gray-50:       #F8F9FA;
    --gray-100:      #F1F3F5;
    --gray-200:      #E9ECEF;
    --gray-300:      #DEE2E6;
    --gray-400:      #CED4DA;
    --gray-500:      #ADB5BD;
    --gray-600:      #6C757D;
    --gray-700:      #495057;
    --gray-800:      #343A40;
    --gray-900:      #212529;
    --green:         #10B981;
    --orange:        #F59E0B;
    --blue:          #3B82F6;
    --purple:        #8B5CF6;
    --red:           #EF4444;
    --sidebar-w:     260px;
    --topbar-h:      64px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.15);
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --transition:    all .2s ease;
}

html { font-size: 15px; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform .3s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    min-height: 80px;
}

.sidebar-logo img { height: 40px; width: auto; object-fit: contain; }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,.75);
    font-size: .92rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-item:hover { background: rgba(255,255,255,.12); color: var(--white); }
.nav-item.active { background: rgba(255,255,255,.2); color: var(--white); font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: 1rem; }
.nav-item.logout { color: rgba(255,255,255,.6); margin-top: auto; }
.nav-item.logout:hover { background: rgba(239,68,68,.2); color: #FCA5A5; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 190;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin .3s ease;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    font-size: 1.2rem;
    color: var(--gray-600);
    padding: 8px;
    border-radius: var(--radius-sm);
    display: none;
}
.topbar-toggle:hover { background: var(--gray-100); color: var(--primary); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.topbar-notif {
    position: relative;
    padding: 8px;
    color: var(--gray-600);
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
}
.topbar-notif:hover { background: var(--gray-100); color: var(--primary); }

.notif-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: var(--red);
    color: white;
    font-size: .65rem;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .9rem;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: .88rem; font-weight: 600; color: var(--gray-800); }
.user-role { font-size: .75rem; color: var(--gray-500); }

/* ============================================
   PAGE CONTENT
   ============================================ */
.page-content { padding: 24px; flex: 1; }

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 24px;
}

.greeting-block h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.greeting-block .greeting-sub {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 4px;
    color: var(--gray-500);
    font-size: .875rem;
}

.greeting-block .greeting-sub span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: .78rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Stat icon colors */
.icon-primary   { background: #FDE8EB; color: var(--primary); }
.icon-orange    { background: #FEF3C7; color: #D97706; }
.icon-purple    { background: #EDE9FE; color: #7C3AED; }
.icon-blue      { background: #DBEAFE; color: #2563EB; }
.icon-green     { background: #D1FAE5; color: #059669; }
.icon-red       { background: #FEE2E2; color: #DC2626; }
.icon-gray      { background: var(--gray-100); color: var(--gray-600); }

/* ============================================
   CONTENT GRID
   ============================================ */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.content-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--gray-800);
}

.card-link {
    font-size: .8rem;
    color: var(--primary);
    font-weight: 600;
}
.card-link:hover { text-decoration: underline; }

.card-body { padding: 16px 20px; }

/* ============================================
   PROSPEK LIST ITEM
   ============================================ */
.prospek-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}
.prospek-item:last-child { border-bottom: none; }
.prospek-item:hover { background: var(--gray-50); }

.prospek-info { flex: 1; min-width: 0; }
.prospek-name { font-weight: 600; font-size: .9rem; color: var(--gray-900); }
.prospek-sub { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }

.prospek-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 120px; }

.progress-wrap { width: 100px; }
.progress-bar-bg {
    height: 6px;
    background: var(--gray-200);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 2px;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
}
.progress-pct { font-size: .75rem; font-weight: 600; color: var(--gray-700); }

/* ============================================
   STATUS BADGE
   ============================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-new      { background: #EDE9FE; color: #7C3AED; }
.badge-followup { background: #FEF3C7; color: #B45309; }
.badge-nego     { background: #DBEAFE; color: #1D4ED8; }
.badge-closing  { background: #D1FAE5; color: #065F46; }
.badge-cancel   { background: #FEE2E2; color: #991B1B; }

/* ============================================
   AKTIVITAS LIST
   ============================================ */
.aktivitas-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.aktivitas-item:last-child { border-bottom: none; }

.aktivitas-time {
    min-width: 48px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
}

.aktivitas-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
    color: var(--primary);
    flex-shrink: 0;
}

.aktivitas-info { flex: 1; }
.aktivitas-title { font-size: .87rem; font-weight: 600; color: var(--gray-800); }
.aktivitas-sub { font-size: .77rem; color: var(--gray-500); margin-top: 2px; }

/* ============================================
   TOP SALES LIST
   ============================================ */
.top-sales-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.top-sales-item:last-child { border-bottom: none; }

.rank-badge {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: .75rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rank-badge.rank-1 { background: #F59E0B; }
.rank-badge.rank-2 { background: var(--gray-400); }
.rank-badge.rank-3 { background: #CD7C2F; }

.sales-name { flex: 1; font-size: .87rem; font-weight: 600; }

.sales-bar-wrap { width: 100px; }
.sales-bar-bg {
    height: 6px;
    background: var(--gray-200);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 2px;
}
.sales-bar-fill { height: 100%; border-radius: 99px; background: var(--primary); }
.sales-count { font-size: .8rem; font-weight: 700; color: var(--gray-700); }

/* ============================================
   FUNNEL
   ============================================ */
.funnel-wrap { padding: 16px 20px; }
.funnel-step {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.funnel-label { width: 100px; font-size: .82rem; color: var(--gray-600); }
.funnel-bar-bg { flex: 1; height: 28px; background: var(--gray-100); border-radius: var(--radius-sm); overflow: hidden; }
.funnel-bar-fill {
    height: 100%;
    display: flex; align-items: center; padding-left: 10px;
    color: white;
    font-size: .8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: width .5s ease;
}
.funnel-pct { width: 40px; text-align: right; font-size: .8rem; font-weight: 600; color: var(--gray-600); }

/* ============================================
   INACTIVE PROSPEK
   ============================================ */
.inactive-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
}
.inactive-item:last-child { border-bottom: none; }
.inactive-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #FEE2E2;
    color: var(--red);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}
.inactive-info { flex: 1; }
.inactive-name { font-size: .87rem; font-weight: 600; color: var(--gray-800); }
.inactive-days { font-size: .77rem; color: var(--red); font-weight: 500; margin-top: 2px; }

/* ============================================
   CHART CONTAINERS
   ============================================ */
.chart-container {
    position: relative;
    padding: 16px 20px;
}

.chart-container canvas { max-height: 260px; }
.chart-donut-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 20px;
}
.chart-donut-wrap canvas { max-width: 160px; max-height: 160px; }
.donut-legend { flex: 1; }
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: .82rem;
}
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-label { flex: 1; color: var(--gray-700); }
.legend-val { font-weight: 700; color: var(--gray-800); }

/* ============================================
   FORMS
   ============================================ */
.form-wrapper {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    padding: 24px;
    max-width: 720px;
}

.form-section-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 12px;
    margin-top: 20px;
}
.form-section-title:first-child { margin-top: 0; }

.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-label .req { color: var(--red); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color .2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(122,12,30,.08);
}
.form-control::placeholder { color: var(--gray-400); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }

textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

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

.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* Progress Slider */
.progress-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 99px;
    background: var(--gray-200);
    outline: none;
}
.progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(122,12,30,.15);
}
.progress-value-display {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-top: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

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

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

.btn-danger {
    background: var(--red);
    color: white;
    border-color: var(--red);
}
.btn-danger:hover { background: #DC2626; }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: .95rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================
   TABLES
   ============================================ */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .87rem;
}
thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
    vertical-align: middle;
}
tbody tr:hover { background: var(--gray-50); }

/* ============================================
   SEARCH & FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}
.search-wrap .form-control { padding-left: 36px; }

/* ============================================
   HISTORI TIMELINE
   ============================================ */
.timeline { padding: 16px 20px; }
.timeline-item {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-content { flex: 1; }
.timeline-date { font-size: .78rem; color: var(--gray-500); margin-bottom: 4px; }
.timeline-status { font-weight: 700; font-size: .87rem; color: var(--gray-800); }
.timeline-progress { font-size: .8rem; color: var(--primary); font-weight: 600; }
.timeline-note { font-size: .83rem; color: var(--gray-600); margin-top: 4px; }

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.upload-area:hover { border-color: var(--primary); background: #FDE8EB22; }
.upload-area i { font-size: 2rem; color: var(--gray-400); margin-bottom: 8px; }
.upload-area p { font-size: .85rem; color: var(--gray-500); }

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: .87rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-danger   { background: #FEE2E2; color: #991B1B; }
.alert-warning  { background: #FEF3C7; color: #92400E; }

/* ============================================
   SUMBER LEADS BARS
   ============================================ */
.leads-source-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: .83rem;
}
.leads-source-label { width: 90px; color: var(--gray-700); font-weight: 500; }
.leads-source-bar { flex: 1; height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.leads-source-fill { height: 100%; border-radius: 99px; background: var(--primary); }
.leads-source-val { width: 60px; text-align: right; color: var(--gray-600); font-weight: 600; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, #C41E3A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo img { height: 48px; margin: 0 auto; filter: invert(1) brightness(0.3) sepia(1) hue-rotate(330deg) saturate(5); }
.login-logo h1 { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin-top: 8px; }
.login-logo p { font-size: .85rem; color: var(--gray-500); }

/* ============================================
   TAB PILLS
   ============================================ */
.tab-pills {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab-pill {
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    border: none;
    background: none;
}
.tab-pill.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state i { font-size: 2.5rem; color: var(--gray-300); margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { font-size: .85rem; color: var(--gray-400); margin-bottom: 16px; }

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.detail-field label { font-size: .75rem; color: var(--gray-500); font-weight: 600; display: block; margin-bottom: 2px; }
.detail-field span { font-size: .9rem; color: var(--gray-800); font-weight: 500; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main-content { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .content-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .content-grid,
    .content-grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .chart-donut-wrap { flex-direction: column; }
    .form-wrapper { padding: 16px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .search-wrap { min-width: auto; }
    .stat-value { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .login-card { padding: 28px 20px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
