/* ══════════════════════════════════════════════════════════════
   Piranha Base CSS — single source of truth
   Font, colors, themes. Nothing else.
   ══════════════════════════════════════════════════════════════ */

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

/* ── Dark Theme (default) ─────────────────────────────────── */

:root {
    /* Text */
    --text: #5a5a7a;
    --heading: #e8e8e8;

    /* Core palette */
    --abyss: #151521;
    --deep: #0a0a16;
    --trench: #0f0f1e;
    --cavern: #161628;
    --shadow: #1e1e38;
    --slate: #1e1e36;
    --steel: #3a3a5c;
    --muted: #5a5a7a;
    --bright: #ededf4;
    --white: #f8fafc;

    /* Accent */
    --ember: #f59e0b;
    --flame: #f97316;
    --blaze: #fb923c;
    --glow: rgba(249, 115, 22, 0.15);
    --glow-strong: rgba(249, 115, 22, 0.35);

    /* Semantic colors */
    --success: #22c55e;
    --danger: #ef4444;
    --error: #ef4444;
    --info: #3b82f6;

    /* Borders */
    --border: rgba(90, 90, 122, 0.08);
    --border-light: rgba(90, 90, 122, 0.06);
    --border-mid: rgba(90, 90, 122, 0.1);
    --border-strong: rgba(90, 90, 122, 0.15);
    --border-heavy: rgba(90, 90, 122, 0.2);
    --border-max: rgba(90, 90, 122, 0.3);
    --border-hover: rgba(90, 90, 122, 0.2);

    /* Surfaces */
    --surface-card: linear-gradient(165deg, rgba(22, 22, 40, 0.6) 0%, rgba(15, 15, 30, 0.4) 100%);
    --surface-raised: rgba(10, 10, 22, 0.4);
    --surface-header: rgba(10, 10, 22, 0.6);
    --surface-thead: rgba(15, 15, 30, 0.5);
    --surface-overlay: rgba(6, 6, 14, 0.7);

    /* Interactive */
    --hover-subtle: rgba(90, 90, 122, 0.06);
    --hover-muted: rgba(90, 90, 122, 0.08);
    --hover-ember: rgba(249, 115, 22, 0.06);
    --active-ember: rgba(249, 115, 22, 0.08);
    --badge-muted: rgba(90, 90, 122, 0.12);
    --badge-ember: rgba(249, 115, 22, 0.12);
    --scroll-thumb: rgba(90, 90, 122, 0.2);
    --scroll-hover: rgba(90, 90, 122, 0.35);
    --toggle-track: rgba(90, 90, 122, 0.2);
    --input-placeholder: rgba(90, 90, 122, 0.5);
    --shadow-card: rgba(0, 0, 0, 0.2);
    --spinner-track: rgba(90, 90, 122, 0.15);

    /* Accent backgrounds */
    --bg-ember-subtle: rgba(249, 115, 22, 0.1);
    --bg-ember-mid: rgba(249, 115, 22, 0.15);
    --bg-ember-glow: rgba(249, 115, 22, 0.25);
    --bg-green-subtle: rgba(52, 211, 153, 0.1);
    --bg-green-mid: rgba(52, 211, 153, 0.12);
    --bg-green-glow: rgba(52, 211, 153, 0.08);
    --bg-indigo-subtle: rgba(129, 140, 248, 0.1);
    --bg-sky-subtle: rgba(56, 189, 248, 0.1);
    --bg-purple-subtle: rgba(124, 77, 255, 0.1);
    --bg-red-subtle: rgba(239, 68, 68, 0.06);
    --bg-red-border: rgba(239, 68, 68, 0.3);
    --bg-pink-subtle: rgba(236, 72, 153, 0.12);
    --bg-teal-subtle: rgba(45, 212, 191, 0.12);
    --bg-yellow-subtle: rgba(234, 179, 8, 0.12);

    /* Toast */
    --toast-success-bg: rgba(34, 197, 94, 0.18);
    --toast-success-border: rgba(34, 197, 94, 0.35);
    --toast-success-text: #4ade80;
    --toast-error-bg: rgba(239, 68, 68, 0.18);
    --toast-error-border: rgba(239, 68, 68, 0.35);
    --toast-error-text: #f87171;
    --toast-info-bg: rgba(59, 130, 246, 0.18);
    --toast-info-border: rgba(59, 130, 246, 0.35);
    --toast-info-text: #60a5fa;
    --toast-shadow: rgba(0, 0, 0, 0.4);

    /* Sidebar */
    --sidebar-glow: rgba(249, 115, 22, 0.1);

    /* Layout */
    --sidebar-w: 240px;
    --sidebar-collapsed: 72px;
    --header-h: 64px;

    /* Dealer Status Colors */
    --status-new: #4ade80;
    --status-new-bg: rgba(34, 197, 94, 0.15);
    --status-initial: #9ca3af;
    --status-initial-bg: rgba(107, 114, 128, 0.12);
    --status-in_hubspot: #f59e0b;
    --status-in_hubspot-bg: rgba(245, 158, 11, 0.15);
    --status-outdated: #f87171;
    --status-outdated-bg: rgba(239, 68, 68, 0.15);
    --status-deleted: #6b7280;
    --status-deleted-bg: rgba(0, 0, 0, 0.25);
    --status-disqualified: #f87171;
    --status-disqualified-bg: rgba(239, 68, 68, 0.12);
    --status-reviewed: #60a5fa;
    --status-reviewed-bg: rgba(96, 165, 250, 0.15);

    /* Aliases */
    --bg: var(--abyss);
    --text-muted: var(--muted);
    --text-secondary: var(--muted);
    --border-subtle: var(--border-light);
    --radius: 8px;
    --accent: var(--ember);
    --bg-primary: var(--bg-ember-subtle);
    --bg-secondary: var(--badge-muted);
}

/* ── Light Theme ──────────────────────────────────────────── */

html[data-theme="light"] {
    --text: #828282;
    --heading: #1a1a1a;
    --abyss: #f5f5f7;
    --deep: #efefef;
    --trench: #e8e8ec;
    --cavern: #dddde4;
    --shadow: #d0d0d8;
    --slate: #d0d0dc;
    --steel: #9898a8;
    --muted: #8888a0;
    --bright: #1a1a2e;
    --white: #06060e;
    --ember: #e8870a;
    --flame: #e06b10;
    --blaze: #d35d15;
    --glow: rgba(232, 135, 10, 0.2);
    --glow-strong: rgba(232, 135, 10, 0.4);

    --success: #16a34a;
    --danger: #dc2626;
    --error: #dc2626;
    --info: #2563eb;

    --border: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.04);
    --border-mid: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.1);
    --border-heavy: rgba(0, 0, 0, 0.13);
    --border-max: rgba(0, 0, 0, 0.18);
    --border-hover: rgba(0, 0, 0, 0.15);

    --surface-card: linear-gradient(165deg, rgba(255, 255, 255, 0.85) 0%, rgba(248, 248, 252, 0.7) 100%);
    --surface-raised: rgba(255, 255, 255, 0.6);
    --surface-header: rgba(245, 245, 247, 0.85);
    --surface-thead: rgba(240, 240, 245, 0.8);
    --surface-overlay: rgba(0, 0, 0, 0.3);

    --hover-subtle: rgba(0, 0, 0, 0.03);
    --hover-muted: rgba(0, 0, 0, 0.05);
    --hover-ember: rgba(232, 135, 10, 0.06);
    --active-ember: rgba(232, 135, 10, 0.1);
    --badge-muted: rgba(0, 0, 0, 0.06);
    --badge-ember: rgba(232, 135, 10, 0.12);
    --scroll-thumb: rgba(0, 0, 0, 0.15);
    --scroll-hover: rgba(0, 0, 0, 0.25);
    --toggle-track: rgba(0, 0, 0, 0.12);
    --input-placeholder: rgba(0, 0, 0, 0.3);
    --shadow-card: rgba(0, 0, 0, 0.06);
    --spinner-track: rgba(0, 0, 0, 0.1);

    --bg-ember-subtle: rgba(232, 135, 10, 0.1);
    --bg-ember-mid: rgba(232, 135, 10, 0.15);
    --bg-ember-glow: rgba(232, 135, 10, 0.2);
    --bg-green-subtle: rgba(16, 185, 129, 0.1);
    --bg-green-mid: rgba(16, 185, 129, 0.12);
    --bg-green-glow: rgba(16, 185, 129, 0.08);
    --bg-indigo-subtle: rgba(99, 102, 241, 0.1);
    --bg-sky-subtle: rgba(14, 165, 233, 0.1);
    --bg-purple-subtle: rgba(109, 40, 217, 0.1);
    --bg-red-subtle: rgba(220, 38, 38, 0.06);
    --bg-red-border: rgba(220, 38, 38, 0.25);
    --bg-pink-subtle: rgba(236, 72, 153, 0.1);
    --bg-teal-subtle: rgba(45, 212, 191, 0.1);
    --bg-yellow-subtle: rgba(234, 179, 8, 0.1);

    --toast-success-bg: rgba(22, 163, 74, 0.12);
    --toast-success-border: rgba(22, 163, 74, 0.3);
    --toast-success-text: #15803d;
    --toast-error-bg: rgba(220, 38, 38, 0.1);
    --toast-error-border: rgba(220, 38, 38, 0.25);
    --toast-error-text: #dc2626;
    --toast-info-bg: rgba(37, 99, 235, 0.1);
    --toast-info-border: rgba(37, 99, 235, 0.25);
    --toast-info-text: #2563eb;
    --toast-shadow: rgba(0, 0, 0, 0.1);

    --sidebar-glow: rgba(232, 135, 10, 0.08);

    /* Dealer Status Colors */
    --status-new: #16a34a;
    --status-new-bg: rgba(34, 197, 94, 0.12);
    --status-initial: #6b7280;
    --status-initial-bg: rgba(107, 114, 128, 0.1);
    --status-in_hubspot: #d97706;
    --status-in_hubspot-bg: rgba(245, 158, 11, 0.12);
    --status-outdated: #dc2626;
    --status-outdated-bg: rgba(239, 68, 68, 0.1);
    --status-deleted: #9ca3af;
    --status-deleted-bg: rgba(0, 0, 0, 0.08);
    --status-disqualified: #dc2626;
    --status-disqualified-bg: rgba(239, 68, 68, 0.08);
    --status-reviewed: #2563eb;
    --status-reviewed-bg: rgba(96, 165, 250, 0.1);
}

/* ── Base Elements ────────────────────────────────────────── */

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Roboto', -apple-system, sans-serif;
    color: var(--text);
    background: var(--abyss);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 { color: var(--heading); }
h1 { margin-bottom: 30px; }
h2 { font-size: 30px; margin-bottom: 30px; }
h3 { margin-bottom: 20px; }
h4 { font-size: 18px; margin-bottom: 16px; color: #e8e8e8; }

.logo-font-l {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, var(--bright) 0%, var(--muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.logo-font-s {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
}

.micro-font {
    font-size: 11px;
    color: var(--steel);
    letter-spacing: 0.05em;
}

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

a {
    color: inherit;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn:hover:not(.btn-primary):not(.btn-secondary):not(.btn-danger) {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* Primary — orange gradient, white text */
.btn-primary {
    background: linear-gradient(135deg, var(--ember), var(--flame));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.15);
    transform: scale(1.04);
}

/* Secondary — subtle orange bg, ember text */
.btn-secondary {
    background: rgba(245, 158, 11, 0.1);
    color: var(--ember);
    border-color: rgba(245, 158, 11, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.45);
    color: var(--blaze);
    transform: scale(1.04);
}

/* Ghost — transparent, muted text */
.btn-ghost {
    background: none;
    color: var(--muted);
    border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
}

/* Danger — red bg, red text */
.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    transform: scale(1.04);
}

/* Small modifier */
.btn-sm {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

/* Icon-only button */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.06);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-icon.spinning svg {
    animation: spin 1s linear infinite;
}

/* ── Utilities ───────────────────────────────────────────── */

.w-full { width: 100%; }
.hidden { display: none; }
.hint { color: var(--muted); margin-bottom: 4px; }
.text-bright { color: var(--bright); }

/* ── Scrollbar ───────────────────────────────────────────── */

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

/* ── Header ──────────────────────────────────────────────── */

.header {
    background: var(--deep);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    flex-shrink: 0;
    z-index: 100;
    margin-bottom: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header h1,
.header h2 {
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
}

.app-title {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
    color: var(--heading);
}

.header-logo {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.15));
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--muted);
    color: var(--heading);
    text-decoration: none;
    transition: all 0.2s ease;
}

.back-link:hover {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.06);
}

.back-link svg { width: 18px; height: 18px; }

/* ── Main Layout ─────────────────────────────────────────── */

.main-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

.content-wrapper {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    min-height: 0;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1.5rem;
}

.view { display: none; }
.view.active { display: block; }

/* ── Modal ────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 14, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active,
.modal-overlay.open { display: flex; }

.modal {
    background: var(--cavern);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-sm { max-width: 480px; }
.modal-md { max-width: 550px; }
.modal-lg { max-width: 700px; }

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

.modal-header h2,
.modal-header h3 {
    font-weight: 600;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-hover);
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 1.5rem; }

.modal-body p {
    line-height: 1.5;
}

.modal-body input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-hover);
    border-radius: 10px;
    outline: none;
    margin-top: 12px;
    background: var(--deep);
}

.modal-body input::placeholder { opacity: 0.6; }

.modal-body input:focus {
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Modal detail rows */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.detail-label {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-value {
    text-align: right;
}

/* ── Toast ────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 8px 32px var(--toast-shadow);
    animation: toastIn 0.3s ease;
    min-width: 250px;
    max-width: 420px;
    backdrop-filter: blur(12px);
}

.toast.success { background: var(--toast-success-bg); border: 1px solid var(--toast-success-border); color: var(--toast-success-text); }
.toast.error   { background: var(--toast-error-bg);   border: 1px solid var(--toast-error-border);   color: var(--toast-error-text); }
.toast.info    { background: var(--toast-info-bg);    border: 1px solid var(--toast-info-border);    color: var(--toast-info-text); }

.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ── Spinner ──────────────────────────────────────────────── */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--ember);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--ember);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 14, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.active { display: flex; }

.loading-overlay .spinner {
    width: 32px;
    height: 32px;
}

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

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

/* ── Forms ────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--trench);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    outline: none;
    transition: border-color 0.2s;
    color: inherit;
    font: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(245, 158, 11, 0.4);
}

.form-input {
    padding: 10px 12px;
    background: var(--trench);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s;
    color: inherit;
    font: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--ember);
}

textarea.form-input {
    min-height: 200px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row .form-group { flex: 1; }

.form-hint { }

/* ── Checkboxes (table) ──────────────────────────────────── */

table input[type="checkbox"],
.data-table input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--slate);
    border-radius: 4px;
    background: var(--trench);
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

table input[type="checkbox"]:checked,
.data-table input[type="checkbox"]:checked {
    background: var(--ember);
    border-color: var(--ember);
}

table input[type="checkbox"]:checked::after,
.data-table input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ── Toggle Switch ───────────────────────────────────────── */

.toggle-check {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-check span {
    display: inline-block;
    line-height: 1;
    padding-top: 2px;
}

.toggle-check input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 52px;
    height: 28px;
    min-height: 28px;
    background: #dc3545;
    border: none;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.toggle-check input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s;
}

.toggle-check input[type="checkbox"]:checked { background: #28a745; }
.toggle-check input[type="checkbox"]:checked::after { transform: translateX(24px); }

/* Dashboard toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--toggle-track);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.toggle-track::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-track { background: var(--bg-ember-glow); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); background: var(--ember); }

/* ── Empty State ─────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state svg { width: 40px; height: 40px; margin-bottom: 0.75rem; opacity: 0.4; }

/* ── Filter Bar ──────────────────────────────────────────── */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    background: var(--deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    outline: none;
    transition: border-color 0.2s;
    color: inherit;
    font: inherit;
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: rgba(245, 158, 11, 0.4);
}

.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar select { min-width: 140px; }
.filter-bar select option { background: var(--cavern); }

/* Controls bar (database-pro variant) */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--trench);
    border-bottom: 1px solid var(--border);
    align-items: center;
    flex-shrink: 0;
}

.controls input,
.controls select {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--deep);
    outline: none;
    transition: border-color 0.2s;
    color: inherit;
    font: inherit;
}

.controls input:focus,
.controls select:focus { border-color: rgba(245, 158, 11, 0.4); }
.controls select option { background: var(--cavern); }

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

.search-wrap input { width: 100%; padding-right: 32px; box-sizing: border-box; }

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    display: none;
    color: inherit;
}

.result-count {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: auto;
}

/* ── Data Table ──────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--deep);
}

.table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Global table header baseline — all tables inherit this */
th {
    font-size: 14px;
    color: var(--text);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    white-space: nowrap;
    user-select: none;
}

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

.data-table th {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--deep);
    z-index: 2;
}

.data-table th.sortable { cursor: pointer; }

.data-table th .sort-arrow {
    display: inline-block;
    margin-left: 0.25rem;
    opacity: 0.4;
}

.data-table th.sorted .sort-arrow { opacity: 1; }

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.data-table a { text-decoration: none; }

/* Database-pro table (direct th/td) */
.table-wrap { overflow: auto; flex: 1; min-height: 0; padding: 0 0.5rem; }

.table-wrap table { width: 100%; border-collapse: collapse; white-space: nowrap; }

.table-wrap th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--trench);
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.table-wrap td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-wrap tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table-wrap td a { text-decoration: none; }
.table-wrap td.empty { opacity: 0.4; }

.dealer-name { font-weight: 600; }
.dealer-city { white-space: nowrap; }
.first-seen { white-space: nowrap; }
.row-actions { display: flex; gap: 0.25rem; }

/* ── Pagination ──────────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 0;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: none;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0 0.5rem;
    color: inherit;
}

.page-btn:hover { border-color: var(--border-hover); }
.page-btn.active { background: var(--ember); border-color: var(--ember); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Database-pro pagination variant */
.pagination button {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: none;
    cursor: pointer;
    color: inherit;
}

.pagination button:hover { border-color: var(--ember); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Bulk Action Bar ─────────────────────────────────────── */

.bulk-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.bulk-bar.active { display: flex; }
.bulk-bar .bulk-count { font-weight: 600; }
.bulk-bar .bulk-actions { display: flex; gap: 0.5rem; margin-left: auto; }

/* ── Settings Card ───────────────────────────────────────── */

.settings-card {
    background: var(--deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-card h3 svg { width: 18px; height: 18px; }

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
}

/* Time input clock icon */
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ══════════════════════════════════════════════════════════════
   CRAWLER — Page-specific styles
   ══════════════════════════════════════════════════════════════ */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-hover); }

.stat-number {
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

/* ── Info Box System ──────────────────────────────────────── */

.info-box {
    position: relative;
    background: var(--deep);
    border: 1px solid var(--border-mid);
    border-left: 3px solid var(--ember);
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.info-box__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 0.5rem;
}

.info-box__title svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.info-box__text {
    color: var(--muted);
    line-height: 1.6;
}

.info-box__text strong { color: var(--heading); }

.info-box code {
    background: rgba(245, 158, 11, 0.08);
    color: var(--ember);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Info Box Grid (stat cards inside) */
.info-box__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.info-box__card {
    border-radius: 8px;
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-box__card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-box__card-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
}

.info-box__card-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.info-box__card-note {
    font-size: 0.72rem;
    opacity: 0.6;
    line-height: 1.4;
}

.info-box__card-note code {
    font-size: 0.9em;
    padding: 1px 4px;
}

/* ── Color Variants ──────────────────────────────────────── */

/* Sky (blue) — for schedule/config */
.info-box--sky { border-left-color: #3b82f6; }
.info-box--sky .info-box__title svg { color: #3b82f6; }
.info-box--sky code { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.info-box--sky .info-box__card {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.12);
}
.info-box--sky .info-box__card-value { color: #60a5fa; }

/* Teal — for inventory */
.info-box--teal { border-left-color: #2dd4bf; }
.info-box--teal .info-box__title svg { color: #2dd4bf; }
.info-box--teal code { background: rgba(45, 212, 191, 0.1); color: #2dd4bf; }
.info-box--teal .info-box__card {
    background: rgba(45, 212, 191, 0.06);
    border: 1px solid rgba(45, 212, 191, 0.12);
}
.info-box--teal .info-box__card-value { color: #2dd4bf; }

/* Ember (orange) — default / general */
.info-box--ember { border-left-color: var(--ember); }
.info-box--ember .info-box__title svg { color: var(--ember); }
.info-box--ember .info-box__card {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.12);
}
.info-box--ember .info-box__card-value { color: var(--ember); }

/* HubSpot (brand orange #ff7a59) */
.info-box--hubspot { border-left-color: #ff7a59; }
.info-box--hubspot .info-box__title svg { color: #ff7a59; }
.info-box--hubspot code { background: rgba(255, 122, 89, 0.1); color: #ff7a59; }
.info-box--hubspot .info-box__card {
    background: rgba(255, 122, 89, 0.06);
    border: 1px solid rgba(255, 122, 89, 0.12);
}
.info-box--hubspot .info-box__card-value { color: #ff7a59; }

/* Green — for success/active states */
.info-box--green { border-left-color: #34d399; }
.info-box--green .info-box__title svg { color: #34d399; }
.info-box--green code { background: rgba(52, 211, 153, 0.1); color: #34d399; }
.info-box--green .info-box__card {
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.12);
}
.info-box--green .info-box__card-value { color: #34d399; }

/* Danger (red) — for warnings/outdated */
.info-box--danger { border-left-color: var(--danger); }
.info-box--danger .info-box__title svg { color: var(--danger); }
.info-box--danger code { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.info-box--danger .info-box__card {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
}
.info-box--danger .info-box__card-value { color: #f87171; }

/* Purple — for data/analytics */
.info-box--purple { border-left-color: #a78bfa; }
.info-box--purple .info-box__title svg { color: #a78bfa; }
.info-box--purple code { background: rgba(167, 139, 250, 0.1); color: #a78bfa; }
.info-box--purple .info-box__card {
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.12);
}
.info-box--purple .info-box__card-value { color: #a78bfa; }

/* ClickUp — brand purple */
.info-box--clickup { border-left-color: #7B68EE; }
.info-box--clickup .info-box__title svg { color: #7B68EE; }
.info-box--clickup .info-box__title img { height: 18px; width: auto; vertical-align: middle; margin-right: 6px; }
.info-box--clickup code { background: rgba(123, 104, 238, 0.1); color: #7B68EE; }
.info-box--clickup .info-box__card {
    background: rgba(123, 104, 238, 0.06);
    border: 1px solid rgba(123, 104, 238, 0.12);
}
.info-box--clickup .info-box__card-value { color: #7B68EE; }

/* ClickUp logo in section header */
.clickup-logo-header {
    height: 28px;
    width: auto;
    vertical-align: middle;
    margin-right: 4px;
}

/* ClickUp message textarea */
#clickup-message {
    padding: 0.75rem;
    resize: vertical;
}

/* ClickUp formatting hint chips below textarea */
.clickup-format-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
}
.format-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
    line-height: 1;
}
.format-hint:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}
.format-hint code {
    font-size: 0.65rem;
    background: none;
    padding: 0;
    color: inherit;
}
.format-hint svg {
    opacity: 0.7;
}
.format-hint:hover svg {
    opacity: 1;
}
.format-hint--mention {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ember);
    background: rgba(245, 158, 11, 0.08);
}
.format-hint--mention:hover {
    background: rgba(245, 158, 11, 0.18);
    color: var(--flame);
}
.format-hint-sep {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 2px;
}
html[data-theme="light"] .format-hint {
    background: rgba(0, 0, 0, 0.05);
}
html[data-theme="light"] .format-hint:hover {
    background: rgba(0, 0, 0, 0.1);
}
html[data-theme="light"] .format-hint--mention {
    background: rgba(245, 158, 11, 0.06);
}
html[data-theme="light"] .format-hint--mention:hover {
    background: rgba(245, 158, 11, 0.14);
}
html[data-theme="light"] .format-hint-sep {
    background: rgba(0, 0, 0, 0.08);
}

/* Light theme adjustments */
html[data-theme="light"] .info-box {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .info-box code { font-weight: 500; }
html[data-theme="light"] .info-box__card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
html[data-theme="light"] .info-box--sky code { color: #2563eb; }
html[data-theme="light"] .info-box--sky .info-box__card-value { color: #2563eb; }
html[data-theme="light"] .info-box--teal code { color: #0d9488; }
html[data-theme="light"] .info-box--teal .info-box__card-value { color: #0d9488; }
html[data-theme="light"] .info-box--green code { color: #059669; }
html[data-theme="light"] .info-box--green .info-box__card-value { color: #059669; }
html[data-theme="light"] .info-box--danger code { color: #dc2626; }
html[data-theme="light"] .info-box--danger .info-box__card-value { color: #dc2626; }
html[data-theme="light"] .info-box--purple code { color: #7c3aed; }
html[data-theme="light"] .info-box--purple .info-box__card-value { color: #7c3aed; }
html[data-theme="light"] .info-box--clickup code { color: #6254d3; }
html[data-theme="light"] .info-box--clickup .info-box__card-value { color: #6254d3; }
/* clickup-logo-header light mode: inherits from base (no special styling) */

/* Responsive */
@media (max-width: 768px) {
    .info-box__grid { grid-template-columns: 1fr; }
}

/* Legacy .report-explainer removed — use .info-box .info-box--danger */

/* Test Log */
.test-log {
    line-height: 1.6;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.test-log-entry { padding: 2px 0; }

/* Schedule Panel */
.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dashboard-card-header h3 { margin-bottom: 0; }

.active-crawl-header-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Crawl Throbber */
.crawl-throbber {
    margin-left: 8px;
    width: 20px;
    height: 40px;
    display: grid;
    background:
        linear-gradient(currentColor 0 0) top/100% 2px,
        radial-gradient(farthest-side at top, #0000 calc(100% - 2px), currentColor calc(100% - 1px), #0000) top,
        linear-gradient(currentColor 0 0) bottom/100% 2px,
        radial-gradient(farthest-side at bottom, #0000 calc(100% - 2px), currentColor calc(100% - 1px), #0000) bottom;
    background-size: 100% 1px, 100% 50%;
    background-repeat: no-repeat;
    animation: throbber-spin 20s infinite linear;
    flex-shrink: 0;
    opacity: 0.3;
    transition: opacity 0.4s ease;
}

.crawl-throbber::before,
.crawl-throbber::after {
    content: "";
    grid-area: 1/1;
    background: inherit;
    animation: inherit;
}

.crawl-throbber::after { animation-duration: 10s; }

/* Active: fast spin + orange */
.crawl-throbber.active { color: var(--ember); opacity: 1; animation-duration: 2s; }
.crawl-throbber.active::before { animation-duration: 2s; }
.crawl-throbber.active::after { animation-duration: 1s; }

@keyframes throbber-spin { 100% { transform: rotate(1turn); } }

/* Source logo in header (right side) */
.header-source-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    margin-right: 15px;
}

/* Row Progress Bar */
.row-progress { position: relative; }
.row-progress td:first-child::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    height: 2px;
    width: var(--progress, 0%);
    background: var(--ember);
    border-radius: 0 1px 1px 0;
    transition: width 0.6s ease;
}

/* Crawl Log Row (live output under active runs) */
.crawl-log-row td {
    padding: 0 !important;
    border-top: none !important;
    background: transparent !important;
}
.crawl-log {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: var(--muted);
    padding: 4px 12px 8px;
    max-height: 100px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    opacity: 0.7;
}

/* Schedule Badge → moved to pills.css */

/* BL Table */
.bl-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.bl-table th {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.bl-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

@keyframes crawl-scan {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.bl-table tr.bl-running {
    background: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.06) 25%, rgba(245, 158, 11, 0.12) 50%, rgba(245, 158, 11, 0.06) 75%, transparent 100%);
    background-size: 200% 100%;
    animation: crawl-scan 3s ease-in-out infinite;
}

/* Status Dot → moved to pills.css */

/* Schedule Panel Footer */
.schedule-panel-footer {
    padding: 0.75rem 0 0 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.schedule-panel-footer:empty { display: none; }
.schedule-panel-footer .footer-stats span { margin-right: 1rem; }
.schedule-panel-footer .footer-stats .stat-highlight { font-weight: 500; }

/* History Table */
.history-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.history-table th {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.history-table tr:last-child td { border-bottom: none; }
.history-table tr.history-row:hover td { background: var(--trench); }
.history-table .text-right { text-align: right; }
.history-table tr.history-detail-row td { background: var(--abyss); }
.history-table tr.history-detail-row:hover td { background: var(--abyss); }

/* Harvest sub-row in active table */
.bl-table tr.harvest-sub-row td { background: transparent; border-bottom: 1px solid var(--border); }
.bl-table tr.harvest-sub-row:hover td { background: transparent; }

/* Column spacing */
.bl-table .col-start, .history-table .col-start { padding-right: 0; width: 1%; }
.bl-table .col-bl, .history-table .col-bl { padding-left: 40px; padding-right: 0; width: 1%; }
.bl-table .col-trigger, .history-table .col-trigger { padding-left: 40px; padding-right: 0; width: 1%; }
.bl-table .col-indb, .history-table .col-indb { padding-left: 40px; padding-right: 0; width: 1%; }
.bl-table .col-pages, .history-table .col-pages { padding-left: 40px; padding-right: 0; width: 1%; }
.bl-table .col-est, .history-table .col-est { padding-left: 40px; padding-right: 0; width: 1%; }
.bl-table .col-new, .history-table .col-new { padding-left: 40px; width: 1%; }
.bl-table .col-issues, .history-table .col-issues { padding-left: 20px; width: 1%; white-space: nowrap; }
.bl-table .col-status, .history-table .col-status { padding-left: 40px; width: 1%; }

.history-trigger-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--cavern);
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.retry-btn {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    color: inherit;
}

.retry-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.5); }

.delete-bl-btn { border-color: rgba(107, 114, 128, 0.3); }
.delete-bl-btn:hover { background: rgba(107, 114, 128, 0.1); border-color: rgba(107, 114, 128, 0.5); }

/* Weekday Grid */
.weekday-grid { display: flex; gap: 0.5rem; }

.weekday-btn {
    width: 40px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--trench);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.weekday-btn:hover { border-color: var(--border-hover); }
.weekday-btn.active { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }

/* BL Order List */
.bl-order-list { display: flex; flex-direction: column; gap: 2px; }

.bl-order-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: var(--trench);
    border: 1px solid transparent;
    cursor: grab;
    transition: all 0.15s;
}

.bl-order-item:hover { border-color: var(--border-hover); }
.bl-order-item.dragging { opacity: 0.5; border-color: var(--ember); }
.bl-order-item.drag-over { border-color: var(--ember); background: rgba(245, 158, 11, 0.06); }
.bl-order-handle { cursor: grab; user-select: none; }
.bl-order-name { flex: 1; }

/* Schedule Info */
.schedule-info {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 6px;
}

/* Legacy .inventory-info — replaced by .info-box system */

/* Dealer Detail Modal */
#dealer-modal .modal { max-width: 700px; }

.dealer-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.info-item span { word-break: break-word; }
.info-item a { text-decoration: none; }
.info-item a:hover { text-decoration: underline; }

/* Duplicate Check */
.dup-check-section { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.dup-check-section h3 { font-weight: 600; margin-bottom: 0.75rem; }

.dup-result { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.75rem; }

.dup-result.clear {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dup-result.clear svg { width: 18px; height: 18px; }

.dup-match {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.dup-match-info { display: flex; align-items: center; gap: 0.75rem; }
.dup-match-name { font-weight: 600; }

/* Confidence pill → moved to pills.css */

.dup-match-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dup-match-link:hover { text-decoration: underline; }
.dup-match-link svg { width: 14px; height: 14px; }

/* HubSpot / Bulk Modal */
#hubspot-modal .modal { max-width: 550px; }
#bulk-modal .modal { max-width: 450px; }

.bulk-modal-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bulk-modal-body select {
    background: var(--trench);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    outline: none;
    color: inherit;
    font: inherit;
}

/* ══════════════════════════════════════════════════════════════
   SHRIMP EDITOR — Page-specific styles
   ══════════════════════════════════════════════════════════════ */

#editor-screen {
    display: flex;
    height: 100vh;
    flex-direction: column;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--deep);
}

.editor-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.editor-header h2 {
    font-weight: 500;
    letter-spacing: 0.03em;
    margin: 0;
}

.url-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 250px;
}

.url-input {
    flex: 1;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--abyss);
    cursor: pointer;
    letter-spacing: 0.02em;
    color: inherit;
    font: inherit;
}

.url-input:focus { outline: none; border-color: rgba(249, 115, 22, 0.3); }

.editor-textarea {
    flex: 1;
    padding: 1rem;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.65;
    background: var(--abyss);
    tab-size: 2;
    color: inherit;
    font: inherit;
}

.editor-textarea::placeholder { opacity: 0.5; }
.editor-textarea:focus { box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.12); }

.editor-footer {
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--deep);
}

.status-msg {
    flex: 1;
    transition: opacity 0.3s;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   INSIDER — Page-specific styles
   ══════════════════════════════════════════════════════════════ */

/* Fullscreen overlay (deprecated — hidden) */
.fullscreen-overlay { display: none; }
.fullscreen-overlay.active { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 9999; background: var(--abyss); }
.fullscreen-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--deep); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.fullscreen-header h3 { font-weight: 500; }
.fullscreen-frame { flex: 1; border: none; width: 100%; }

/* Content Header */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--deep);
    flex-shrink: 0;
    gap: 12px;
}

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

.content-header h2 {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-header .content-meta {
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Preview Theme Toggle */
.preview-theme-toggle {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.preview-theme-btn {
    padding: 6px 10px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: inherit;
}

.preview-theme-btn.active { background: var(--glow); }

/* Preview */
.preview-container { flex: 1; position: relative; background: var(--trench); }
.preview-frame { width: 100%; height: 100%; border: none; }

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--ember);
    background: rgba(249, 115, 22, 0.04);
}

.drop-zone input { display: none; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD — Page-specific styles
   ══════════════════════════════════════════════════════════════ */

/* App Shell (grid layout) */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-areas: "sidebar header" "sidebar main";
    height: 100vh;
    height: 100dvh;
    transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app.collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }

/* Pills, badges, status-dot → moved to pills.css */

/* Dashboard Header */
.app .header {
    grid-area: header;
    background: var(--surface-header);
    height: auto;
    padding: 0 1.5rem;
    z-index: 5;
    margin-bottom: 0;
}

.header-breadcrumb { letter-spacing: 0.06em; }

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cavern), var(--slate));
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 700; line-height: 1.2; color: #e8e8e8; }
.user-role { letter-spacing: 0.1em; text-transform: uppercase; }

/* Zoom Controls */
.zoom-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
}

.zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 34px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
}

.zoom-btn:hover { background: var(--hover-ember); }
.zoom-btn svg { width: 14px; height: 14px; }

.zoom-level {
    min-width: 32px;
    text-align: center;
    letter-spacing: 0.02em;
    user-select: none;
    cursor: default;
    border-left: 1px solid var(--border-mid);
    border-right: 1px solid var(--border-mid);
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme Toggle */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: inherit;
}

.theme-toggle-btn svg { width: 16px; height: 16px; }
.theme-toggle-btn:hover { border-color: var(--glow-strong); background: var(--hover-ember); }

/* Avatar Dropdown */
.avatar-dropdown-wrap { position: relative; }

.avatar-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
}

.avatar-trigger:hover { background: var(--hover-subtle); border-color: var(--border); }
.avatar-trigger.open { background: var(--hover-muted); border-color: var(--border-mid); }

.avatar-chevron { width: 14px; height: 14px; transition: transform 0.2s ease; flex-shrink: 0; }
.avatar-trigger.open .avatar-chevron { transform: rotate(180deg); }

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: var(--cavern);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 0.5rem;
    z-index: 300;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    display: none;
    animation: fadeUp 0.15s ease;
}

.avatar-dropdown.open { display: block; }

.avatar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 0.75rem;
}

.avatar-dropdown-header .user-avatar { width: 36px; height: 36px; }
.avatar-dropdown-name { font-weight: 600; line-height: 1.3; }
.avatar-dropdown-divider { height: 1px; background: var(--border-mid); margin: 0.25rem 0; }

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    color: inherit;
}

.avatar-dropdown-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.avatar-dropdown-item:hover { background: var(--hover-muted); }
.avatar-dropdown-item:hover svg { opacity: 1; }
.avatar-dropdown-item.danger:hover { background: var(--bg-red-subtle); }

/* Main Content */
.main {
    grid-area: main;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    position: relative;
}

.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--toggle-track); border-radius: 3px; }
.main::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }

/* Welcome */
.welcome-section { margin-bottom: 2rem; animation: fadeUp 0.5s ease both; }
.welcome-title { font-weight: 700; margin-bottom: 0.5rem; }

.welcome-title span {
    background: linear-gradient(135deg, var(--ember), var(--blaze));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-sub .status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    margin-right: 0.5rem;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Dashboard Stats (override for auto-fit) */
.app .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.app .stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-mid);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeUp 0.5s ease both;
}

.app .stat-card:nth-child(1) { animation-delay: 0.05s; }
.app .stat-card:nth-child(2) { animation-delay: 0.1s; }
.app .stat-card:nth-child(3) { animation-delay: 0.15s; }
.app .stat-card:nth-child(4) { animation-delay: 0.2s; }

.app .stat-card:hover {
    border-color: var(--border-heavy);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-card);
}

.app .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: 16px 16px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.app .stat-card:hover::before { opacity: 1; }

.app .stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--ember), var(--flame)); }
.app .stat-card:nth-child(2)::before { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.app .stat-card:nth-child(3)::before { background: linear-gradient(90deg, #818cf8, #a78bfa); }
.app .stat-card:nth-child(4)::before { background: linear-gradient(90deg, #38bdf8, #67e8f9); }

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

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 20px; height: 20px; }

.stat-card:nth-child(1) .stat-icon { background: var(--bg-ember-subtle); }
.stat-card:nth-child(2) .stat-icon { background: var(--bg-green-subtle); }
.stat-card:nth-child(3) .stat-icon { background: var(--bg-indigo-subtle); }
.stat-card:nth-child(4) .stat-icon { background: var(--bg-sky-subtle); }

.stat-trend.up { background: var(--bg-green-subtle); }
.stat-value { font-weight: 800; line-height: 1; margin-bottom: 0.25rem; }

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.panel {
    background: var(--surface-card);
    border: 1px solid var(--border-mid);
    border-radius: 16px;
    overflow: hidden;
    animation: fadeUp 0.5s ease both;
    animation-delay: 0.25s;
}

.panel:nth-child(2) { animation-delay: 0.3s; }

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

.panel-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-title svg { width: 16px; height: 16px; }

.panel-action {
    text-decoration: none;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.panel-body { padding: 1rem 1.25rem; }

/* Activity List */
.activity-list { list-style: none; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.activity-dot.ember { background: var(--ember); }
.activity-dot.green { background: #34d399; }
.activity-dot.purple { background: #818cf8; }

.activity-content { flex: 1; }
.activity-text { line-height: 1.4; }
.activity-text strong { font-weight: 600; }
.activity-time { margin-top: 0.15rem; }

/* Quick Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.app-card:hover {
    background: var(--hover-muted);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.app-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-card-info { overflow: hidden; }
.app-card-name { font-weight: 600; line-height: 1.2; }

.app-card-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading State */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--abyss);
}

.loading-state .loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.dashboard-main { min-width: 0; }

/* Section Labels */
.section-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    animation: fadeUp 0.4s ease both;
}

.section-label svg { width: 14px; height: 14px; opacity: 0.6; }
.section-count { background: #191e2b; margin-left: 0.15rem; }

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.project-card {
    background: var(--surface-card);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    animation: fadeUp 0.5s ease both;
    display: flex;
    flex-direction: column;
}

.project-card:nth-child(1) { animation-delay: 0.03s; }
.project-card:nth-child(2) { animation-delay: 0.06s; }
.project-card:nth-child(3) { animation-delay: 0.09s; }
.project-card:nth-child(4) { animation-delay: 0.12s; }
.project-card:nth-child(5) { animation-delay: 0.15s; }

.project-card:hover {
    border-color: var(--border-heavy);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-card);
}

.project-status-line {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: 14px 14px 0 0;
    background: var(--toggle-track);
    transition: background 0.3s ease;
}

.project-card[data-status="live"] .project-status-line { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.project-card[data-status="dev"] .project-status-line { background: linear-gradient(90deg, var(--ember), var(--blaze)); }
.project-card[data-status="planned"] .project-status-line { background: linear-gradient(90deg, rgba(90, 90, 122, 0.3), rgba(90, 90, 122, 0.1)); }

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--border-mid);
}

.project-icon svg { width: 20px; height: 20px; }

.project-meta { flex: 1; min-width: 0; }

.project-meta h3 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-tags { display: flex; gap: 0.5rem; }

.project-desc { line-height: 1.5; margin-bottom: 1rem; }

.project-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    margin-bottom: -1.25rem;
}

.project-tech { display: flex; gap: 0.4rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.project-footer > .pill { flex-shrink: 0; margin-left: auto; }

.project-launch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    background: var(--bg-green-glow);
    transition: all 0.2s ease;
    color: inherit;
}

.project-launch svg { width: 12px; height: 12px; }
.project-launch:hover { background: var(--toast-success-bg); }

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1rem;
}

.team-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem;
}

/* Usercard */
.usercard {
    background: var(--surface-card);
    border: 1px solid var(--border-mid);
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 320px;
    transition: all 0.3s ease;
    animation: fadeUp 0.5s ease both;
}

.usercard:hover {
    border-color: var(--border-heavy);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow-card);
}

.usercard-top { display: flex; align-items: center; gap: 1rem; }

.usercard-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cavern), var(--slate));
    border: 2px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}

.usercard-avatar img { width: 100%; height: 100%; object-fit: cover; }

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

.usercard-name {
    font-weight: 700;
    font-size: 1rem;
    color: #e8e8e8;
    line-height: 1.2;
    margin: 0 0 0.25rem 0;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.usercard-badges { display: flex; gap: 0.5rem; }

.usercard-stats {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.usercard-stat { display: flex; flex-direction: column; }
.usercard-stat:last-child:not(:first-child) { margin-left: auto; text-align: right; }
.usercard-stat-value { line-height: 1.5; }
.card-label { letter-spacing: 0.1em; text-transform: uppercase; color: #3c3c5c; font-size: 14px; }

.usercard-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.usercard-dot.active { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.4); }
.usercard-dot.inactive { background: var(--muted); opacity: 0.4; }

/* Users Page */
.users-page { display: none; }
.users-page.visible { display: block; }

.users-page-header { margin-bottom: 2rem; animation: fadeUp 0.5s ease both; }
.users-page-header h2 { font-weight: 700; letter-spacing: -0.02em; }
.users-page-header p { margin-top: 0.5rem; }

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    animation: fadeUp 0.5s ease 0.1s both;
}

.users-table thead th {
    letter-spacing: 0.15em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-thead);
}

.users-table tbody tr { transition: background 0.15s ease; }
.users-table tbody tr:hover { background: var(--hover-subtle); }

.users-table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.users-table-user { display: flex; align-items: center; gap: 1rem; }

.users-table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 600;
    background: var(--cavern);
    border: 1px solid var(--border-strong);
    overflow: hidden;
}

.users-table-avatar img { width: 100%; height: 100%; object-fit: cover; }
.users-table-name { font-weight: 600; line-height: 1.3; }

/* User table badges → moved to pills.css */

.users-table-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.users-table-status .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.users-table-status.active .dot { background: #10b981; }
.users-table-status.inactive .dot { background: var(--muted); }

.users-loading { text-align: center; padding: 3rem; }

/* Actions Button */
.actions-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.1em;
    margin-left: auto;
    color: inherit;
}

.actions-btn:hover { border-color: var(--border-heavy); background: var(--hover-muted); }

/* Permission Checkboxes */
.perm-list { display: flex; flex-direction: column; gap: 0.75rem; }

.perm-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--hover-subtle);
    border: 1px solid var(--border-light);
    transition: border-color 0.15s ease;
}

.perm-item:has(input:checked) { border-color: var(--border-strong); background: var(--hover-muted); }

.perm-item input[type="checkbox"] {
    margin-top: 0.15rem;
    accent-color: var(--ember);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.perm-info { flex: 1; }
.perm-name { font-weight: 600; margin-bottom: 0.15rem; }
.perm-desc { line-height: 1.4; }

/* Admin Apps */
.admin-apps-page { display: none; }
.admin-apps-page.visible { display: block; }

.admin-apps-header { margin-bottom: 2rem; animation: fadeUp 0.5s ease both; }
.admin-apps-header h2 { font-weight: 700; letter-spacing: -0.02em; }
.admin-apps-header p { margin-top: 0.5rem; }

.admin-apps-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    animation: fadeUp 0.5s ease 0.1s both;
}

.admin-apps-table thead th {
    letter-spacing: 0.15em;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-thead);
}

.admin-apps-table tbody tr { transition: background 0.15s ease; }
.admin-apps-table tbody tr:hover { background: var(--hover-subtle); }

.admin-apps-table tbody td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.admin-apps-icon-cell {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-ember-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.admin-apps-icon-cell img { width: 100%; height: 100%; object-fit: cover; }
.admin-apps-icon-cell svg { width: 22px; height: 22px; }
.admin-apps-name { font-weight: 600; }
.admin-apps-loading { text-align: center; padding: 2rem !important; }

.admin-apps-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    background: var(--active-ember);
    border: 1px solid var(--glow);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    color: inherit;
}

.admin-apps-edit-btn:hover { background: var(--bg-ember-mid); border-color: var(--glow-strong); }
.admin-apps-edit-btn svg { width: 14px; height: 14px; }

.admin-apps-drag-handle { cursor: grab; padding: 0 0.25rem; user-select: none; }
.admin-apps-drag-handle:active { cursor: grabbing; }
.admin-apps-drag-handle svg { width: 16px; height: 16px; opacity: 0.4; transition: opacity 0.15s ease; }
.admin-apps-table tbody tr:hover .admin-apps-drag-handle svg { opacity: 0.8; }
.admin-apps-table tbody tr.dragging { opacity: 0.4; }
.admin-apps-table tbody tr.drag-over { border-top: 2px solid var(--ember); }

/* App Edit Modal */
.app-edit-icon-section { display: flex; align-items: flex-start; gap: 1.25rem; }

.app-edit-icon-preview {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    background: var(--bg-ember-subtle);
    border: 2px dashed var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.app-edit-icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.app-edit-icon-preview svg { width: 32px; height: 32px; }

.app-edit-icon-controls { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.25rem; }

.app-edit-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    background: var(--active-ember);
    border: 1px solid var(--glow);
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
}

.app-edit-upload-btn:hover { background: var(--bg-ember-mid); border-color: var(--glow-strong); }

.app-edit-delete-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
}

.app-edit-delete-icon-btn:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); }

.app-edit-upload-status { font-weight: 500; min-height: 1em; }

/* ── Activity Logs Page ─────────────────────────── */
.logs-page { display: none; }
.logs-page.visible { display: block; }

.logs-page-header { margin-bottom: 1.5rem; animation: fadeUp 0.5s ease both; }
.logs-page-header h2 { font-weight: 700; letter-spacing: -0.02em; }
.logs-page-header p { margin-top: 0.5rem; }

.logs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    animation: fadeUp 0.5s ease 0.05s both;
}

.logs-filter-group { display: flex; flex-direction: column; gap: 0.3rem; }
.logs-filter-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.logs-select {
    min-width: 140px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.logs-date-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 130px;
}

.logs-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.82rem;
    color: var(--muted);
    animation: fadeUp 0.5s ease 0.1s both;
}

.logs-stat-item strong { color: var(--heading); }

.logs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    animation: fadeUp 0.5s ease 0.15s both;
}

.logs-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-thead);
    color: var(--muted);
    text-align: left;
}

.logs-table tbody tr { transition: background 0.15s ease; }
.logs-table tbody tr:hover { background: var(--hover-subtle); }

.logs-table tbody td {
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

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

.logs-loading { text-align: center; padding: 2rem !important; color: var(--muted); }

.logs-pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
    animation: fadeUp 0.5s ease 0.2s both;
}

.logs-pag-inner {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logs-pag-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--active-ember);
    border: 1px solid var(--glow);
    color: var(--ember);
}

/* Profile Page */
.profile-page { display: none; }
.profile-page.visible { display: block; }

.profile-header { margin-bottom: 2rem; animation: fadeUp 0.5s ease both; }
.profile-header h2 { font-weight: 700; margin-bottom: 0.5rem; }

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 1rem;
    max-width: 960px;
}

.profile-col { display: flex; flex-direction: column; gap: 1rem; }

.profile-section { animation: fadeUp 0.5s ease both; }
.profile-col:first-child .profile-section:nth-child(1) { animation-delay: 0.05s; }
.profile-col:first-child .profile-section:nth-child(2) { animation-delay: 0.15s; }
.profile-col:last-child .profile-section:nth-child(1) { animation-delay: 0.1s; }
.profile-col:last-child .profile-section:nth-child(2) { animation-delay: 0.15s; }

.profile-section.full-width { grid-column: 1 / -1; }

.s-panel {
    background: var(--surface-card);
    border: 1px solid var(--border-mid);
    border-radius: 16px;
    overflow: hidden;
}

.s-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.s-panel-header svg { width: 16px; height: 16px; flex-shrink: 0; }
.s-panel-header span { font-weight: 600; }
.s-panel-body { padding: 1.25rem; }

/* Profile Hero */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--cavern), var(--slate));
    border: 2px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-meta { flex: 1; min-width: 0; }
.profile-meta h3 { font-weight: 700; margin-bottom: 0.5rem; }
.profile-badges { display: flex; gap: 0.5rem; flex-wrap: wrap; }
/* Profile badges → moved to pills.css */

/* Profile Form */
.s-field { margin-bottom: 1.25rem; }
.s-field:last-child { margin-bottom: 0; }

.s-label {
    display: block;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.s-input {
    width: 100%;
    padding: 0.75rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-heavy);
    outline: none;
    transition: border-color 0.3s ease;
    color: inherit;
    font: inherit;
}

.s-input:focus { border-bottom-color: var(--ember); }
.s-input:read-only { cursor: default; }

.s-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.s-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* Connections */
.connection-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.connection-row:last-child { border-bottom: none; }
.connection-info { display: flex; align-items: center; gap: 1rem; }

.connection-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.connection-icon svg { width: 20px; height: 20px; }
.connection-name { font-weight: 600; line-height: 1.2; }
.connection-status.connected { background: var(--bg-green-mid); }
.connection-status.disconnected { background: var(--badge-muted); }

/* Toggle Row */
.s-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.s-toggle-desc { margin-top: 0.15rem; }

.pref-select {
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    outline: none;
    cursor: pointer;
    min-width: 80px;
    transition: border-color 0.2s;
    color: inherit;
    font: inherit;
}

.pref-select:focus { border-color: var(--accent); }
.pref-select option { background: var(--bg-primary); }

/* Colorbox */
.colorbox {
    position: relative;
    background: var(--bg-sky-subtle);
    border-left: 3px solid var(--info);
    border-radius: 0 12px 12px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    animation: fadeUp 0.5s ease 0.2s both;
    line-height: 1.55;
    font-size: 16px;
    color: var(--muted);
}

.colorbox kbd {
    display: inline-block;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: 1px;
    color: var(--bright);
    font-size: 11px;
}

/* Changelog */
.changelog-sidebar { position: sticky; top: 1.75rem; animation: fadeUp 0.5s ease 0.3s both; }

.changelog-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    max-height: calc(100vh - var(--header-h) - 6rem);
    overflow-y: auto;
}

.changelog-card::-webkit-scrollbar { width: 4px; }
.changelog-card::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }

.changelog-list { display: flex; flex-direction: column; gap: 0; }

.changelog-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

.changelog-item:last-child { border-bottom: none; padding-bottom: 0; }
.changelog-item:first-child { padding-top: 0; }
.changelog-date { letter-spacing: 0.06em; margin-bottom: 0.25rem; display: flex; align-items: center; gap: 0.5rem; }

h4.changelog-title { margin-bottom: 0.15rem; line-height: 1.2; }


.changelog-desc { line-height: 1.5; }

/* Table scroll wrap for dashboard */
.table-scroll-wrap { border-radius: 14px; border: 1px solid var(--border); animation: fadeUp 0.5s ease 0.1s both; }

.table-scroll-wrap .users-table,
.table-scroll-wrap .admin-apps-table {
    border: none;
    border-radius: 0;
    animation: none;
    min-width: 600px;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile breakpoints
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .changelog-sidebar { position: static; }
    .changelog-card { max-height: none; }
}

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dealer-info-grid { grid-template-columns: 1fr; }

    /* Shrimp editor responsive */
    .main-container { flex-direction: column; height: calc(100vh - var(--header-h)); }
    .editor-area { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .editor-textarea { flex: 1; min-height: 200px; overflow-y: auto; }
    .editor-footer { flex-shrink: 0; flex-wrap: wrap; gap: 0.5rem; }
    .editor-footer .btn { flex: 1; min-width: 120px; }
    .status-msg { flex-basis: 100%; text-align: center; }
    .url-display { flex-basis: 100%; order: -1; }
}

@media (max-width: 768px) {
    .content-area { padding: 1rem; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar input { min-width: 0; }
    .result-count { margin-left: 0; }
    .data-table th, .data-table td { padding: 0.5rem 0.75rem; }
    .controls { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .controls input { min-width: 0; }
    /* Dashboard content */
    .content-grid { grid-template-columns: 1fr; }
    .user-info { display: none; }
    .main { padding: 1.25rem; }
    .zoom-group { display: none; }
    .projects-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-col { gap: 0.75rem; }
    .s-row { grid-template-columns: 1fr; }
    .profile-hero { flex-direction: column; text-align: center; }

    /* App header: less padding on mobile */
    .header { padding: 0 1rem; margin-bottom: 15px; }
    .header h2 { font-size: 1rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .apps-grid { grid-template-columns: 1fr; }
    .avatar-chevron { display: none; }
}
