/* ============================================================
   Impound Insure — Admin Panel Stylesheet
   Dark theme, matches QuikInsureCover admin design language
   ============================================================ */

:root {
    --primary: #0047FF;
    --secondary: #00D4FF;
    --bg-dark: #0A0E1A;
    --sidebar-bg: #0D1220;
    --topbar-bg: #0D1220;
    --card-bg: #111629;
    --card-border: rgba(255, 255, 255, 0.08);
    --text-light: #CBD5E1;
    --text-muted: #64748B;
    --input-bg: #0A0E1A;
}

* { box-sizing: border-box; }

body.admin-body {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────────── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 20px;
}

.admin-sidebar-brand .brand-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.1rem; flex-shrink: 0;
}

.admin-sidebar-brand .brand-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    line-height: 1.2;
}

.admin-sidebar-brand .brand-title span { color: var(--secondary); }

.admin-sidebar-brand .brand-sub {
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 18px 10px 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.15s;
}

.sidebar-link i { width: 18px; text-align: center; color: var(--text-muted); }

.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(0,71,255,0.18), rgba(0,212,255,0.10));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(0,71,255,0.3);
}

.sidebar-link.active i { color: var(--secondary); }

.admin-sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--card-border);
    padding-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-sidebar-footer .avatar {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.75rem; color: #fff; flex-shrink: 0;
}

.admin-sidebar-footer .name { font-size: 0.82rem; font-weight: 600; color: #fff; }
.admin-sidebar-footer .role { font-size: 0.68rem; color: var(--secondary); }

.admin-sidebar-footer form { margin-left: auto; }
.admin-sidebar-footer button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 0.9rem;
}
.admin-sidebar-footer button:hover { color: #EF4444; }

/* ── Main content area ────────────────────────────────────── */
.admin-main {
    flex: 1;
    min-width: 0;
    padding: 28px 32px 48px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-page-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    margin: 0;
}

.admin-page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Cards ────────────────────────────────────────────────── */
.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px 22px;
}

.card-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Stat cards (KPI) ─────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--stat-color, var(--primary));
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-value {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    line-height: 1.15;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-change {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 6px;
}

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.filter-input, .filter-select {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 9px 12px;
    color: #fff;
    font-size: 0.82rem;
    min-width: 150px;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover { opacity: 0.9; }

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: 8px;
    padding: 9px 16px;
    color: #34D399;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}

.export-btn:hover {
    background: rgba(16,185,129,0.2);
    color: #34D399;
}

/* ── Topbar buttons (pagination / back / actions) ───────────── */
.topbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.topbar-btn-outline {
    background: rgba(255,255,255,0.04);
    border-color: var(--card-border);
    color: var(--text-light);
}

.topbar-btn-outline:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.topbar-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

/* ── Table ────────────────────────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.admin-table thead th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* ── Status badges ────────────────────────────────────────── */
.badge-paid {
    display: inline-flex;
    align-items: center;
    background: rgba(16,185,129,0.12);
    color: #34D399;
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-pending {
    display: inline-flex;
    align-items: center;
    background: rgba(245,158,11,0.12);
    color: #FCD34D;
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ── Utility (Bootstrap-like, in case Bootstrap grid isn't loaded) ── */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.ms-auto { margin-left: auto; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.w-100 { width: 100%; }

/* Responsive */
@media (max-width: 991px) {
    .admin-sidebar { position: fixed; left: -260px; z-index: 50; transition: left 0.2s; }
    .admin-sidebar.open { left: 0; }
    .admin-main { padding: 20px; }
}