/* ============================================
   SIMPEG - Sistem Informasi Kepegawaian
   PERUMDAM Banggai - Main Stylesheet
   ============================================ */

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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #0ea5e9;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263548;
    --bg-sidebar: #0f172a;
    --bg-input: #1e293b;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --sidebar-width: 260px;
    --header-height: 65px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.35);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root.light-mode {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-input: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

/* ---- LAYOUT ---- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex; flex-direction: column;
    transition: var(--transition);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; color: #fff;
}

.sidebar-brand .brand-text h4 {
    font-size: 16px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-brand .brand-text small {
    font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase;
}

.sidebar-menu { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-menu .menu-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--text-muted); padding: 12px 12px 6px; font-weight: 600;
}

.sidebar-menu .menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: var(--transition); margin-bottom: 2px; cursor: pointer;
}
.sidebar-menu .menu-item:hover {
    background: rgba(99,102,241,0.1); color: var(--text-primary);
}
.sidebar-menu .menu-item.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.15));
    color: var(--primary-light); font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-menu .menu-item .menu-icon { font-size: 18px; width: 24px; text-align: center; }

/* ---- SIDEBAR DROPDOWN ---- */
.sidebar-dropdown { margin-bottom: 2px; }
.sidebar-dropdown .dropdown-toggle {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: var(--transition); cursor: pointer;
    background: none; border: none; width: 100%; text-align: left;
    font-family: 'Inter', sans-serif; position: relative;
}
.sidebar-dropdown .dropdown-toggle:hover {
    background: rgba(99,102,241,0.1); color: var(--text-primary);
}
.sidebar-dropdown .dropdown-toggle.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
    color: var(--primary-light); font-weight: 600;
}
.sidebar-dropdown .dropdown-toggle .menu-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-dropdown .dropdown-toggle .dropdown-arrow {
    margin-left: auto; font-size: 12px; transition: transform 0.3s ease;
}
.sidebar-dropdown.open .dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}
.sidebar-dropdown .dropdown-menu-sub {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 0; padding-left: 0;
}
.sidebar-dropdown.open .dropdown-menu-sub {
    max-height: 400px; opacity: 1;
}
.sidebar-dropdown .dropdown-menu-sub .menu-item {
    padding: 8px 14px 8px 50px;
    font-size: 13px; font-weight: 400;
    color: var(--text-muted);
    position: relative;
}
.sidebar-dropdown .dropdown-menu-sub .menu-item::before {
    content: ''; position: absolute; left: 32px; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--text-muted); opacity: 0.4; transition: var(--transition);
}
.sidebar-dropdown .dropdown-menu-sub .menu-item:hover {
    background: rgba(99,102,241,0.08); color: var(--primary-light);
}
.sidebar-dropdown .dropdown-menu-sub .menu-item:hover::before {
    background: var(--primary-light); opacity: 1;
}
.sidebar-dropdown .dropdown-menu-sub .menu-item.active {
    color: var(--primary-light); font-weight: 600;
}
.sidebar-dropdown .dropdown-menu-sub .menu-item.active::before {
    background: var(--primary-light); opacity: 1;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1; display: flex; flex-direction: column;
    min-height: 100vh;
}

/* ---- HEADER ---- */
.top-header {
    height: var(--header-height);
    background: rgba(15,23,42,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; position: sticky; top: 0; z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-left h5 { font-size: 18px; font-weight: 600; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb .separator { color: var(--text-muted); }

.header-right { display: flex; align-items: center; gap: 20px; }

.user-dropdown {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    cursor: pointer; transition: var(--transition);
}
.user-dropdown:hover { background: var(--bg-card); }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff;
}
.user-info { text-align: right; }
.user-info .name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-info .role { font-size: 11px; color: var(--text-muted); }

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

/* ---- CARDS ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
}
.card:hover { border-color: rgba(99,102,241,0.3); }
.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h5 { font-size: 16px; font-weight: 600; }
.card-body { padding: 22px; }

/* ---- STAT CARDS ---- */
/* ---- GRID LAYOUTS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }

@media (max-width: 992px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px;
    display: flex; align-items: center; gap: 18px;
    transition: var(--transition);
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.blue::before { background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.stat-card.green::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--accent), #c084fc); }
.stat-card.orange::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.yellow::before { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.stat-card.red::before { background: linear-gradient(90deg, var(--danger), #f87171); }

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon {
    width: 52px; height: 52px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.stat-card.blue .stat-icon { background: rgba(99,102,241,0.15); color: var(--primary-light); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,0.15); color: var(--accent); }
.stat-card.orange .stat-icon { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-card.yellow .stat-icon { background: rgba(251,191,36,0.15); color: #fbbf24; }
.stat-card.red .stat-icon { background: rgba(239,68,68,0.15); color: var(--danger); }

.stat-info h3 { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-info p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%; border-collapse: collapse;
}
table th {
    padding: 12px 16px; text-align: left;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 600; color: var(--text-muted);
    background: rgba(15,23,42,0.5);
    border-bottom: 1px solid var(--border-color);
}
table td {
    padding: 12px 16px; font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}
table tr:hover td { background: rgba(99,102,241,0.04); color: var(--text-primary); }
table tr:last-child td { border-bottom: none; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; font-family: 'Inter', sans-serif;
    cursor: pointer; border: none; transition: var(--transition);
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(99,102,241,0.4); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { box-shadow: 0 4px 20px rgba(16,185,129,0.4); }
.btn-warning { background: var(--warning); color: #1e293b; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 4px 20px rgba(239,68,68,0.4); }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary-light); }
.btn-outline-primary:hover { background: rgba(99,102,241,0.15); }
.btn-outline-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-outline-info { background: transparent; border: 1px solid var(--info); color: var(--info); }
.btn-outline-info:hover { background: rgba(6,182,212,0.15); }
.btn-outline-warning { background: transparent; border: 1px solid var(--warning); color: var(--warning); }
.btn-outline-warning:hover { background: rgba(245,158,11,0.15); }
.btn-outline-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: rgba(239,68,68,0.15); }

/* ---- CHART CARDS ---- */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden; transition: var(--transition);
}
.chart-card:hover { border-color: rgba(99,102,241,0.3); box-shadow: var(--shadow); }
.chart-card .chart-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}
.chart-card .chart-header h6 {
    font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 10px;
}
.chart-card .chart-body {
    padding: 22px;
}

/* ---- MODULE PAGE ---- */
.module-hero {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius); padding: 40px; text-align: center; margin-bottom: 30px;
}
.module-hero i { font-size: 48px; color: var(--primary-light); margin-bottom: 16px; }
.module-hero h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.module-hero p { color: var(--text-muted); font-size: 14px; max-width: 500px; margin: 0 auto; }
.module-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
    padding: 6px 16px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: rgba(245,158,11,0.12); color: var(--warning); border: 1px solid rgba(245,158,11,0.25);
}

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-control {
    width: 100%; padding: 10px 14px;
    background: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }

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

/* ---- BADGE ---- */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(6,182,212,0.15); color: var(--info); }
.badge-primary { background: rgba(99,102,241,0.15); color: var(--primary-light); }

/* ---- ALERTS ---- */
.alert {
    padding: 14px 18px; border-radius: var(--radius-sm);
    margin-bottom: 20px; font-size: 14px;
    display: flex; align-items: center; gap: 10px;
    animation: slideIn 0.3s ease;
}
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-danger { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }

/* ---- LOGIN ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-dark);
    position: relative;
}
.login-wrapper::before {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(139,92,246,0.06) 0%, transparent 50%);
    animation: bgFloat 15s ease-in-out infinite;
}
.login-card {
    width: 420px; padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    position: relative; z-index: 1;
}
.login-card .login-logo {
    text-align: center; margin-bottom: 32px;
}
.login-card .login-logo .logo-icon {
    width: 64px; height: 64px; margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: #fff;
}
.login-card .login-logo h2 {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-card .login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

/* ---- PAGINATION ---- */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-top: 20px; list-style: none;
}
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--border-color);
    color: var(--text-secondary); transition: var(--transition);
}
.pagination a:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.pagination .active-page {
    background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 200;
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius); width: 500px; max-height: 80vh;
    overflow-y: auto; box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}
.modal-header {
    padding: 18px 22px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-header h5 { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 32px; height: 32px; border: none; background: transparent;
    color: var(--text-muted); font-size: 20px; cursor: pointer;
    border-radius: 50%; transition: var(--transition);
}
.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- DETAIL VIEW ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.detail-item { padding: 14px 0; border-bottom: 1px solid var(--border-color); }
.detail-item:nth-child(odd) { padding-right: 20px; }
.detail-item:nth-child(even) { padding-left: 20px; }
.detail-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 14px; font-weight: 500; color: var(--text-primary); }

.profile-header {
    display: flex; align-items: center; gap: 24px;
    padding: 24px; margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
    border-radius: var(--radius); border: 1px solid var(--border-color);
}
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.profile-info h3 { font-size: 20px; font-weight: 700; }
.profile-info p { color: var(--text-secondary); font-size: 14px; }
.profile-info .profile-meta { display: flex; gap: 16px; margin-top: 8px; }
.profile-info .profile-meta span { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

/* ---- SEARCH & FILTER ---- */
.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.search-box {
    position: relative; flex: 1; max-width: 320px;
}
.search-box input {
    width: 100%; padding: 10px 14px 10px 40px;
    background: var(--bg-input); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; font-family: 'Inter', sans-serif;
    transition: var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.search-box .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h4 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }

/* ---- ANIMATIONS ---- */
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes bgFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-2%,-2%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

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

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    :root { --sidebar-width: 240px; }
}

@media (max-width: 768px) {
    .sidebar { 
        transform: translateX(-100%); 
        width: 280px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.5);
        z-index: 99; display: none;
        backdrop-filter: blur(4px);
    }
    .sidebar-overlay.show { display: block; }
    
    .main-content { margin-left: 0; }
    .top-header { padding: 0 15px; }
    .page-content { padding: 20px 15px; }
    
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-item:nth-child(odd) { padding-right: 0; }
    .detail-item:nth-child(even) { padding-left: 0; }

    .header-left h5 { font-size: 16px; }
    .breadcrumb { display: none; }
    
    .menu-toggle { display: flex !important; }
}

.menu-toggle {
    display: none;
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 18px;
}

@media (max-width: 480px) {
    .stat-card { padding: 16px; gap: 12px; }
    .stat-icon { width: 44px; height: 44px; font-size: 20px; }
    .stat-info h3 { font-size: 22px; }
    
    .card-body { padding: 15px; }
    .gender-chart-container { flex-direction: column; gap: 20px !important; }
}
