:root {
    --sidebar-width: 265px;
    --topbar-height: 64px;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --content-bg: #f8fafc;
    --card-border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--content-bg);
    overflow-x: hidden;
    color: #334155;
}

.admin-wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.2rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-brand:hover { color: #fff; }
.sidebar-brand i { font-size: 1.45rem; color: #818cf8; }

.sidebar-brand .brand-badge {
    font-size: 0.6rem;
    background: rgba(79,70,229,0.3);
    color: #a5b4fc;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.sidebar-nav { padding: 0.75rem 0; flex: 1; }

.nav-section {
    padding: 0.7rem 1.35rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.35rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }

.sidebar-nav .nav-link.active {
    background: rgba(79, 70, 229, 0.18);
    color: #fff;
    border-left-color: #818cf8;
}

.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }

.nav-badge {
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.35rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.4rem 0;
    transition: color 0.2s;
}

.sidebar-footer a:hover { color: #f87171; }

/* ===== TOPBAR ===== */
.admin-main { flex: 1; margin-left: var(--sidebar-width); min-height: 100vh; }

.admin-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-topbar-left { display: flex; align-items: center; gap: 1rem; }

.admin-breadcrumb {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
}

.admin-breadcrumb strong { color: #0f172a; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 0.65rem; }

.topbar-icon-btn {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    position: relative;
    transition: all 0.2s;
}

.topbar-icon-btn:hover { background: var(--primary-light); color: var(--primary); border-color: #c7d2fe; }

.topbar-icon-btn .dot {
    position: absolute;
    top: 7px; right: 7px;
    width: 8px; height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

.admin-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: #334155 !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: #fff;
}

.admin-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.admin-content { padding: 1.5rem; }

/* ===== PAGE HEADER ===== */
.page-header-admin {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-admin h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
}

.page-header-admin p { color: #64748b; margin: 0; font-size: 0.875rem; }

.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== STAT CARDS ===== */
.stat-card-admin {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    border: 1px solid var(--card-border);
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card-admin:hover {
    box-shadow: 0 4px 16px rgba(79,70,229,0.08);
    transform: translateY(-1px);
}

.stat-card-admin .stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-card-admin .stat-icon-box {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.stat-card-admin .stat-icon-box.indigo { background: #eef2ff; color: #4f46e5; }
.stat-card-admin .stat-icon-box.green { background: #ecfdf5; color: #10b981; }
.stat-card-admin .stat-icon-box.amber { background: #fffbeb; color: #f59e0b; }
.stat-card-admin .stat-icon-box.red { background: #fef2f2; color: #ef4444; }
.stat-card-admin .stat-icon-box.cyan { background: #ecfeff; color: #06b6d4; }
.stat-card-admin .stat-icon-box.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-card-admin .stat-icon-box.slate { background: #f1f5f9; color: #475569; }

.stat-card-admin .stat-number {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-card-admin .stat-title { color: #64748b; font-size: 0.8rem; margin-top: 0.15rem; }

.stat-card-admin .stat-sub {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

/* ===== CARDS ===== */
.admin-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.card-header-admin {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.card-header-admin h5 {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
}

.card-body-admin { padding: 1.25rem; }
.card-body-admin.flush { padding: 0; }

/* ===== TABLES ===== */
.table-admin { margin: 0; font-size: 0.85rem; }

.table-admin thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.table-admin tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f8fafc;
    color: #334155;
}

.table-admin tbody tr:hover { background: #fafaff; }

.table-admin tbody tr:last-child td { border-bottom: none; }

/* ===== FORMS ===== */
.form-admin .form-label {
    font-weight: 500;
    color: #334155;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.form-admin .form-control,
.form-admin .form-select {
    border-radius: 8px;
    border: 1px solid var(--card-border);
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
}

.form-admin .form-control:focus,
.form-admin .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

/* ===== BUTTONS ===== */
.btn-admin-primary {
    background: var(--primary);
    border: none;
    color: #fff;
    font-weight: 500;
    padding: 0.5rem 1.15rem;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.btn-admin-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-admin-outline {
    border: 1px solid var(--card-border);
    color: #334155;
    font-weight: 500;
    padding: 0.5rem 1.15rem;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
}

.btn-admin-outline:hover {
    background: var(--primary-light);
    border-color: #c7d2fe;
    color: var(--primary);
}

.btn-action {
    width: 30px; height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* ===== FILTER BAR ===== */
.admin-filter-bar {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.admin-filter-bar .form-control,
.admin-filter-bar .form-select {
    font-size: 0.85rem;
    border-radius: 8px;
    max-width: 200px;
}

/* ===== DETAIL VIEW ===== */
.detail-section { margin-bottom: 1.25rem; }

.detail-section h6 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 0.875rem;
    gap: 1rem;
}

.detail-row .label { color: #64748b; flex-shrink: 0; }
.detail-row .value { font-weight: 500; color: #0f172a; text-align: right; }

/* ===== PROFILE HEADER ===== */
.admin-profile-banner {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 100%);
    border-radius: 14px;
    padding: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.admin-profile-avatar {
    width: 68px; height: 68px;
    background: rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.25);
}

/* ===== EMPTY STATE ===== */
.empty-state-admin {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
}

.empty-state-admin i { font-size: 2.5rem; color: #cbd5e1; display: block; margin-bottom: 0.75rem; }
.empty-state-admin h5 { color: #334155; font-weight: 600; }

/* ===== QUICK ACTIONS ===== */
.quick-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.quick-action-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-action-item:hover {
    background: var(--primary-light);
    border-color: #c7d2fe;
    color: var(--primary);
}

.quick-action-item i {
    width: 32px; height: 32px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== COMPLAINT CARD ===== */
.complaint-card-admin {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.complaint-card-admin .complaint-head {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f8fafc;
}

/* ===== BILL ===== */
.bill-container {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 14px;
}

.bill-header {
    text-align: center;
    border-bottom: 2px solid #312e81;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.bill-header h2 { font-weight: 700; color: #312e81; margin-bottom: 0.25rem; }

/* ===== AUTH ===== */
.admin-auth-page {
    min-height: 100vh;
    display: flex;
    background: #f8fafc;
}

.admin-auth-left {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #312e81 50%, #1e1b4b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.admin-auth-left::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23818cf8' fill-opacity='0.06'%3E%3Cpath d='M0 0h20v20H0V0zm20 20h20v20H20V20z'/%3E%3C/g%3E%3C/svg%3E");
}

.admin-auth-left-content { position: relative; z-index: 1; color: #fff; max-width: 420px; }
.admin-auth-left-content h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.admin-auth-left-content p { opacity: 0.85; line-height: 1.7; }

.admin-auth-features { margin-top: 2rem; }
.admin-auth-features .feat {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.85rem; font-size: 0.9rem;
}
.admin-auth-features .feat i {
    width: 32px; height: 32px;
    background: rgba(129,140,248,0.2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #a5b4fc;
}

.admin-auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-width: 500px;
}

.admin-auth-card { width: 100%; max-width: 400px; }
.admin-auth-card .auth-logo { text-align: center; margin-bottom: 1.75rem; }
.admin-auth-card .auth-logo i { font-size: 2.5rem; color: #4f46e5; }
.admin-auth-card h3 { text-align: center; font-weight: 700; color: #0f172a; margin-bottom: 0.3rem; }
.admin-auth-card .auth-sub { text-align: center; color: #64748b; font-size: 0.9rem; margin-bottom: 1.75rem; }
.admin-auth-card .form-control {
    padding: 0.7rem 0.9rem; border-radius: 8px;
    border: 1px solid var(--card-border); font-size: 0.9rem;
}
.admin-auth-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.admin-auth-card .form-label { font-weight: 500; font-size: 0.85rem; }
.btn-auth-admin {
    width: 100%; padding: 0.75rem;
    background: #4f46e5; border: none; color: #fff;
    font-weight: 600; border-radius: 8px; font-size: 0.9rem;
}
.btn-auth-admin:hover { background: #4338ca; color: #fff; }

/* ===== REPORT TABS ===== */
.admin-tabs .nav-link {
    color: #64748b; font-weight: 500; font-size: 0.875rem;
    border: none; padding: 0.55rem 1.1rem; border-radius: 8px;
}
.admin-tabs .nav-link.active { background: #4f46e5; color: #fff; }

/* ===== STATUS TIMELINE ===== */
.activity-item {
    display: flex;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8fafc;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.indigo { background: #4f46e5; }
.activity-dot.green { background: #10b981; }
.activity-dot.amber { background: #f59e0b; }

@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-auth-left { display: none; }
    .admin-auth-right { max-width: 100%; }
}

@media print {
    .admin-sidebar, .admin-topbar, .no-print { display: none !important; }
    .admin-main { margin-left: 0 !important; }
    .admin-content { padding: 0 !important; }
}
