/* ============================================================
   DocNex Reporting — Admin CSS
   Dark, professional, pharma intelligence aesthetic
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg-base:        #0b0e18;
    --bg-surface:     #111525;
    --bg-elevated:    #181d30;
    --bg-hover:       #1e2438;
    --bg-input:       #161929;

    --border:         #1f2540;
    --border-light:   #262d47;

    --accent:         #4f7cff;
    --accent-hover:   #3d6bef;
    --accent-glow:    rgba(79,124,255,0.18);
    --accent-dim:     rgba(79,124,255,0.08);

    --success:        #22c55e;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #38bdf8;

    --text-primary:   #e8ecf4;
    --text-secondary: #8b93a9;
    --text-muted:     #545d78;

    --sidebar-w:      240px;
    --header-h:       60px;
    --radius:         10px;
    --radius-sm:      6px;
    --radius-lg:      14px;

    --shadow:         0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

/* ── App Shell ──────────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--border);
}
.brand-logo {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.brand-icon {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    letter-spacing: 0.5px;
}
.brand-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}
.brand-sub {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-left: 2px solid var(--accent);
    padding-left: 10px;
}
.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-top: 1px solid var(--border);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}
.logout-btn {
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    transition: all 0.15s;
    flex-shrink: 0;
}
.logout-btn:hover { background: rgba(239,68,68,0.1); color: var(--danger); }
.logout-btn svg { width: 16px; height: 16px; }

/* ── Main Wrap ──────────────────────────────────────────────── */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Header ─────────────────────────────────────────────── */
.top-header {
    height: var(--header-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}
.sidebar-toggle svg { width: 20px; height: 20px; }
.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-badge-btn {
    position: relative;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.header-badge-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.header-badge-btn svg { width: 18px; height: 18px; }
.header-badge {
    position: absolute;
    top: -2px; right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* ── Flash Messages ─────────────────────────────────────────── */
.flash-container { padding: 16px 24px 0; display: flex; flex-direction: column; gap: 8px; }
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
}
.flash svg { width: 16px; height: 16px; flex-shrink: 0; }
.flash-close { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.6; }
.flash-close:hover { opacity: 1; }
.flash-success { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.flash-error   { background: rgba(239,68,68,0.1); color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }
.flash-info    { background: rgba(56,189,248,0.1); color: var(--info);   border: 1px solid rgba(56,189,248,0.2); }
.flash-warning { background: rgba(245,158,11,0.1); color: var(--warning);border: 1px solid rgba(245,158,11,0.2); }

/* ── Page Content ───────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
}
.stat-card.green::before  { background: var(--success); }
.stat-card.amber::before  { background: var(--warning); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.blue::before   { background: var(--info); }
.stat-card.purple::before { background: #a855f7; }

.stat-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.blue   { background: rgba(79,124,255,0.12); color: var(--accent); }
.stat-icon.green  { background: rgba(34,197,94,0.12);  color: var(--success); }
.stat-icon.amber  { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,0.12);  color: var(--danger); }
.stat-icon.purple { background: rgba(168,85,247,0.12); color: #a855f7; }
.stat-icon.cyan   { background: rgba(56,189,248,0.12); color: var(--info); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title svg { width: 16px; height: 16px; color: var(--text-muted); }
.card-body { padding: 20px; }
.card-body-flush { padding: 0; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-hover); color: var(--text-primary); }
.td-primary { color: var(--text-primary) !important; font-weight: 500; }
.td-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-success { background: rgba(34,197,94,0.12);  color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.12); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,0.12);  color: var(--danger); }
.badge-info    { background: rgba(56,189,248,0.12); color: var(--info); }
.badge-neutral { background: rgba(139,147,169,0.12);color: var(--text-secondary); }
.badge-accent  { background: var(--accent-dim);     color: var(--accent); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-success { background: rgba(34,197,94,0.1); color: var(--success); border-color: rgba(34,197,94,0.2); }
.btn-success:hover { background: rgba(34,197,94,0.2); color: var(--success); }

.btn-danger { background: rgba(239,68,68,0.1); color: var(--danger); border-color: rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); color: var(--danger); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 22px; font-size: 14px; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13.5px;
    padding: 9px 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select option { background: var(--bg-elevated); }
textarea { resize: vertical; min-height: 90px; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Toggles / Checkboxes ───────────────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.toggle-desc  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.toggle {
    position: relative;
    width: 42px; height: 22px;
    flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 22px;
    cursor: pointer;
    transition: all 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 2px; left: 2px;
    transition: all 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before {
    background: #fff;
    transform: translateX(20px);
}

/* Checkboxes */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.checkbox-item:hover { background: var(--bg-hover); }
.checkbox-item input[type="checkbox"] {
    width: 14px; height: 14px;
    cursor: pointer;
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-wrap { background: var(--bg-elevated); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.5s ease;
}
.progress-bar.green  { background: var(--success); }
.progress-bar.amber  { background: var(--warning); }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-count {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 20px;
}

/* ── Filters / Search Bar ───────────────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filters-bar input,
.filters-bar select {
    width: auto;
    min-width: 160px;
}
.filters-bar .spacer { flex: 1; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header-left { display: flex; flex-direction: column; gap: 4px; }
.page-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-header .breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.page-header .breadcrumb a { color: var(--text-muted); }
.page-header .breadcrumb a:hover { color: var(--accent); }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Grid Layout ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* ── Metric Item ────────────────────────────────────────────── */
.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.metric-row:last-child { border-bottom: none; }
.metric-key { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.metric-val { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.metric-val.override { color: var(--warning); }
.metric-val small { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }

/* ── Chart Container ────────────────────────────────────────── */
.chart-wrap { position: relative; height: 240px; }
.chart-wrap-sm { height: 180px; }
.chart-wrap-lg { height: 320px; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 12px;
}
.empty-state svg { width: 40px; height: 40px; opacity: 0.4; }
.empty-state p { font-size: 14px; text-align: center; }

/* ── Pill / Channel Tag ─────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    background: var(--bg-elevated);
}
.pill.active { border-color: rgba(79,124,255,0.3); color: var(--accent); background: var(--accent-dim); }

/* ── Live Pulse ─────────────────────────────────────────────── */
.live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    position: relative;
}
.live-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--success);
    opacity: 0.3;
    animation: live-pulse 1.5s infinite;
}
@keyframes live-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.6); opacity: 0; }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow);
    transform: scale(0.95);
    transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Divider ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Info Box ───────────────────────────────────────────────── */
.info-box {
    background: rgba(79,124,255,0.06);
    border: 1px solid rgba(79,124,255,0.15);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.info-box svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.info-box.warn { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.15); }
.info-box.warn svg { color: var(--warning); }

/* ── Color Picker ───────────────────────────────────────────── */
.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-picker-wrap input[type="color"] {
    width: 40px; height: 36px;
    padding: 2px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.color-picker-wrap input[type="text"] { width: auto; flex: 1; }

/* ── Avatar / Logo Preview ──────────────────────────────────── */
.logo-preview {
    width: 60px; height: 60px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    padding: 4px;
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    padding: 16px 0;
}
.page-link {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.page-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.page-link.active { background: var(--accent); color: #fff; }

/* ── Login Page ─────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    padding: 20px;
}
.login-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}
.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.login-logo-icon {
    width: 44px; height: 44px;
    background: var(--accent);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; color: #fff;
}
.login-logo-text h2 { font-size: 18px; font-weight: 700; }
.login-logo-text p { font-size: 12px; color: var(--text-muted); }
.login-box h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-box .subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .btn { width: 100%; justify-content: center; padding: 11px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
    .main-wrap { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-grid-3 { grid-template-columns: 1fr; }
    .form-group.span-2, .form-group.span-3 { grid-column: span 1; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .login-box { padding: 28px 20px; }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeIn 0.2s ease; }

/* ── Utility ────────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-primary  { color: var(--text-primary); }
.text-accent   { color: var(--accent); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-danger   { color: var(--danger); }
.text-sm       { font-size: 12px; }
.text-xs       { font-size: 11px; }
.font-mono     { font-family: 'JetBrains Mono', monospace; }
.font-bold     { font-weight: 700; }
.mb-0          { margin-bottom: 0; }
.mb-8          { margin-bottom: 8px; }
.mb-12         { margin-bottom: 12px; }
.mb-16         { margin-bottom: 16px; }
.mb-24         { margin-bottom: 24px; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.gap-16        { gap: 16px; }
.flex-1        { flex: 1; }
.nowrap        { white-space: nowrap; }
.truncate      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
