/* ============================================================
   ELECTIONS COMMUNALES TÉLIMÉLÉ — Feuille de styles v2
   Palette: #5A5F2E dominant | #FFFFFF clean | #C8A646 accent minimal
   Style: Gouvernemental, professionnel, moderne
   ============================================================ */

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

/* ---- VARIABLES ---- */
:root {
    --primary: #5A5F2E;
    --primary-light: #6E7438;
    --primary-dark: #464A23;
    --primary-darker: #353819;
    --primary-rgb: 90, 95, 46;

    --accent: #C8A646;
    --accent-light: #D4B85E;
    --accent-dark: #B8953A;
    --accent-rgb: 200, 166, 70;

    --white: #FFFFFF;
    --bg: #F5F6F3;
    --bg-warm: #F8F8F6;
    --bg-card: #FFFFFF;

    --text-dark: #1A1C0F;
    --text-body: #3D3F2E;
    --text-mid: #5E6050;
    --text-light: #8B8D7F;
    --text-lighter: #A8AAA0;

    --border: #D8DAD0;
    --border-light: #E8EAE3;
    --border-lighter: #F0F1ED;

    --success: #3D7A35;
    --success-light: #EBF5E9;
    --danger: #B5302A;
    --danger-light: #FBEAEA;
    --warning: #C47A1A;
    --warning-light: #FEF4E6;
    --info: #2563A8;
    --info-light: #E8F1FB;

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

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow: 0 2px 10px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);

    --transition: all 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-body);
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---- SIDEBAR ---- */
.sidebar {
    width: 272px;
    background: var(--primary-dark);
    color: var(--white);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 2px 0 20px rgba(0,0,0,0.12);
    overflow: hidden;
}

.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.95);
    padding: 3px;
    flex-shrink: 0;
}

.sidebar-header-text {
    overflow: hidden;
    min-width: 0;
}

.sidebar-header h1 {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.3;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header .subtitle {
    font-size: 12px;
    opacity: 0.45;
    margin-top: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    margin-top: 8px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; overflow-x: hidden; }

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255,255,255,0.25);
    padding: 18px 14px 8px;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.55);
    font-size: 14.5px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.7; }
.nav-link.active svg { opacity: 1; }

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

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--white);
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
}

.user-avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.user-info { flex: 1; min-width: 0; }
.user-info .name { font-size: 14px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role-label { font-size: 12px; opacity: 0.4; font-weight: 500; }

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: 272px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- TOP BAR ---- */
.top-bar {
    background: var(--white);
    padding: 0 36px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 20px;
}

.top-bar-title {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.top-bar-breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.top-bar-breadcrumb a { color: var(--text-light); }
.top-bar-breadcrumb a:hover { color: var(--primary); }
.top-bar-breadcrumb .separator { opacity: 0.35; }
.top-bar-breadcrumb .current { color: var(--primary); font-weight: 600; }

.top-bar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* ---- SEARCH ---- */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 10px 16px;
    border: 1.5px solid var(--border-light);
    transition: var(--transition);
    width: 340px;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
    background: var(--white);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 14.5px;
    flex: 1;
    font-family: var(--font);
    color: var(--text-dark);
    font-weight: 400;
}

.search-box input::placeholder { color: var(--text-lighter); }
.search-box svg { color: var(--text-light); flex-shrink: 0; }

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

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    border: 1.5px solid var(--border-light);
    transition: var(--transition);
    position: relative;
}

.stat-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}

.stat-icon-primary { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }
.stat-icon-secondary { background: var(--bg); color: var(--text-mid); }
.stat-icon-success { background: var(--success-light); color: var(--success); }
.stat-icon-warning { background: var(--warning-light); color: var(--warning); }

.stat-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--font);
    font-size: 36px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-sub { font-size: 13.5px; color: var(--text-light); margin-top: 5px; font-weight: 500; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--border-light);
    overflow: hidden;
    margin-bottom: 22px;
}

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

.card-header h3 {
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.1px;
}

.card-body { padding: 26px; }
.card-body-flush { padding: 0; }

.card-footer {
    padding: 14px 26px;
    border-top: 1px solid var(--border-lighter);
    background: var(--bg-warm);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
    text-align: left;
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-light);
    font-weight: 700;
    background: var(--bg-warm);
    border-bottom: 1.5px solid var(--border-light);
    white-space: nowrap;
}

tbody td {
    padding: 14px 20px;
    font-size: 15px;
    border-bottom: 1px solid var(--border-lighter);
    color: var(--text-body);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-warm); }

.td-actions { text-align: right; white-space: nowrap; }
.td-actions .btn-group { display: inline-flex; gap: 5px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge-m { background: var(--info-light); color: var(--info); }
.badge-f { background: #F5EBF5; color: #8B3A8B; }
.badge-role { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.1px;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

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

.btn-secondary { background: var(--accent); color: var(--white); }
.btn-secondary:hover { background: var(--accent-light); color: var(--white); }

.btn-outline { background: var(--white); border: 1.5px solid var(--border); color: var(--text-mid); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb), 0.02); }

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

.btn-success { background: var(--success); color: var(--white); }

.btn-sm { padding: 7px 15px; font-size: 13px; }
.btn-lg { padding: 13px 30px; font-size: 16px; }

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1.5px solid var(--border-light);
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb), 0.03); }
.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 22px; }

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 7px;
    letter-spacing: 0.1px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    color: var(--text-dark);
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
}

.form-control::placeholder { color: var(--text-lighter); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B8D7F' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

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

.form-error { font-size: 13px; color: var(--danger); margin-top: 5px; font-weight: 500; }
.form-hint { font-size: 13px; color: var(--text-light); margin-top: 5px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    cursor: pointer;
    font-size: 15px;
}

.form-check input[type="checkbox"] {
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
    border-radius: 3px;
}

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

.filter-select {
    padding: 9px 36px 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--white);
    color: var(--text-body);
    font-family: var(--font);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B8D7F' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    font-weight: 500;
}

.filter-select:focus { outline: none; border-color: var(--primary); }
.filter-count { font-size: 14px; color: var(--text-light); margin-left: auto; font-weight: 500; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 15px 22px;
    border-radius: var(--radius);
    font-size: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(61,122,53,0.15); }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(181,48,42,0.15); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(196,122,26,0.15); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(37,99,168,0.15); }

.alert-password {
    background: var(--warning-light);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    color: var(--text-dark);
}

.alert-password code {
    background: var(--white);
    padding: 3px 12px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
    letter-spacing: 1px;
    border: 1px solid var(--border-light);
}

/* ============================================================
   CANDIDATE DETAIL
   ============================================================ */
.candidate-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px;
    border-bottom: 1px solid var(--border-lighter);
}

.candidate-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700; color: var(--white);
    font-family: var(--font);
    flex-shrink: 0;
}

.candidate-meta h2 {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.2px;
}

.candidate-meta p { font-size: 15px; color: var(--text-light); margin-top: 3px; font-weight: 500; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    padding: 28px;
}

.info-item label {
    display: block;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 5px;
}
.info-item span {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
}

/* ============================================================
   DOCUMENTS
   ============================================================ */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
    padding: 22px;
}

.doc-card {
    background: var(--bg-warm);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.doc-card:hover { border-color: var(--primary); box-shadow: var(--shadow-xs); }

.doc-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    margin-bottom: 12px;
}

.doc-icon-pdf { background: var(--danger-light); color: var(--danger); }
.doc-icon-word { background: var(--info-light); color: var(--info); }
.doc-icon-image { background: var(--success-light); color: var(--success); }

.doc-name { font-size: 14px; font-weight: 600; color: var(--text-dark); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 12px; color: var(--text-light); font-weight: 500; }
.doc-actions { display: flex; gap: 5px; margin-top: 12px; }

/* ---- UPLOAD AREA ---- */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 44px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-warm);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.02);
}

.upload-area-icon { color: var(--text-light); margin-bottom: 12px; }
.upload-area-text { font-weight: 600; color: var(--text-dark); margin-bottom: 4px; font-size: 16px; }
.upload-area-hint { font-size: 14px; color: var(--text-light); }

/* ============================================================
   CHARTS
   ============================================================ */
.commune-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.commune-bar-label {
    font-size: 14px;
    color: var(--text-mid);
    width: 140px;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.commune-bar-track {
    flex: 1;
    height: 30px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.commune-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    font-size: 13px;
    color: var(--white);
    font-weight: 700;
    min-width: 30px;
    transition: width 0.5s ease;
}

.donut-chart { position: relative; display: inline-block; }
.donut-legend { display: flex; flex-direction: column; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.legend-dot { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-lighter);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 7px;
    flex-shrink: 0;
}

.activity-content { flex: 1; }
.activity-text { font-size: 14px; color: var(--text-mid); line-height: 1.5; }
.activity-text strong { color: var(--text-dark); font-weight: 600; }
.activity-time { font-size: 12px; color: var(--text-lighter); margin-top: 3px; font-weight: 500; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-light); }
.empty-state-icon {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    color: var(--text-light);
}
.empty-state p { font-size: 15px; margin-top: 8px; }

/* ---- CONTENT GRIDS ---- */
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; }
.content-grid-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ---- PAGINATION ---- */
.pagination-wrapper { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px; }
.pagination-wrapper nav span, .pagination-wrapper nav a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    border: 1.5px solid var(--border-light); color: var(--text-mid);
    transition: var(--transition);
}
.pagination-wrapper nav span[aria-current] { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination-wrapper nav a:hover { border-color: var(--primary); color: var(--primary); }

/* ---- PERMISSION GRID ---- */
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.permission-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-mid); font-weight: 500; }
.permission-item svg { color: var(--success); flex-shrink: 0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dark);
    position: relative;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.02) 0%, transparent 40%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 48px 42px;
    width: 440px;
    max-width: 95%;
    box-shadow: 0 32px 64px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.login-logo {
    display: block;
    width: 90px;
    margin: 0 auto 22px;
}

.login-card h2 {
    font-family: var(--font);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 14.5px;
    margin-bottom: 28px;
    font-weight: 400;
}

.login-divider {
    width: 40px; height: 3px;
    background: var(--primary);
    margin: 0 auto 24px;
    border-radius: 2px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    letter-spacing: 0.2px;
    margin-top: 8px;
}

.login-btn:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.login-footer { text-align: center; font-size: 13px; color: var(--text-lighter); margin-top: 20px; }

/* ---- CONFIRM DIALOG ---- */
.confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.confirm-dialog {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 36px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.confirm-dialog h4 { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 10px; }
.confirm-dialog p { font-size: 15px; color: var(--text-mid); margin-bottom: 22px; line-height: 1.5; }
.confirm-dialog .btn-group { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-result-item {
    display: block;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-lighter);
    transition: var(--transition);
}
.search-result-item:hover { background: var(--bg-warm); }
.search-result-item:last-child { border-bottom: none; }
.search-result-name { font-size: 15px; font-weight: 600; color: var(--text-dark); }
.search-result-meta { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.search-no-result { padding: 16px; text-align: center; color: var(--text-light); font-size: 14px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid, .content-grid-equal { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .top-bar { padding: 0 16px; height: 56px; }
    .page-content { padding: 20px 16px; }
    .search-box { width: 200px; }
    .form-row, .form-row-3, .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .stat-grid { grid-template-columns: 1fr; }
    .search-box { display: none; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .doc-grid { grid-template-columns: 1fr; }
    .permission-grid { grid-template-columns: 1fr; }
}

.mobile-toggle { display: none; background: none; border: none; color: var(--primary); cursor: pointer; padding: 4px; }
@media (max-width: 992px) { .mobile-toggle { display: block; } }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 99; }
.sidebar-overlay.show { display: block; }
