/* ============================================================
   KaamSatya AI - Main Stylesheet
   Jaipur Smart City Branding: Dark Indigo/Navy + Emerald Green
   Government Sector Premium Design
   ============================================================ */

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

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
    --navy-950:    #060B18;
    --navy-900:    #0A1128;
    --navy-800:    #0E1A3D;
    --navy-700:    #142252;
    --navy-600:    #1A2B68;
    --navy-500:    #1E3478;
    --navy-400:    #2D4799;
    --indigo-700:  #1F2D7A;
    --indigo-600:  #2539A0;
    --indigo-500:  #2D46C9;
    --indigo-400:  #4A63DD;
    --indigo-300:  #7088F0;

    --emerald-600: #047857;
    --emerald-500: #059669;
    --emerald-400: #10B981;
    --emerald-300: #34D399;
    --emerald-200: #6EE7B7;
    --emerald-100: #D1FAE5;

    --amber-500:   #F59E0B;
    --amber-400:   #FBBF24;
    --amber-300:   #FCD34D;
    --red-600:     #DC2626;
    --red-500:     #EF4444;
    --red-400:     #F87171;
    --orange-500:  #F97316;
    --orange-400:  #FB923C;

    --white:       #FFFFFF;
    --gray-50:     #F8FAFC;
    --gray-100:    #F1F5F9;
    --gray-200:    #E2E8F0;
    --gray-300:    #CBD5E1;
    --gray-400:    #94A3B8;
    --gray-500:    #64748B;
    --gray-600:    #475569;
    --gray-700:    #334155;
    --gray-800:    #1E293B;
    --gray-900:    #0F172A;

    --surface-1:   #0D1535;
    --surface-2:   #111D45;
    --surface-3:   #162254;
    --surface-card:#0F1A40;
    --border:      rgba(65, 90, 160, 0.3);
    --border-light:rgba(100, 130, 200, 0.2);
    --glow-emerald:0 0 20px rgba(16, 185, 129, 0.3);
    --glow-indigo: 0 0 20px rgba(74, 99, 221, 0.3);

    --text-primary:  #E2E8F0;
    --text-secondary:#94A3B8;
    --text-muted:    #64748B;
    --text-accent:   #34D399;

    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-2xl:  32px;

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.6);
    --shadow-xl:   0 16px 64px rgba(0,0,0,0.7);

    --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main:   'Inter', system-ui, sans-serif;
    --sidebar-w:   260px;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background: var(--navy-950);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 57, 160, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(5, 150, 105, 0.08), transparent);
}

a { color: var(--emerald-400); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--emerald-300); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ─── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--white); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p  { color: var(--text-secondary); }

.text-accent    { color: var(--emerald-400); }
.text-muted     { color: var(--text-muted); }
.text-danger    { color: var(--red-400); }
.text-warning   { color: var(--amber-400); }
.text-sm        { font-size: 0.85rem; }
.text-xs        { font-size: 0.75rem; }
.font-semibold  { font-weight: 600; }
.font-bold      { font-weight: 700; }

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

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

.page-body {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
}

/* ─── Government Header / Top Navbar ─────────────────────────── */
.gov-banner {
    background: linear-gradient(135deg, #0A1128 0%, #0E1A3D 50%, #142252 100%);
    border-bottom: 2px solid var(--emerald-600);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.6);
}

.gov-banner-top {
    background: rgba(5, 150, 105, 0.1);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--emerald-300);
}

.gov-banner-top .gov-links { display: flex; gap: 1.5rem; }
.gov-banner-top .gov-links a { color: var(--emerald-300); font-size: 0.72rem; }
.gov-banner-top .gov-links a:hover { color: var(--emerald-200); }

.gov-banner-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
}

.gov-logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gov-emblem {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--emerald-600), var(--indigo-600));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
    border: 2px solid var(--emerald-400);
    box-shadow: var(--glow-emerald);
    flex-shrink: 0;
}

.gov-title-block .gov-system-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.gov-title-block .gov-system-name span { color: var(--emerald-400); }
.gov-title-block .gov-subtitle {
    font-size: 0.7rem;
    color: var(--emerald-300);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}
.gov-title-block .gov-authority {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.gov-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* User badge in header */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.35rem 0.9rem 0.35rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.user-badge:hover { background: rgba(255,255,255,0.1); border-color: var(--emerald-600); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald-600), var(--indigo-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-badge-info { line-height: 1.2; }
.user-badge-name { font-size: 0.8rem; font-weight: 600; color: var(--white); }
.user-badge-role { font-size: 0.68rem; color: var(--emerald-400); }

/* Role Switcher Dropdown */
.role-switcher {
    position: relative;
}

.role-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(37, 57, 160, 0.4);
    border: 1px solid var(--indigo-400);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.8rem;
    color: var(--indigo-300);
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--transition);
}

.role-switcher-btn:hover { background: rgba(37, 57, 160, 0.7); color: white; }

.role-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    min-width: 240px;
    box-shadow: var(--shadow-xl);
    z-index: 200;
    display: none;
    animation: dropIn 0.2s ease;
}

.role-dropdown.show { display: block; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.role-dropdown-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.3rem 0.6rem 0.5rem;
    font-weight: 600;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    color: var(--text-primary);
}

.role-option:hover { background: rgba(255,255,255,0.06); }

.role-option-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.role-option-icon.admin      { background: rgba(37,57,160,0.3); color: var(--indigo-300); }
.role-option-icon.supervisor { background: rgba(5,150,105,0.2); color: var(--emerald-400); }
.role-option-icon.staff      { background: rgba(249,115,22,0.2); color: var(--orange-400); }
.role-option-icon.citizen    { background: rgba(100,116,139,0.2); color: var(--gray-400); }

.role-option-info .role-name { font-size: 0.82rem; font-weight: 600; }
.role-option-info .role-email { font-size: 0.68rem; color: var(--text-muted); }

/* ─── Sidebar Navigation ─────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 90;
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--emerald-600), var(--indigo-500));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--glow-emerald);
}

.sidebar-brand-text .brand-name { font-size: 1rem; font-weight: 800; color: var(--white); }
.sidebar-brand-text .brand-name span { color: var(--emerald-400); }
.sidebar-brand-text .brand-sub  { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.nav-section { padding: 0 0.75rem; margin-bottom: 0.5rem; }

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.5rem 0.6rem 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--white);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(37,57,160,0.4), rgba(16,185,129,0.15));
    color: var(--white);
    border: 1px solid rgba(74,99,221,0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--emerald-400);
    border-radius: 0 3px 3px 0;
}

.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; color: var(--emerald-400); }

.nav-badge {
    margin-left: auto;
    background: var(--red-600);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 100px;
    min-width: 18px;
    text-align: center;
}

.sidebar-user-info {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    background: rgba(255,255,255,0.02);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--emerald-600), var(--indigo-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: var(--white); }
.sidebar-user-role { font-size: 0.68rem; color: var(--emerald-400); }

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: var(--radius-md);
    color: var(--red-400);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover { background: rgba(220, 38, 38, 0.2); color: var(--red-300); }

/* ─── Cards & Stat Boxes ─────────────────────────────────────── */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover { border-color: rgba(74,99,221,0.4); box-shadow: var(--glow-indigo); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    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-lg) var(--radius-lg) 0 0;
}

.stat-card.emerald::before { background: linear-gradient(90deg, var(--emerald-500), var(--emerald-300)); }
.stat-card.indigo::before  { background: linear-gradient(90deg, var(--indigo-500), var(--indigo-300)); }
.stat-card.amber::before   { background: linear-gradient(90deg, var(--amber-500), var(--amber-300)); }
.stat-card.red::before     { background: linear-gradient(90deg, var(--red-500), var(--red-400)); }
.stat-card.orange::before  { background: linear-gradient(90deg, var(--orange-500), var(--orange-400)); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card.emerald .stat-icon { background: rgba(16,185,129,0.15); color: var(--emerald-400); }
.stat-card.indigo  .stat-icon { background: rgba(74,99,221,0.15);  color: var(--indigo-300); }
.stat-card.amber   .stat-icon { background: rgba(245,158,11,0.15); color: var(--amber-400); }
.stat-card.red     .stat-icon { background: rgba(239,68,68,0.15);  color: var(--red-400); }
.stat-card.orange  .stat-icon { background: rgba(249,115,22,0.15); color: var(--orange-400); }

.stat-value { font-size: 2rem; font-weight: 800; color: var(--white); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.25rem; font-weight: 500; }
.stat-change { font-size: 0.72rem; margin-top: 0.4rem; }
.stat-change.up   { color: var(--emerald-400); }
.stat-change.down { color: var(--red-400); }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--emerald-600), var(--emerald-500));
    color: white;
    box-shadow: 0 4px 12px rgba(5,150,105,0.4);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--emerald-500), var(--emerald-400));
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(5,150,105,0.5);
    color: white;
}

.btn-secondary {
    background: rgba(37,57,160,0.3);
    color: var(--indigo-300);
    border: 1px solid rgba(37,57,160,0.5);
}
.btn-secondary:hover { background: rgba(37,57,160,0.5); color: white; }

.btn-danger {
    background: rgba(220,38,38,0.2);
    color: var(--red-400);
    border: 1px solid rgba(220,38,38,0.3);
}
.btn-danger:hover { background: rgba(220,38,38,0.35); }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.8rem; font-size: 0.95rem; }
.btn-full { width: 100%; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--white); }

/* ─── Form Elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

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

.form-control {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--emerald-500);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.15);
}

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

select.form-control option {
    background: var(--surface-2);
    color: var(--text-primary);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .form-control { padding-left: 2.5rem; }

.input-group-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

/* ─── Status & Priority Badges ───────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-assigned      { background: rgba(100,116,139,0.15); color: #94A3B8; border: 1px solid rgba(100,116,139,0.3); }
.badge-inprogress    { background: rgba(74,99,221,0.15);   color: #7088F0; border: 1px solid rgba(74,99,221,0.3); }
.badge-pending       { background: rgba(245,158,11,0.15);  color: #FCD34D; border: 1px solid rgba(245,158,11,0.3); }
.badge-verified      { background: rgba(5,150,105,0.15);   color: #34D399; border: 1px solid rgba(5,150,105,0.3); }
.badge-suspicious    { background: rgba(249,115,22,0.15);  color: #FB923C; border: 1px solid rgba(249,115,22,0.3); }
.badge-failed        { background: rgba(220,38,38,0.15);   color: #F87171; border: 1px solid rgba(220,38,38,0.3); }
.badge-inspection    { background: rgba(168,85,247,0.15);  color: #C084FC; border: 1px solid rgba(168,85,247,0.3); }
.badge-escalated     { background: rgba(220,38,38,0.2);    color: #FC8181; border: 1px solid rgba(220,38,38,0.4); }
.badge-closed        { background: rgba(16,185,129,0.08);  color: #6EE7B7; border: 1px solid rgba(16,185,129,0.2); }
.badge-default       { background: rgba(100,116,139,0.1);  color: var(--gray-400); }

.priority-low      { color: var(--emerald-400); }
.priority-medium   { color: var(--amber-400); }
.priority-high     { color: var(--orange-400); }
.priority-critical { color: var(--red-400); animation: pulse-critical 1.5s infinite; }

@keyframes pulse-critical {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.ai-badge-pass       { background: rgba(5,150,105,0.15);  color: var(--emerald-300); padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.72rem; font-weight: 700; }
.ai-badge-suspicious { background: rgba(249,115,22,0.15); color: var(--orange-400);  padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.72rem; font-weight: 700; }
.ai-badge-fail       { background: rgba(220,38,38,0.15);  color: var(--red-400);     padding: 0.2rem 0.6rem; border-radius: 100px; font-size: 0.72rem; font-weight: 700; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

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

thead { background: rgba(255,255,255,0.03); }

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 0.85rem 1rem;
    font-size: 0.83rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

.work-id {
    font-family: monospace;
    font-size: 0.78rem;
    color: var(--emerald-400);
    background: rgba(16,185,129,0.08);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* ─── AI Score Ring ──────────────────────────────────────────── */
.risk-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 800;
    border: 2px solid;
}

.risk-score.low    { color: var(--emerald-400); border-color: var(--emerald-500); background: rgba(16,185,129,0.1); }
.risk-score.medium { color: var(--amber-400);   border-color: var(--amber-500);   background: rgba(245,158,11,0.1); }
.risk-score.high   { color: var(--red-400);     border-color: var(--red-500);     background: rgba(239,68,68,0.1); }

/* ─── Alerts / Banners ───────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border: 1px solid;
}

.alert-error   { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.25); color: var(--red-300); }
.alert-success { background: rgba(5,150,105,0.08); border-color: rgba(5,150,105,0.25); color: var(--emerald-300); }
.alert-warning { background: rgba(245,158,11,0.08);border-color: rgba(245,158,11,0.25);color: var(--amber-300); }
.alert-info    { background: rgba(74,99,221,0.08); border-color: rgba(74,99,221,0.25); color: var(--indigo-300); }

/* ─── Page Header ─────────────────────────────────────────────── */
.page-header {
    margin-bottom: 1.75rem;
}

.page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header-title { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.page-header-sub   { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--emerald-400); }
.breadcrumb-sep { color: var(--text-muted); opacity: 0.4; }

/* ─── Grid Layouts ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* ─── Auth Page ──────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--navy-950);
    background-image:
        radial-gradient(ellipse 100% 60% at 50% -10%, rgba(30,52,120,0.3), transparent),
        radial-gradient(ellipse 70% 50% at 90% 90%, rgba(4,120,87,0.1), transparent);
}

.auth-gov-header {
    background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
    border-bottom: 3px solid var(--emerald-600);
    padding: 0;
}

.auth-gov-top {
    background: rgba(5,150,105,0.08);
    border-bottom: 1px solid rgba(16,185,129,0.15);
    padding: 0.35rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--emerald-300);
}

.auth-gov-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.auth-gov-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-emblem {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.auth-emblem-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--emerald-700), var(--indigo-600));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid var(--emerald-500);
    box-shadow: var(--glow-emerald);
}

.auth-title-block .primary { font-size: 1.5rem; font-weight: 900; color: white; letter-spacing: -0.02em; }
.auth-title-block .primary span { color: var(--emerald-400); }
.auth-title-block .secondary { font-size: 0.72rem; color: var(--emerald-300); text-transform: uppercase; letter-spacing: 0.1em; }
.auth-title-block .tertiary  { font-size: 0.67rem; color: var(--text-muted); }

.auth-gov-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gov-badge {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    text-align: center;
}

.gov-badge .badge-title { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); display: block; }
.gov-badge .badge-value { font-size: 0.72rem; font-weight: 700; color: var(--emerald-300); }

.auth-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    max-width: 1100px;
    width: 100%;
    align-items: center;
}

.auth-info { }

.auth-info-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-info-title .highlight { color: var(--emerald-400); }

.auth-info-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.auth-features { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }

.auth-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald-400);
    flex-shrink: 0;
}

.auth-stats-mini { display: flex; gap: 1.5rem; }
.auth-stat-mini { text-align: center; }
.auth-stat-mini .value { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.auth-stat-mini .label { font-size: 0.7rem; color: var(--text-muted); }

/* Auth Card */
.auth-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
}

.auth-tabs {
    display: flex;
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 1.75rem;
    gap: 3px;
}

.auth-tab {
    flex: 1;
    padding: 0.55rem;
    text-align: center;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    color: var(--text-muted);
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--emerald-700), var(--emerald-600));
    color: white;
    box-shadow: 0 2px 8px rgba(5,150,105,0.4);
}

.auth-form-section { display: none; }
.auth-form-section.active { display: block; }

/* Quick Login Section */
.quick-login-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.quick-login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid;
    background: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.78rem;
    font-weight: 600;
    width: 100%;
    text-align: left;
}

.quick-btn .qb-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.quick-btn.admin      { color: var(--indigo-300); border-color: rgba(74,99,221,0.3); }
.quick-btn.admin:hover{ background: rgba(74,99,221,0.12); }
.quick-btn.admin .qb-icon { background: rgba(74,99,221,0.2); }

.quick-btn.supervisor      { color: var(--emerald-400); border-color: rgba(16,185,129,0.3); }
.quick-btn.supervisor:hover{ background: rgba(16,185,129,0.08); }
.quick-btn.supervisor .qb-icon { background: rgba(16,185,129,0.15); }

.quick-btn.staff      { color: var(--orange-400); border-color: rgba(249,115,22,0.3); }
.quick-btn.staff:hover{ background: rgba(249,115,22,0.08); }
.quick-btn.staff .qb-icon { background: rgba(249,115,22,0.15); }

.quick-btn.citizen      { color: var(--gray-400); border-color: rgba(100,116,139,0.3); }
.quick-btn.citizen:hover{ background: rgba(100,116,139,0.08); }
.quick-btn.citizen .qb-icon { background: rgba(100,116,139,0.15); }

.quick-btn .qb-text .qb-label { display: block; font-size: 0.75rem; font-weight: 700; }
.quick-btn .qb-text .qb-sub   { display: block; font-size: 0.65rem; opacity: 0.7; font-weight: 400; }

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Dashboard Page Header ──────────────────────────────────── */
.dash-welcome {
    background: linear-gradient(135deg, var(--surface-card) 0%, rgba(37,57,160,0.2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.dash-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.dash-welcome-greeting { font-size: 0.82rem; color: var(--emerald-400); font-weight: 600; margin-bottom: 0.3rem; }
.dash-welcome-name     { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.dash-welcome-sub      { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; }

.dash-welcome-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.meta-item { text-align: right; }
.meta-item .meta-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.meta-item .meta-value { font-size: 0.88rem; font-weight: 700; color: var(--white); }

/* ─── Timeline / Activity ─────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 1rem; }

.timeline-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.35rem;
    border: 2px solid;
}

.timeline-dot.emerald { background: var(--emerald-500); border-color: var(--emerald-300); box-shadow: 0 0 6px rgba(16,185,129,0.4); }
.timeline-dot.red     { background: var(--red-500);     border-color: var(--red-300);     box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.timeline-dot.amber   { background: var(--amber-500);   border-color: var(--amber-300); }
.timeline-dot.indigo  { background: var(--indigo-500);  border-color: var(--indigo-300); }

.timeline-content .timeline-action { font-size: 0.83rem; color: var(--text-primary); font-weight: 500; }
.timeline-content .timeline-time   { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb { background: var(--navy-600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-500); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .auth-container { grid-template-columns: 1fr; }
    .auth-info { display: none; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-body { padding: 1rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .auth-gov-badges { display: none; }
    .quick-login-grid { grid-template-columns: 1fr; }
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-fadein { animation: fadeInUp 0.4s ease forwards; }

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% auto;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* ─── Misc Utilities ─────────────────────────────────────────── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm       { gap: 0.5rem; }
.gap-md       { gap: 1rem; }
.gap-lg       { gap: 1.5rem; }
.mt-1         { margin-top: 0.5rem; }
.mt-2         { margin-top: 1rem; }
.mt-3         { margin-top: 1.5rem; }
.mb-1         { margin-bottom: 0.5rem; }
.mb-2         { margin-bottom: 1rem; }
.mb-3         { margin-bottom: 1.5rem; }
.p-0          { padding: 0 !important; }
.w-full       { width: 100%; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only      { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ══════════════════════════════════════════════════════════════
   PHASE 2 — Admin Dashboard Enhancements
   ══════════════════════════════════════════════════════════════ */

/* ─── Enhanced Metric Cards (Phase 2) ───────────────────────── */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.metric-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}

.metric-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.metric-card.mc-total::after    { background: linear-gradient(90deg, #4A63DD, #7088F0); }
.metric-card.mc-progress::after { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.metric-card.mc-verified::after { background: linear-gradient(90deg, #059669, #34D399); }
.metric-card.mc-failed::after   { background: linear-gradient(90deg, #DC2626, #F87171); }
.metric-card.mc-suspicious::after { background: linear-gradient(90deg, #F97316, #FB923C); }
.metric-card.mc-escalated::after  { background: linear-gradient(90deg, #7C3AED, #A78BFA); }

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    border-color: rgba(74,99,221,0.5);
}

.metric-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.75rem;
}

.mc-total     .metric-icon { background: rgba(74,99,221,0.15);    color: #7088F0; }
.mc-progress  .metric-icon { background: rgba(245,158,11,0.15);   color: #FCD34D; }
.mc-verified  .metric-icon { background: rgba(5,150,105,0.15);    color: #34D399; }
.mc-failed    .metric-icon { background: rgba(220,38,38,0.15);    color: #F87171; }
.mc-suspicious .metric-icon { background: rgba(249,115,22,0.15);  color: #FB923C; }
.mc-escalated  .metric-icon { background: rgba(124,58,237,0.15);  color: #A78BFA; }

.metric-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    margin-bottom: 0.3rem;
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 100px;
}

.metric-trend.up   { background: rgba(16,185,129,0.12); color: var(--emerald-400); }
.metric-trend.down { background: rgba(239,68,68,0.12);  color: var(--red-400); }
.metric-trend.warn { background: rgba(249,115,22,0.12); color: var(--orange-400); }
.metric-trend.neu  { background: rgba(100,116,139,0.12);color: var(--gray-400); }

.metric-bg-icon {
    position: absolute;
    right: -8px; bottom: -8px;
    opacity: 0.05;
    color: white;
    pointer-events: none;
}

/* ─── Modal (Work Order Creation) ───────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,11,24,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 780px;
    box-shadow: var(--shadow-xl);
    transform: translateY(-20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
    margin: auto;
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-title-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--emerald-700), var(--indigo-600));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    flex-shrink: 0;
}

.modal-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--red-400); border-color: rgba(239,68,68,0.3); }

.modal-body { padding: 1.75rem; }

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: rgba(255,255,255,0.015);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Work ID preview badge */
.work-id-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    margin-bottom: 1.25rem;
}

.work-id-preview .wid-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.work-id-preview .wid-value { font-size: 1.1rem; font-weight: 900; color: var(--emerald-400); font-family: monospace; letter-spacing: 0.05em; }

/* Form grid 2-col */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* Geo coordinate pair */
.geo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.geo-pair .form-control { font-family: monospace; font-size: 0.82rem; }

/* ─── Side Drawer (Work Order Preview) ──────────────────────── */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,11,24,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 480px;
    max-width: 95vw;
    background: var(--surface-2);
    border-left: 1px solid var(--border);
    z-index: 401;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.6);
}

.drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-body::-webkit-scrollbar { width: 4px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    background: rgba(255,255,255,0.015);
}

.drawer-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.drawer-close:hover { background: rgba(239,68,68,0.15); color: var(--red-400); }

/* Drawer sections */
.drawer-section { margin-bottom: 1.5rem; }

.drawer-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.drawer-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.drawer-row:last-child { border-bottom: none; }

.drawer-row-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 130px;
    flex-shrink: 0;
}

.drawer-row-value {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
}

/* AI Score Bar in Drawer */
.ai-score-bar {
    height: 8px;
    border-radius: 100px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    margin-top: 0.3rem;
}

.ai-score-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s ease;
}

.ai-score-fill.low    { background: linear-gradient(90deg, var(--emerald-600), var(--emerald-400)); }
.ai-score-fill.medium { background: linear-gradient(90deg, var(--amber-500), var(--amber-300)); }
.ai-score-fill.high   { background: linear-gradient(90deg, var(--red-600), var(--red-400)); }

/* Audit timeline in drawer */
.audit-timeline { display: flex; flex-direction: column; gap: 0.6rem; }

.audit-step {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.audit-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 0.6rem;
    font-weight: 700;
}

.audit-dot.done    { background: rgba(5,150,105,0.15);  border-color: var(--emerald-500); color: var(--emerald-400); }
.audit-dot.active  { background: rgba(74,99,221,0.15);  border-color: var(--indigo-400);  color: var(--indigo-300); }
.audit-dot.pending { background: rgba(100,116,139,0.08);border-color: var(--gray-600);    color: var(--gray-500); }
.audit-dot.warn    { background: rgba(249,115,22,0.15); border-color: var(--orange-400);  color: var(--orange-400); }
.audit-dot.fail    { background: rgba(220,38,38,0.15);  border-color: var(--red-500);     color: var(--red-400); }

.audit-step-info { flex: 1; }
.audit-step-label { font-size: 0.8rem; font-weight: 600; }
.audit-step-sub   { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }

/* ─── Filter / Toolbar ───────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.filter-bar .search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-bar .search-wrap input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.83rem;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-main);
}

.filter-bar .search-wrap input:focus {
    border-color: var(--emerald-500);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
}

.filter-bar .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.filter-select {
    padding: 0.5rem 0.85rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
}

.filter-select:focus { border-color: var(--emerald-500); }
.filter-select option { background: var(--surface-2); }

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 100px;
    background: rgba(74,99,221,0.15);
    border: 1px solid rgba(74,99,221,0.3);
    color: var(--indigo-300);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tag:hover { background: rgba(74,99,221,0.25); }
.filter-tag .remove { opacity: 0.6; }
.filter-tag .remove:hover { opacity: 1; }

/* ─── Table Toolbar (count + bulk) ──────────────────────────── */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.015);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-count strong { color: var(--white); font-size: 0.9rem; }

/* Checkbox styling */
input[type="checkbox"] {
    width: 14px; height: 14px;
    accent-color: var(--emerald-500);
    cursor: pointer;
}

/* Row selected highlight */
tbody tr.selected { background: rgba(74,99,221,0.06) !important; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: rgba(255,255,255,0.015);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-info { font-size: 0.75rem; color: var(--text-muted); }

.pagination-controls { display: flex; align-items: center; gap: 0.25rem; }

.page-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover    { background: rgba(255,255,255,0.06); color: var(--white); }
.page-btn.active   { background: var(--emerald-600); color: white; border-color: var(--emerald-600); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── Column Sorting Arrows ─────────────────────────────────── */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--white); }
th.sortable .sort-icon { display: inline-block; margin-left: 0.3rem; opacity: 0.4; font-size: 0.65rem; vertical-align: middle; }
th.sortable.asc  .sort-icon { opacity: 1; }
th.sortable.desc .sort-icon { opacity: 1; transform: rotate(180deg); }

/* ─── Toast Notification ─────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 380px;
    box-shadow: var(--shadow-xl);
    pointer-events: all;
    animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
    font-size: 0.83rem;
}

.toast.hiding { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn  { from { opacity:0; transform:translateY(20px) scale(0.95); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes toastOut { from { opacity:1; transform:translateY(0);                 } to { opacity:0; transform:translateY(10px); } }

.toast-icon { flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; color: var(--white); margin-bottom: 1px; }
.toast-msg   { font-size: 0.75rem; color: var(--text-muted); }

.toast.success { border-left: 3px solid var(--emerald-500); }
.toast.error   { border-left: 3px solid var(--red-500); }
.toast.warning { border-left: 3px solid var(--amber-500); }
.toast.info    { border-left: 3px solid var(--indigo-400); }

.toast-success-icon { color: var(--emerald-400); }
.toast-error-icon   { color: var(--red-400); }
.toast-warning-icon { color: var(--amber-400); }
.toast-info-icon    { color: var(--indigo-300); }

/* ─── Section Tab Nav ────────────────────────────────────────── */
.section-tabs {
    display: flex;
    gap: 0.25rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
    width: fit-content;
}

.section-tab {
    padding: 0.45rem 1rem;
    border-radius: calc(var(--radius-md) - 2px);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.section-tab:hover { color: var(--white); }
.section-tab.active { background: var(--surface-3); color: var(--white); box-shadow: var(--shadow-sm); }
.section-tab .tab-count { background: rgba(255,255,255,0.08); border-radius: 100px; padding: 0.05rem 0.4rem; font-size: 0.68rem; }
.section-tab.active .tab-count { background: rgba(16,185,129,0.2); color: var(--emerald-400); }

/* ─── Geo / Map preview placeholder ─────────────────────────── */
.map-preview {
    height: 120px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(30,52,120,0.3), rgba(5,100,70,0.2));
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.map-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

.map-pin-pulse {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--emerald-500);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
    animation: ping 1.5s infinite;
}

@keyframes ping {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    70%  { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ─── Animated Counter ───────────────────────────────────────── */
.counter { font-variant-numeric: tabular-nums; }

/* ─── Status-dot in table rows ───────────────────────────────── */
.status-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 4px;
}

/* ─── Responsive additions ───────────────────────────────────── */
@media (max-width: 1280px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid-2, .form-grid-3, .geo-pair { grid-template-columns: 1fr; }
    .drawer { width: 100vw; }
}
@media (max-width: 600px) {
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .filter-bar  { flex-direction: column; align-items: stretch; }
    .modal-box   { margin: 0.5rem; }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 3 — Mobile-First Field Staff Interface & Evidence Wizard
   ══════════════════════════════════════════════════════════════ */

/* ─── Field Staff Welcome Banner ────────────────────────────── */
.field-staff-banner {
    background: linear-gradient(135deg, rgba(20, 34, 82, 0.95), rgba(10, 17, 40, 0.98));
    border: 1px solid rgba(74, 99, 221, 0.35);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.field-staff-banner::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; width: 6px;
    background: linear-gradient(180deg, var(--emerald-400), var(--indigo-400));
}

.worker-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.worker-avatar-badge {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--emerald-600), var(--indigo-600));
    color: white;
    font-size: 1.3rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    flex-shrink: 0;
}

.gps-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-300);
    padding: 0.25rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.gps-live-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--emerald-400);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.6);
    animation: gpsPulse 1.8s infinite;
}

@keyframes gpsPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ─── Field Filter Pills ────────────────────────────────────── */
.field-filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    margin-bottom: 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.field-filter-bar::-webkit-scrollbar { height: 4px; }
.field-filter-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.field-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 100px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    user-select: none;
}

.field-pill:hover {
    background: var(--surface-2);
    color: var(--white);
    border-color: rgba(74, 99, 221, 0.5);
}

.field-pill.active {
    background: linear-gradient(135deg, var(--indigo-600), var(--indigo-500));
    color: var(--white);
    border-color: var(--indigo-400);
    box-shadow: 0 3px 12px rgba(45, 70, 201, 0.4);
}

.field-pill .pill-count {
    background: rgba(0, 0, 0, 0.25);
    color: var(--white);
    padding: 0.1rem 0.45rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 800;
}

/* ─── Mobile-First Task Card ────────────────────────────────── */
.field-task-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.1rem;
    transition: var(--transition);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.field-task-card:hover {
    border-color: rgba(74, 99, 221, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.field-task-card.active-work {
    border-left: 4px solid var(--amber-400);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.04), var(--surface-card));
}

.field-task-card.verified-work {
    border-left: 4px solid var(--emerald-400);
    opacity: 0.9;
}

.field-task-card.overdue-work {
    border-left: 4px solid var(--red-500);
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.04), var(--surface-card));
}

.card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.task-title-lg {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.35;
    margin-bottom: 0.4rem;
}

.task-dept-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--indigo-300);
    background: rgba(74, 99, 221, 0.12);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.6rem;
}

.task-address-box {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
}

.task-meta-item .meta-k {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.task-meta-item .meta-v {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--white);
}

/* ─── Touch Action Buttons (Gloves & Thumb friendly) ────────── */
.btn-field-touch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 800;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    touch-action: manipulation;
}

.btn-field-touch:active {
    transform: scale(0.98);
}

.btn-field-start {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #060B18;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.btn-field-start:hover {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.5);
}

.btn-field-evidence {
    background: linear-gradient(135deg, #059669, #10B981);
    color: #FFFFFF;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

.btn-field-evidence:hover {
    background: linear-gradient(135deg, #10B981, #34D399);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.55);
}

.btn-field-view {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--indigo-300);
}

.btn-field-view:hover {
    background: rgba(74, 99, 221, 0.15);
    color: var(--white);
}

.btn-field-gps {
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: white;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Dual Labeling Typography */
.dual-title {
    display: flex;
    flex-direction: column;
}
.dual-title .hi { font-weight: 700; color: inherit; }
.dual-title .en { font-size: 0.74em; opacity: 0.85; font-weight: 500; }

/* ─── Evidence Submission Multi-Step Modal / Wizard ─────────── */
.wizard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 11, 24, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 600;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wizard-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.wizard-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    margin: auto;
    overflow: hidden;
    position: relative;
    transform: translateY(-15px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-overlay.open .wizard-card {
    transform: translateY(0) scale(1);
}

/* Wizard Step Progress Tracker */
.wizard-tracker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    z-index: 1;
    position: relative;
    cursor: default;
}

.step-bubble {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface-card);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.tracker-step.active .step-bubble {
    background: var(--indigo-500);
    border-color: var(--indigo-300);
    color: white;
    box-shadow: 0 0 16px rgba(74, 99, 221, 0.6);
    transform: scale(1.1);
}

.tracker-step.done .step-bubble {
    background: var(--emerald-500);
    border-color: var(--emerald-300);
    color: white;
}

.step-name-hi {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.tracker-step.active .step-name-hi {
    color: var(--white);
}

.tracker-step.done .step-name-hi {
    color: var(--emerald-400);
}

.tracker-line {
    position: absolute;
    top: 30px;
    left: 12%; right: 12%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.tracker-line-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-400), var(--indigo-400));
    transition: width 0.4s ease;
}

/* ─── Photo Upload Dropzone ─────────────────────────────────── */
.camera-dropzone {
    border: 2px dashed rgba(74, 99, 221, 0.45);
    border-radius: var(--radius-lg);
    background: rgba(13, 21, 53, 0.5);
    padding: 2rem 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.camera-dropzone:hover {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.04);
}

.camera-dropzone.has-photo {
    padding: 0;
    border-style: solid;
    border-color: var(--emerald-500);
}

.dropzone-icon-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(74, 99, 221, 0.15);
    color: var(--indigo-300);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem;
    transition: var(--transition);
}

.camera-dropzone:hover .dropzone-icon-ring {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-400);
    transform: scale(1.08);
}

.photo-preview-box {
    position: relative;
    width: 100%;
    max-height: 280px;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.photo-preview-box img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.preview-overlay-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(180deg, transparent, rgba(6, 11, 24, 0.95));
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.btn-retake {
    background: rgba(220, 38, 38, 0.85);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ─── GPS Scanner Card ──────────────────────────────────────── */
.gps-scanner-card {
    background: rgba(10, 17, 40, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gps-radar-wrap {
    width: 110px; height: 110px;
    border-radius: 50%;
    border: 2px solid rgba(74, 99, 221, 0.3);
    margin: 0 auto 1.25rem;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
}

.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 70%, rgba(16, 185, 129, 0.4) 100%);
    animation: radarSpin 2.5s linear infinite;
    pointer-events: none;
}

@keyframes radarSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.gps-readout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    text-align: left;
}

.gps-coord-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
}

.gps-coord-box .coord-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.gps-coord-box .coord-val {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--emerald-400);
}

.deviation-meter {
    margin-top: 1rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
}

.deviation-meter.ok {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-300);
}

.deviation-meter.warn {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber-300);
}

.deviation-meter.alert {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: var(--red-300);
}

/* ─── Step 4 Side-by-Side Review ────────────────────────────── */
.review-pair-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.review-thumb-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.review-thumb-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.review-thumb-card .card-caption {
    padding: 0.65rem 0.75rem;
}

@media (max-width: 600px) {
    .review-pair-grid { grid-template-columns: 1fr; }
    .gps-readout-grid { grid-template-columns: 1fr; }
    .task-meta-grid   { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   PHASE 4 — AI Verification Module & Breakdown Modal
   ══════════════════════════════════════════════════════════════ */

.ai-header-icon-ring {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(74,99,221,0.25), rgba(16,185,129,0.2));
    border: 1px solid rgba(74,99,221,0.4);
    display: flex; align-items: center; justify-content: center;
    color: var(--indigo-300);
    box-shadow: 0 0 15px rgba(74,99,221,0.3);
}

.ai-risk-banner {
    background: linear-gradient(180deg, rgba(13,21,53,0.7) 0%, rgba(6,11,24,0.85) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.ai-risk-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--emerald-400), var(--amber-400), var(--red-400));
}

.risk-bar-track {
    width: 100%;
    height: 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.08);
}

.risk-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}

/* ─── 4-Signal Grid ─────────────────────────────────────────── */
.signal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

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

.signal-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.signal-card:hover {
    border-color: rgba(74,99,221,0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.signal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.signal-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 0.02em;
}

/* ─── Signal A: Visual Compare Box ──────────────────────────── */
.visual-compare-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.85rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-light);
}

.compare-pane {
    position: relative;
    height: 140px;
    overflow: hidden;
}

.compare-pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.compare-pane:hover img {
    transform: scale(1.05);
}

.compare-indicator {
    position: absolute;
    top: 6px; left: 6px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.compare-indicator.before {
    background: rgba(220, 38, 38, 0.85);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.compare-indicator.after {
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.signal-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.metric-mini { text-align: center; }
.metric-mini .m-k { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-mini .m-v { font-size: 0.88rem; font-weight: 800; color: var(--white); margin-top: 2px; }

.signal-rationale {
    background: rgba(74,99,221,0.06);
    border: 1px solid rgba(74,99,221,0.2);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    line-height: 1.35;
}

/* ─── Signal B: Geofence Gauge ──────────────────────────────── */
.geofence-gauge-wrap {
    text-align: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    margin-bottom: 0.85rem;
}

.distance-number-large {
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1;
    font-family: monospace;
}

.geofence-threshold-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    margin-top: 0.75rem;
    position: relative;
    overflow: visible;
}

.geofence-threshold-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--emerald-400);
    z-index: 2;
    box-shadow: 0 0 6px var(--emerald-400);
}

.geofence-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s ease;
}

.coord-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.coord-pill {
    background: rgba(10,17,40,0.6);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
}

.coord-pill .cp-label { font-size: 0.65rem; color: var(--text-muted); }
.coord-pill .cp-val   { font-size: 0.72rem; font-family: monospace; color: var(--white); font-weight: 700; margin-top: 2px; }

/* ─── Signal C: Timestamp ────────────────────────────────────── */
.timestamp-details-list {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.85rem;
}

.ts-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.ts-row:last-child { border-bottom: none; }
.ts-k { color: var(--text-muted); }
.ts-v { color: var(--white); font-weight: 700; font-family: monospace; }

/* ─── Signal D: Duplicate / Hash ────────────────────────────── */
.hash-check-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.85rem;
}

.hash-badge-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    padding: 0.35rem 0;
}

.hash-label { color: var(--text-muted); }
.hash-code  { font-family: monospace; color: var(--indigo-300); font-weight: 700; font-size: 0.72rem; }

/* ============================================================
   PHASE 5: SUPERVISOR REVIEW PORTAL & ESCALATION MATRIX
   Multi-Tier Escalation Workflow: Field Staff -> Supervisor -> Higher Authority
   ============================================================ */

/* ─── Escalation Alert Banner ────────────────────────────────── */
.escalation-alert-banner {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 1.1rem 1.4rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(245, 158, 11, 0.12) 50%, rgba(220, 38, 38, 0.1) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2);
    position: relative;
    overflow: hidden;
}

.escalation-alert-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--red-500), var(--amber-500));
}

.eab-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: pulseRedGlow 2s infinite ease-in-out;
}

@keyframes pulseRedGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        transform: scale(1.04);
    }
}

.eab-content {
    flex: 1;
}

.eab-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.2rem;
}

.eab-count {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid var(--red-400);
    color: #FCA5A5;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.eab-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.badge-escalated {
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%) !important;
    color: #FFFFFF !important;
    border: 1px solid #EF4444 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.6) !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.82; }
}

/* ─── Review Portal Layout (Master-Detail Split) ──────────────── */
.review-portal-layout {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 1.5rem;
    align-items: start;
    min-height: 800px;
    margin-bottom: 2rem;
}

@media (max-width: 1080px) {
    .review-portal-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Queue Pane */
.review-queue-pane {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.queue-header-box {
    padding: 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.queue-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.q-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 0.28rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.q-pill:hover {
    background: rgba(74, 99, 221, 0.15);
    color: var(--white);
    border-color: var(--indigo-400);
}

.q-pill.active {
    background: var(--indigo-500);
    border-color: var(--indigo-400);
    color: var(--white);
    box-shadow: 0 0 10px rgba(45, 70, 201, 0.4);
}

.q-pill.alert {
    color: var(--red-300);
    border-color: rgba(239, 68, 68, 0.3);
}

.q-pill.alert.active {
    background: var(--red-600);
    border-color: var(--red-400);
    color: var(--white);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.queue-items-list {
    max-height: 780px;
    overflow-y: auto;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.queue-items-list::-webkit-scrollbar {
    width: 6px;
}
.queue-items-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.queue-items-list::-webkit-scrollbar-thumb {
    background: rgba(100, 130, 200, 0.3);
    border-radius: 3px;
}

.queue-item-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.queue-item-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(100, 130, 200, 0.4);
}

.queue-item-card.selected {
    background: rgba(37, 57, 160, 0.2);
    border-color: var(--indigo-400);
    box-shadow: 0 0 16px rgba(45, 70, 201, 0.3);
}

.queue-item-card.escalated-border {
    border-left: 4px solid var(--red-500) !important;
}

.queue-item-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--white);
    margin: 0.25rem 0;
    line-height: 1.35;
}

.rework-cue-tag {
    font-size: 0.68rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--amber-300);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.4rem;
    font-weight: 600;
}

/* Right Detail Pane */
.review-detail-pane {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-header-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-md);
}

/* ─── 3-Tier Escalation Workflow Visualizer ──────────────────── */
.escalation-chain-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.6rem;
    box-shadow: var(--shadow-md);
}

.escalation-tiers-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    position: relative;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .escalation-tiers-track {
        grid-template-columns: 1fr;
    }
}

.tier-step-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    transition: var(--transition);
    position: relative;
}

.tier-step-card.active-tier {
    border-color: var(--indigo-400);
    background: rgba(45, 70, 201, 0.12);
    box-shadow: 0 0 16px rgba(74, 99, 221, 0.25);
}

.tier-step-card.done-tier {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.06);
}

.tier-badge-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-weight: 800;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tier-step-card.active-tier .tier-badge-number {
    background: var(--indigo-500);
    box-shadow: 0 0 12px rgba(74, 99, 221, 0.6);
}

.tier-step-card.done-tier .tier-badge-number {
    background: var(--emerald-600);
    box-shadow: 0 0 10px rgba(5, 150, 105, 0.5);
}

.tier-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 2px;
}

.tier-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.tier-actor {
    font-size: 0.72rem;
    color: var(--indigo-300);
    margin-top: 4px;
    font-weight: 600;
}

.tier-status-pill {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.tier-step-card.active-tier .tier-status-pill {
    background: rgba(74, 99, 221, 0.25);
    color: var(--indigo-300);
    border: 1px solid rgba(74, 99, 221, 0.4);
}

.tier-step-card.done-tier .tier-status-pill {
    background: rgba(16, 185, 129, 0.2);
    color: var(--emerald-300);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* ─── Side-by-Side Evidence Inspection ───────────────────────── */
.review-evidence-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.6rem;
    box-shadow: var(--shadow-md);
}

.side-compare-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .side-compare-container {
        grid-template-columns: 1fr;
    }
}

.compare-photo-box {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
    background: rgba(0, 0, 0, 0.35);
}

.compare-photo-box img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.compare-photo-box:hover img {
    transform: scale(1.02);
}

.photo-overlay-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.photo-overlay-tag.before {
    background: rgba(239, 68, 68, 0.88);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.photo-overlay-tag.after {
    background: rgba(16, 185, 129, 0.88);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.photo-meta-strip {
    padding: 0.75rem 1rem;
    background: rgba(10, 17, 40, 0.95);
    border-top: 1px solid var(--border-light);
}

/* ─── AI Engine Recommendation & 4 Signal Chips ─────────────── */
.ai-recommendation-box {
    background: linear-gradient(135deg, rgba(37, 57, 160, 0.12), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(74, 99, 221, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.6rem;
}

.signal-chips-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (max-width: 800px) {
    .signal-chips-row {
        grid-template-columns: 1fr 1fr;
    }
}

.sig-chip {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-light);
}

.sig-chip.ok {
    border-color: rgba(16, 185, 129, 0.35);
}

.sig-chip.alert {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.06);
}

.sig-chip .sc-title {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
    font-weight: 600;
}

.sig-chip .sc-val {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--white);
    margin-top: 2px;
    display: block;
}

/* ─── Assignee History & Metadata Grid ───────────────────────── */
.assignee-history-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

@media (max-width: 900px) {
    .assignee-history-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .assignee-history-grid {
        grid-template-columns: 1fr;
    }
}

.meta-box {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.meta-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.meta-val {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--white);
    margin-top: 3px;
}

/* ─── Supervisor Decision Action Bar ─────────────────────────── */
.supervisor-decision-bar {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: sticky;
    bottom: 1rem;
    z-index: 10;
}

/* ─── Field Staff Re-work Notification ───────────────────────── */
.staff-rework-alert {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(239, 68, 68, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    margin: 0.85rem 0;
    font-size: 0.82rem;
    color: var(--amber-300);
    line-height: 1.45;
}

.staff-rework-alert strong {
    color: #FDE68A;
}

/* ============================================================
   PHASE 6: CITIZEN PUBLIC VERIFICATION PORTAL & FEEDBACK WIDGET
   Lightweight Ward Lookup, Works Feed, Sentiment Meter, & Community Alert
   ============================================================ */

/* ─── Public Portal Base ────────────────────────────────────── */
.public-portal-body {
    background: var(--navy-950);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: var(--font-main);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 57, 160, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 85% 85%, rgba(5, 150, 105, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 15% 60%, rgba(245, 158, 11, 0.05), transparent);
}

.public-navbar {
    background: rgba(10, 17, 40, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
}

.brand-logo-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(37, 57, 160, 0.4), rgba(5, 150, 105, 0.4));
    border: 1px solid rgba(16, 185, 129, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand-title span {
    color: var(--emerald-400);
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.public-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.public-main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 4rem;
}

/* ─── Hero Section ──────────────────────────────────────────── */
.public-hero-card {
    background: linear-gradient(135deg, rgba(17, 29, 69, 0.8) 0%, rgba(13, 21, 53, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2.5rem;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 1.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

@media (max-width: 960px) {
    .public-hero-card {
        grid-template-columns: 1fr;
        padding: 1.75rem;
        gap: 1.5rem;
    }
}

.public-hero-card::after {
    content: '';
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--emerald-300);
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.hero-headline {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.hero-headline span {
    background: linear-gradient(135deg, #A7F3D0 0%, #34D399 50%, #60A5FA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.3rem;
    display: block;
    margin-top: 4px;
}

.hero-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 580px;
}

.hero-stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.h-stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    transition: var(--transition);
}

.h-stat-box:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    border-color: rgba(100, 130, 200, 0.4);
}

.hs-num {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
}

.hs-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.35rem;
}

/* ─── Portal Filter Card (Ward Selector Bar) ─────────────────── */
.portal-filter-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-md);
}

.filter-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-field-wrap {
    flex: 1;
    min-width: 190px;
}

.filter-field-wrap.search-flex {
    flex: 1.4;
    min-width: 240px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* ─── Public Feed Grid ───────────────────────────────────────── */
.public-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 580px) {
    .public-feed-grid {
        grid-template-columns: 1fr;
    }
}

.civic-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: var(--transition);
    position: relative;
}

.civic-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(100, 130, 200, 0.45);
}

.civic-card.escalated-card-border {
    border-left: 4px solid var(--red-500) !important;
}

.civic-card.highlight-glow {
    border-color: var(--emerald-400);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.civic-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ward-pill {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
}

.category-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--indigo-300);
    background: rgba(37, 57, 160, 0.25);
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    border: 1px solid rgba(74, 99, 221, 0.3);
}

.civic-card-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.35;
    margin: 0;
}

.civic-address-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.map-link {
    color: var(--indigo-300);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.5rem;
    white-space: nowrap;
}

.map-link:hover {
    color: var(--white);
    text-decoration: underline;
}

/* ─── Side-by-Side Dual Photo Preview ────────────────────────── */
.evidence-dual-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin: 0.25rem 0;
}

.preview-photo-wrap {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-light);
    height: 175px;
    cursor: pointer;
}

.preview-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.preview-photo-wrap:hover img {
    transform: scale(1.04);
}

.stage-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.22rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    backdrop-filter: blur(6px);
}

.stage-tag.before {
    background: rgba(220, 38, 38, 0.88);
    color: #FFF;
}

.stage-tag.after {
    background: rgba(5, 150, 105, 0.88);
    color: #FFF;
}

.photo-caption-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, rgba(10, 17, 40, 0.95));
    padding: 0.35rem 0.65rem;
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.signals-compact-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ─── Community Sentiment Meter ──────────────────────────────── */
.community-meter-box {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cm-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--white);
}

.cm-score {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--emerald-400);
}

.cm-track {
    height: 7px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    overflow: hidden;
}

.cm-bar {
    height: 100%;
    transition: width 0.4s ease;
}

.cm-bar.comp  { background: var(--emerald-400); }
.cm-bar.part  { background: var(--amber-400); }
.cm-bar.qual  { background: var(--orange-500); }
.cm-bar.not   { background: var(--red-500); }
.cm-bar.empty { background: rgba(255, 255, 255, 0.1); }

.cm-label-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.citizen-alert-tag {
    font-size: 0.72rem;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--amber-300);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    line-height: 1.35;
    margin-top: 0.25rem;
}

.civic-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-verify-action {
    flex: 1;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ─── Citizen Feedback Widget Modal ──────────────────────────── */
.citizen-widget-box {
    max-width: 680px;
    width: 95%;
}

.widget-modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.cf-task-context-strip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

/* 4 Vote Options Grid */
.vote-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 540px) {
    .vote-options-grid {
        grid-template-columns: 1fr;
    }
}

.vote-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.vote-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
}

.vc-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 900;
    flex-shrink: 0;
}

.vc-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.25;
}

.vc-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Color accents */
.vote-completed .vc-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-400);
}
.vote-completed.selected {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.14);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.vote-partially .vc-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-400);
}
.vote-partially.selected {
    border-color: var(--amber-400);
    background: rgba(245, 158, 11, 0.14);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.3);
}

.vote-not .vc-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-400);
}
.vote-not.selected {
    border-color: var(--red-500);
    background: rgba(239, 68, 68, 0.14);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}

.vote-quality .vc-icon {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange-400);
}
.vote-quality.selected {
    border-color: var(--orange-500);
    background: rgba(249, 115, 22, 0.14);
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.3);
}

/* Star Rating */
.star-rating-wrap {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.star-item {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
    user-select: none;
}

.star-item:hover {
    transform: scale(1.2);
}

.star-item.active {
    color: var(--amber-400);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Photo Dropzone */
.photo-upload-dropzone {
    border: 1.5px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: var(--transition);
}

.photo-upload-dropzone:hover {
    border-color: var(--emerald-400);
    background: rgba(16, 185, 129, 0.04);
}

/* Citizen Review Comments in Drawer */
.review-comment-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.cm-chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-weight: 700;
}

.cm-chip.comp { background: rgba(16, 185, 129, 0.15); color: var(--emerald-300); }
.cm-chip.part { background: rgba(245, 158, 11, 0.15); color: var(--amber-300); }
.cm-chip.qual { background: rgba(249, 115, 22, 0.15); color: var(--orange-300); }
.cm-chip.not  { background: rgba(239, 68, 68, 0.15); color: var(--red-300); }

/* ─── Lightbox Modal ────────────────────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(8px);
}

.lightbox-overlay.open {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 82vh;
    border-radius: var(--radius-md);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.8);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFF;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 17, 40, 0.85);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    color: var(--white);
    border: 1px solid var(--border-light);
}

.empty-feed-card {
    background: var(--surface-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* ─── Immutable Audit Trail Timeline (Phase 7) ───────────────── */
.audit-trail-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1rem 0;
    position: relative;
    padding-left: 1.75rem;
}

.audit-trail-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(65, 90, 160, 0.4);
}

.att-item {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    transition: var(--transition);
}

.att-item:hover {
    border-color: rgba(100, 130, 200, 0.5);
    background: rgba(255, 255, 255, 0.04);
}

.att-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--indigo-400);
    border: 2px solid var(--navy-900);
    box-shadow: 0 0 8px rgba(74, 99, 221, 0.6);
}

.att-item.done::before {
    background: var(--emerald-400);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.att-item.alert::before {
    background: var(--red-500);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.hash-tag {
    font-family: monospace;
    font-size: 0.68rem;
    color: var(--emerald-400);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    display: inline-block;
    word-break: break-all;
    margin-top: 0.35rem;
}

