/* ============================================
   NEGATIVE KEYWORD MANAGER — Light SaaS
   Clean · Professional · Scandinavian Precision
   ============================================ */

/* --- Fonts loaded in base.html:
   Sora (display), Lexend (body), JetBrains Mono (data) --- */

:root {
    /* Layout */
    --sidebar-w: 260px;
    --topbar-h: 60px;

    /* Core Palette — Clean Light */
    --white: #ffffff;
    --snow: #f8f9fb;
    --cloud: #f1f3f7;
    --mist: #e5e8ee;
    --surface: #ffffff;
    --surface-hover: #f5f6f9;
    --surface-raised: #ffffff;

    /* Borders */
    --border-dim: #f0f1f4;
    --border: #e2e5ec;
    --border-bright: #cdd2db;

    /* Text */
    --text-100: #111827;
    --text-200: #374151;
    --text-300: #6b7280;
    --text-400: #9ca3af;
    --text-500: #c4c9d4;

    /* Accent: Teal */
    --teal-50: #f0fdfa;
    --teal-100: #ccfbf1;
    --teal-300: #5eead4;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;
    --teal-bg: rgba(20,184,166,0.08);
    --teal-bg-strong: rgba(20,184,166,0.14);

    /* Amber */
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-bg: rgba(245,158,11,0.08);

    /* Emerald */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-bg: rgba(16,185,129,0.08);

    /* Rose */
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --rose-300: #fda4af;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --rose-bg: rgba(244,63,94,0.08);

    /* Blue */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-bg: rgba(59,130,246,0.08);

    /* Violet */
    --violet-50: #f5f3ff;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;
    --violet-bg: rgba(139,92,246,0.08);

    /* Semantic */
    --primary: var(--teal-600);
    --primary-hover: var(--teal-500);

    /* Effects */
    --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,.06), 0 2px 4px -2px rgba(0,0,0,.04);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,.06), 0 4px 6px -4px rgba(0,0,0,.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --radius-full: 9999px;

    --transition: 200ms cubic-bezier(.4,0,.2,1);
    --transition-slow: 350ms cubic-bezier(.4,0,.2,1);
    --transition-spring: 500ms cubic-bezier(.34,1.56,.64,1);
}


/* === Reset & Base === */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-200);
    background: var(--snow);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Sora', 'Lexend', sans-serif;
    font-weight: 700;
    color: var(--text-100);
    letter-spacing: -0.03em;
    margin: 0;
}

a {
    color: var(--teal-600);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--teal-500); }

::selection {
    background: var(--teal-bg-strong);
    color: var(--text-100);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-400); }


/* =====================
   SIDEBAR NAVIGATION
   ===================== */

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform var(--transition-slow);
    border-right: 1px solid var(--border);
    box-shadow: 1px 0 0 var(--border-dim);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--border-dim);
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(20,184,166,0.3);
}

.sidebar-brand-text {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-100);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.sidebar-brand-text small {
    display: block;
    font-family: 'Lexend', sans-serif;
    font-weight: 400;
    font-size: 11px;
    color: var(--text-400);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 3px;
}

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

.sidebar-label {
    font-family: 'Sora', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 14px 14px 8px;
    margin-top: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-300);
    font-family: 'Lexend', sans-serif;
    font-size: 13.5px;
    font-weight: 400;
    transition: all var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.sidebar-link i {
    font-size: 17px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: .55;
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: var(--cloud);
    color: var(--text-200);
}
.sidebar-link:hover i { opacity: .8; color: var(--text-200); }

.sidebar-link.active {
    background: var(--teal-bg);
    color: var(--teal-700);
}
.sidebar-link.active i { opacity: 1; color: var(--teal-600); }

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 8px; bottom: 8px;
    width: 3px;
    background: linear-gradient(180deg, var(--teal-500), var(--teal-600));
    border-radius: 0 3px 3px 0;
}

.sidebar-badge {
    margin-left: auto;
    background: var(--amber-500);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    line-height: 1.4;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--border-dim);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-300);
    font-family: 'Lexend', sans-serif;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-logout-btn:hover {
    background: var(--rose-50);
    border-color: var(--rose-300);
    color: var(--rose-600);
}


/* =====================
   MAIN CONTENT AREA
   ===================== */

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

.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-100);
    margin: 0;
    letter-spacing: -0.02em;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-400);
}

.topbar-breadcrumb a { color: var(--text-300); }
.topbar-breadcrumb a:hover { color: var(--teal-600); }
.topbar-breadcrumb .sep { color: var(--text-500); font-size: 11px; }

.content {
    flex: 1;
    padding: 28px;
}

.content-footer {
    padding: 20px 28px;
    text-align: center;
    font-size: 11px;
    color: var(--text-400);
    border-top: 1px solid var(--border-dim);
    letter-spacing: 0.02em;
}


/* =====================
   MOBILE SIDEBAR
   ===================== */

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-300);
    cursor: pointer;
    padding: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.25);
    z-index: 1035;
    backdrop-filter: blur(4px);
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle { display: block; }
    .main-wrapper { margin-left: 0; }
    .content { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
}


/* =====================
   CARDS
   ===================== */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
    overflow: hidden;
    position: relative;
}

.card:hover { transform: none; }

.card-header {
    background: var(--snow);
    border-bottom: 1px solid var(--border-dim);
    padding: 14px 20px;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-200);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.card-body { padding: 20px; }

.card-footer {
    background: var(--snow);
    border-top: 1px solid var(--border-dim);
    padding: 12px 20px;
}


/* === Stat Cards === */

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

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

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.teal    { background: var(--teal-bg); color: var(--teal-600); }
.stat-icon.amber   { background: var(--amber-bg); color: var(--amber-600); }
.stat-icon.blue    { background: var(--blue-bg); color: var(--blue-600); }
.stat-icon.emerald { background: var(--emerald-bg); color: var(--emerald-600); }

.stat-content { flex: 1; min-width: 0; }

.stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-100);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-300);
    font-weight: 400;
}


/* =====================
   TABLES
   ===================== */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: var(--snow);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-300);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-dim);
    font-size: 13.5px;
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--surface-hover);
}

.data-table .customer-name {
    font-weight: 500;
    color: var(--text-100);
    font-size: 13.5px;
}

.data-table .customer-meta {
    font-size: 12px;
    color: var(--text-400);
    margin-top: 2px;
}

.data-table .mono,
.mono {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 12.5px;
    color: var(--text-300);
}


/* =====================
   BADGES
   ===================== */

.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-family: 'Lexend', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
}

.badge-status.pending  { background: var(--amber-50); color: var(--amber-600); border: 1px solid var(--amber-100); }
.badge-status.success  { background: var(--emerald-50); color: var(--emerald-600); border: 1px solid var(--emerald-100); }
.badge-status.danger   { background: var(--rose-50); color: var(--rose-600); border: 1px solid var(--rose-100); }
.badge-status.info     { background: var(--blue-50); color: var(--blue-600); border: 1px solid var(--blue-100); }
.badge-status.neutral  { background: var(--cloud); color: var(--text-300); border: 1px solid var(--border); }

.badge-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-status.info::before {
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.badge-category {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-family: 'Sora', sans-serif;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge-category.aggressive  { background: var(--rose-50); color: var(--rose-600); border: 1px solid var(--rose-100); }
.badge-category.moderate    { background: var(--amber-50); color: var(--amber-600); border: 1px solid var(--amber-100); }
.badge-category.conservative { background: var(--emerald-50); color: var(--emerald-600); border: 1px solid var(--emerald-100); }

.badge-cat-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: var(--radius-xs);
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.badge-cat-letter.a { background: var(--teal-bg); color: var(--teal-600); }
.badge-cat-letter.b { background: var(--blue-bg); color: var(--blue-600); }
.badge-cat-letter.c { background: var(--amber-bg); color: var(--amber-600); }


/* =====================
   BUTTONS
   ===================== */

.btn {
    font-family: 'Lexend', sans-serif;
    font-weight: 500;
    font-size: 13px;
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    border: none;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    letter-spacing: -0.01em;
}

.btn i { font-size: 15px; }

.btn-primary,
.btn-primary:active,
.btn-primary:focus {
    background: var(--teal-600) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(20,184,166,0.25);
}
.btn-primary:hover {
    background: var(--teal-500) !important;
    box-shadow: 0 4px 12px rgba(20,184,166,0.25);
    transform: translateY(-1px);
}

.btn-success,
.btn-success:active,
.btn-success:focus {
    background: var(--emerald-600) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(16,185,129,0.25);
}
.btn-success:hover {
    background: var(--emerald-500) !important;
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
    transform: translateY(-1px);
}

.btn-warning,
.btn-warning:active,
.btn-warning:focus {
    background: var(--amber-500) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(245,158,11,0.25);
}
.btn-warning:hover {
    background: var(--amber-400) !important;
    box-shadow: 0 4px 12px rgba(245,158,11,0.25);
    transform: translateY(-1px);
}

.btn-danger,
.btn-danger:active,
.btn-danger:focus {
    background: var(--rose-500) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(244,63,94,0.25);
}
.btn-danger:hover {
    background: var(--rose-400) !important;
    box-shadow: 0 4px 12px rgba(244,63,94,0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent !important;
    color: var(--teal-600) !important;
    border: 1px solid var(--teal-500) !important;
}
.btn-outline-primary:hover {
    background: var(--teal-bg) !important;
    color: var(--teal-700) !important;
    border-color: var(--teal-600) !important;
}

.btn-ghost {
    background: transparent;
    color: var(--text-300);
    padding: 6px 10px;
    border: 1px solid transparent;
}
.btn-ghost:hover {
    background: var(--cloud);
    color: var(--text-100);
    border-color: var(--border);
}

.btn-sm {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
}

.btn-group-actions {
    display: flex;
    gap: 6px;
}

.btn:disabled,
.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
}


/* =====================
   FORMS
   ===================== */

.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    color: var(--text-100);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px var(--teal-bg);
    outline: none;
    background: var(--white);
    color: var(--text-100);
}

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

.form-label {
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-200);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-check-input {
    background-color: var(--white);
    border-color: var(--border-bright);
}

.form-check-input:checked {
    background-color: var(--teal-600);
    border-color: var(--teal-600);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--teal-bg);
    border-color: var(--teal-500);
}


/* =====================
   ALERTS / FLASH
   ===================== */

.alert-flash {
    border: 1px solid;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    animation: slideDown 300ms ease-out;
}

.alert-flash.success { background: var(--emerald-50); color: var(--emerald-600); border-color: var(--emerald-100); }
.alert-flash.error,
.alert-flash.danger  { background: var(--rose-50); color: var(--rose-600); border-color: var(--rose-100); }
.alert-flash.warning { background: var(--amber-50); color: var(--amber-600); border-color: var(--amber-100); }
.alert-flash.info    { background: var(--blue-50); color: var(--blue-600); border-color: var(--blue-100); }

.alert-flash .btn-close {
    opacity: .4;
    font-size: 10px;
}
.alert-flash .btn-close:hover { opacity: .8; }

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


/* =====================
   REVIEW KEYWORD CARDS
   ===================== */

.keyword-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all var(--transition);
    background: var(--white);
    position: relative;
}

.keyword-card:hover {
    border-color: var(--border-bright);
    background: var(--surface-hover);
    box-shadow: var(--shadow-xs);
}

.keyword-card.aggressive  { border-left: 3px solid var(--rose-500); }
.keyword-card.moderate    { border-left: 3px solid var(--amber-500); }
.keyword-card.conservative { border-left: 3px solid var(--emerald-500); }

.keyword-check { flex-shrink: 0; }

.keyword-info { flex: 1; min-width: 0; }

.keyword-text {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-100);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.01em;
}

.keyword-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-300);
}

.keyword-reasoning {
    font-size: 12.5px;
    color: var(--text-300);
    margin-top: 4px;
    line-height: 1.55;
}

/* Placement badges */
.badge-placement {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-placement i { font-size: 11px; }
.badge-placement.account {
    background: var(--violet-50);
    color: var(--violet-600);
    border: 1px solid rgba(139,92,246,0.15);
}
.badge-placement.campaign {
    background: var(--blue-50);
    color: var(--blue-600);
    border: 1px solid rgba(59,130,246,0.15);
}
.badge-placement.ad_group {
    background: var(--teal-50);
    color: var(--teal-700);
    border: 1px solid rgba(20,184,166,0.15);
}

.keyword-placement-reason {
    font-size: 11.5px;
    color: var(--text-300);
    margin-top: 4px;
    line-height: 1.5;
    font-style: italic;
}
.keyword-placement-reason i {
    font-size: 11px;
    margin-right: 2px;
    opacity: 0.7;
}

.keyword-actions {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
}


/* === Confidence Meter === */

.confidence-meter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-bar {
    width: 48px; height: 4px;
    background: var(--cloud);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-slow);
}

.confidence-fill.high   { background: var(--emerald-500); }
.confidence-fill.medium { background: var(--amber-500); }
.confidence-fill.low    { background: var(--rose-500); }

.confidence-text {
    font-size: 11px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-300);
}


/* =====================
   REVIEW SECTION HEADERS
   ===================== */

.review-section {
    margin-bottom: 32px;
}

.review-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-dim);
}

.review-section-title {
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-200);
    margin: 0;
}

.review-section-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--cloud);
    color: var(--text-300);
    border: 1px solid var(--border);
}


/* =====================
   ACTION PANEL
   ===================== */

.action-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.action-panel-title {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-200);
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* =====================
   CUSTOMER DETAIL
   ===================== */

.customer-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.customer-avatar {
    width: 56px; height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(20,184,166,0.2);
}

.customer-header-info h2 {
    margin: 0 0 4px;
    font-size: 22px;
}

.customer-header-meta {
    font-size: 13px;
    color: var(--text-300);
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-header-meta .sep {
    color: var(--text-500);
}


/* =====================
   PAGE HEADER
   ===================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-100);
    margin: 0;
    letter-spacing: -0.03em;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--text-300);
    margin-top: 4px;
}


/* =====================
   LOGIN PAGE
   ===================== */

.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--white);
}

.login-branding {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
    background: var(--snow);
}

/* Subtle geometric pattern */
.login-branding::before {
    content: '';
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(var(--border-dim) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-dim) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: center 70%;
    mask-image: radial-gradient(ellipse at center 60%, black 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center 60%, black 10%, transparent 70%);
    pointer-events: none;
    opacity: 0.6;
    animation: grid-scroll 25s linear infinite;
}

@keyframes grid-scroll {
    from { background-position: 0 0; }
    to { background-position: 0 48px; }
}

.login-branding::after {
    content: '';
    position: absolute;
    top: 20%; left: 10%;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20,184,166,0.06), transparent 70%);
    pointer-events: none;
    animation: float-orb 8s ease-in-out infinite;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

.login-branding-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
}

.login-branding-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    margin-bottom: 36px;
    box-shadow: 0 4px 16px rgba(20,184,166,0.25);
}

.login-branding h1 {
    font-family: 'Sora', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--text-100);
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
}

.login-branding p {
    font-size: 15px;
    color: var(--text-300);
    line-height: 1.7;
    margin-bottom: 40px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text-200);
}

.login-feature-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--teal-600);
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
}

.login-form-side {
    width: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--white);
    border-left: 1px solid var(--border);
    position: relative;
}

.login-form-wrapper {
    width: 100%;
    max-width: 340px;
}

.login-form-header {
    margin-bottom: 36px;
}

.login-form-header h2 {
    font-family: 'Sora', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-100);
}

.login-form-header p {
    font-size: 14px;
    color: var(--text-300);
}

.login-form .form-control {
    padding: 12px 14px;
    font-size: 14px;
    background: var(--white);
    border-color: var(--border);
    color: var(--text-100);
}

.login-form .form-control:focus {
    background: var(--white);
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px var(--teal-bg);
}

.login-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}

.login-footer {
    margin-top: 36px;
    text-align: center;
    font-size: 11px;
    color: var(--text-400);
}

@media (max-width: 767.98px) {
    .login-branding { display: none; }
    .login-form-side {
        width: 100%;
        border-left: none;
    }
}


/* =====================
   WORKFLOW STEPS
   ===================== */

.workflow-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
}

.workflow-step + .workflow-step {
    border-top: 1px solid var(--border-dim);
}

.workflow-step-number {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.workflow-step-content {
    flex: 1;
}

.workflow-step-label {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-200);
    margin-bottom: 8px;
}


/* =====================
   PROGRESS BAR
   ===================== */

.job-progress-bar {
    display: none;
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--snow);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-200);
}


/* =====================
   SPINNER / LOADING
   ===================== */

.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.show { display: flex; }

.spinner-ring {
    width: 40px; height: 40px;
    border: 3px solid var(--cloud);
    border-top-color: var(--teal-500);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* =====================
   ANIMATIONS
   ===================== */

.fade-in {
    animation: fadeIn 400ms ease-out;
}

.fade-up {
    animation: fadeUp 450ms ease-out both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }


/* =====================
   EMPTY STATE
   ===================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-300);
}

.empty-state i {
    font-size: 48px;
    color: var(--text-500);
    margin-bottom: 16px;
    opacity: .6;
}

.empty-state h3 {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-200);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-300);
    font-size: 13px;
}


/* =====================
   SETTINGS
   ===================== */

.settings-value {
    font-size: 13px;
    color: var(--text-200);
    font-family: 'JetBrains Mono', monospace;
}

.settings-label {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-300);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.settings-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-dim);
}

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


/* =====================
   UPLOAD STATUS
   ===================== */

#upload-status,
#job-progress {
    background: var(--snow);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text-200);
    font-size: 13px;
}


/* =====================
   UTILITIES
   ===================== */

.gap-grid { gap: 20px; }
.text-mono { font-family: 'JetBrains Mono', 'SF Mono', monospace; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Override Bootstrap card transform */
.card { transform: none !important; }

/* Hide default Bootstrap nav */
.navbar { display: none !important; }

.p-0 { padding: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.ms-auto { margin-left: auto !important; }

/* Utility */
.rotate-180 { transform: rotate(180deg); }

/* Responsive */
@media (max-width: 575.98px) {
    .stat-value { font-size: 22px; }
    .page-title { font-size: 18px; }
}
