/* ═══════════════════════════════════════════════════════════
   AgeDash AI Systems — Shared Theme (Light + Dark Mode)
   Used by both LinkedIn and Category dashboards
   ═══════════════════════════════════════════════════════════ */

/* ── Light Mode (default) ─────────────────────────────────── */
:root {
    --orange-50:  #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;

    --bg-body:       #f8fafc;
    --bg-card:       #ffffff;
    --bg-surface:    #f1f5f9;
    --bg-input:      #ffffff;
    --bg-hover:      #f1f5f9;
    --bg-overlay:    rgba(248, 250, 252, 0.96);

    --border-color:  #e2e8f0;
    --border-hover:  #cbd5e1;

    --text-primary:  #0f172a;
    --text-secondary:#64748b;
    --text-muted:    #94a3b8;
    --text-inverse:  #ffffff;

    --success:       #16a34a;
    --success-bg:    #dcfce7;
    --danger:        #ef4444;
    --danger-bg:     #fef2f2;
    --info:          #3b82f6;
    --info-bg:       #eff6ff;
    --warning:       #f59e0b;
    --warning-bg:    #fffbeb;

    --shadow-sm:  0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md:  0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg:  0 20px 50px rgba(15, 23, 42, .18);

    --radius:    14px;
    --radius-lg: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Table specific */
    --table-header-bg: #f1f5f9;
    --table-row-even:  #ffffff;
    --table-row-odd:   #f8fafc;
    --table-row-hover: rgba(249, 115, 22, 0.04);
}

/* ── Dark Mode ────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-body:       #0b0f19;
    --bg-card:       #151b2b;
    --bg-surface:    #1e2638;
    --bg-input:      #101522;
    --bg-hover:      #1e2638;
    --bg-overlay:    rgba(11, 15, 25, 0.96);

    --border-color:  #2a3449;
    --border-hover:  #3b4a63;

    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --text-inverse:  #0f172a;

    --success-bg:    rgba(16, 163, 74, 0.1);
    --danger-bg:     rgba(239, 68, 68, 0.1);
    --info-bg:       rgba(59, 130, 246, 0.1);
    --warning-bg:    rgba(245, 158, 11, 0.1);

    --shadow-sm:  0 1px 3px rgba(0, 0, 0, .2);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, .3);
    --shadow-lg:  0 20px 50px rgba(0, 0, 0, .5);

    --table-header-bg: #1e293b;
    --table-row-even:  #151b2b;
    --table-row-odd:   #101522;
    --table-row-hover: rgba(249, 115, 22, 0.06);
}

/* ── Reset ────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s ease, color .3s ease;
}
svg { display: block; }
[hidden] { display: none !important; }
button svg, a svg, .btn svg { width: 18px; height: 18px; flex-shrink: 0; }
a { color: var(--orange-600); }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Custom scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 600 15px/1 var(--font);
    padding: 13px 22px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 3px solid var(--orange-200); outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--orange-600), var(--orange-700)); box-shadow: 0 6px 20px rgba(249, 115, 22, .45); }

.btn-ghost {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}
.btn-ghost:hover { border-color: var(--orange-500); color: var(--orange-600); background: var(--orange-50); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(249, 115, 22, 0.1); }

.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-sheet {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}
.btn-sheet:hover { border-color: var(--success); background: var(--success-bg); }
.btn-sheet svg { width: 20px; height: 20px; }

/* ── Fields ───────────────────────────────────────────────── */
.field { display: block; margin-bottom: 18px; }
.field-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: .01em;
}
.field-label em { color: var(--danger); font-style: normal; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    font: 400 15px/1.5 var(--font);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 13px 15px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
input:hover, textarea:hover, select:hover { border-color: var(--border-hover); }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--orange-500);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 130px; }
select { cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-body {
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(249, 115, 22, .12), transparent 60%),
        radial-gradient(700px 450px at -10% 110%, rgba(249, 115, 22, .10), transparent 60%),
        var(--bg-body);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px 32px 28px;
    animation: rise .45s ease both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand h1 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-top: 14px; }
.login-brand p { font-size: 14px; color: var(--text-secondary); margin-top: 3px; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: #fff;
    box-shadow: 0 6px 18px rgba(249, 115, 22, .35);
}
.brand-mark svg { width: 26px; height: 26px; }

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 48px; }
.password-toggle {
    position: absolute;
    top: 50%; right: 8px;
    transform: translateY(-50%);
    background: none; border: none;
    padding: 8px; cursor: pointer;
    color: var(--text-muted);
    border-radius: 8px;
    transition: color .2s ease;
}
.password-toggle:hover { color: var(--text-secondary); }

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-error { background: var(--danger-bg); color: #b91c1c; border: 1px solid #fecaca; }
[data-theme="dark"] .alert-error { color: #fca5a5; border-color: rgba(239,68,68,.3); }

.login-foot {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR (shared by both dashboards)
   ═══════════════════════════════════════════════════════════ */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: background-color .3s ease;
}
.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.topbar-brand .brand-mark svg { width: 20px; height: 20px; }
.topbar-title { min-width: 0; }
.topbar-title strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span { display: block; font-size: 12.5px; color: var(--text-secondary); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Theme Toggle Button ─────────────────────────────────── */
.theme-toggle {
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}
.theme-toggle:hover { border-color: var(--orange-500); color: var(--orange-500); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { width: 20px; height: 20px; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 26px 24px;
    animation: rise .35s ease both;
    transition: background-color .3s ease, border-color .3s ease;
}
.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}
.card-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.card-head p { font-size: 13.5px; color: var(--text-secondary); margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background-color .3s ease;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.stat-icon.orange { background: rgba(249, 115, 22, 0.1); color: var(--orange-500); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.stat-info h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

/* ═══════════════════════════════════════════════════════════
   SPREADSHEET TABLE
   ═══════════════════════════════════════════════════════════ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: background-color .3s ease;
}
.table-toolbar {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.table-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-title svg { width: 18px; height: 18px; color: var(--text-muted); }
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.action-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 10px;
    font: 500 13px/1 var(--font);
    cursor: pointer;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}
.action-btn svg { width: 14px; height: 14px; }

.table-container {
    overflow: auto;
    max-height: calc(100vh - 320px);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background: var(--table-header-bg);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
th:last-child { border-right: none; }

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background .15s;
    white-space: nowrap;
}
td:last-child { border-right: none; }

tr:nth-child(even) td { background: var(--table-row-even); }
tr:nth-child(odd) td { background: var(--table-row-odd); }
tr:hover td { background: var(--table-row-hover); }

/* Top 10 priority rows */
tr.priority-row td {
    font-weight: 600;
}
tr.priority-row td:first-child {
    border-left: 3px solid var(--orange-500);
}

/* Ghar Shop highlighted row */
tr.ghar-shop-row td {
    background: rgba(249, 115, 22, 0.06) !important;
}
[data-theme="dark"] tr.ghar-shop-row td {
    background: rgba(249, 115, 22, 0.1) !important;
}

/* Separator row before dropouts */
tr.separator-row td {
    background: var(--bg-surface);
    text-align: center;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 16px;
    border-right: none;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-new {
    background: var(--success-bg);
    color: var(--success);
}
.badge-out {
    background: var(--danger-bg);
    color: var(--danger);
}
.badge-dropout {
    background: var(--warning-bg);
    color: var(--warning);
}
.badge-rank {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Rank arrows */
.rank-up { color: var(--success); }
.rank-down { color: var(--danger); }
.rank-same { color: var(--text-muted); }
.rank-arrow { font-size: 0.75rem; margin-right: 3px; }

/* ── Ghar Shop Tag Cell ──────────────────────────────────── */
.ghar-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    background: rgba(249, 115, 22, 0.08);
    color: var(--orange-600);
    border: 1px solid rgba(249, 115, 22, 0.2);
}
[data-theme="dark"] .ghar-tag {
    background: rgba(249, 115, 22, 0.15);
    color: #fdba74;
}

/* ── Product link ─────────────────────────────────────────── */
.product-link {
    color: var(--info);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.product-link:hover {
    color: var(--orange-500);
    text-decoration: underline;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    text-align: center;
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 1.1rem; margin-bottom: 4px; color: var(--text-secondary); }
.empty-state span { font-size: 0.9rem; }

/* ═══════════════════════════════════════════════════════════
   TAB SWITCHER (Category Tabs)
   ═══════════════════════════════════════════════════════════ */
.tab-switch {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 5px;
}
.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 600 14px/1.25 var(--font);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
    text-align: center;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.tab-btn:focus-visible { outline: 3px solid var(--orange-200); outline-offset: 1px; }
.tab-btn.active {
    background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
    color: #fff;
    box-shadow: 0 4px 12px rgba(249, 115, 22, .35);
}
.tab-btn svg { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.filter-bar label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.filter-bar input[type="date"],
.filter-bar select {
    width: auto;
    min-width: 160px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   LINKEDIN-SPECIFIC (overrides)
   ═══════════════════════════════════════════════════════════ */
.linkedin-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 28px 16px 60px;
}
.linkedin-page .topbar-inner { max-width: 860px; }

/* ── Tooltips ─────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--text-primary);
    color: var(--text-inverse);
    font: 500 12px/1.3 var(--font);
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 30;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: none; }

/* ── LinkedIn sheet btns, mode switch, etc ─────────────────── */
.sheet-links { display: flex; gap: 8px; flex-shrink: 0; }
.sheet-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, transform .15s ease;
}
.sheet-btn:hover { border-color: var(--success); background: var(--success-bg); transform: translateY(-1px); }
.sheet-btn.sheet-btn-input:hover { border-color: #1a73e8; background: var(--info-bg); }
.sheet-btn svg { width: 22px; height: 22px; }

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--orange-50);
    border: 1px solid var(--orange-200);
    color: var(--orange-700);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
}
[data-theme="dark"] .notice { background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.2); }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.notice a { color: var(--orange-700); font-weight: 700; }

.mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 18px;
}
.mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font: 600 13.5px/1 var(--font);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 10px 8px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.mode-btn:hover { color: var(--text-primary); }
.mode-btn.active {
    background: var(--bg-card);
    color: var(--orange-600);
    box-shadow: var(--shadow-sm);
}
.mode-btn svg { width: 16px; height: 16px; }
.mode-panel { margin-bottom: 18px; }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    border: 2px dashed var(--border-hover);
    border-radius: var(--radius);
    background: var(--bg-surface);
    padding: 30px 16px;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--orange-500); background: var(--orange-50); }
[data-theme="dark"] .dropzone:hover, [data-theme="dark"] .dropzone.dragover { background: rgba(249,115,22,.08); }
.dropzone svg { width: 34px; height: 34px; color: var(--orange-500); margin-bottom: 4px; }
.dropzone strong { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.dropzone .dz-or { font-weight: 400; color: var(--text-secondary); }
.dz-hint { font-size: 12.5px; color: var(--text-muted); }

.file-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--orange-50);
    border: 1.5px solid var(--orange-200);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 10px;
}
[data-theme="dark"] .file-chip { background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.2); }
.file-chip svg { width: 20px; height: 20px; color: var(--orange-600); flex-shrink: 0; }
.file-chip-name { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.file-chip-size { font-size: 12.5px; color: var(--text-secondary); flex-shrink: 0; }
.file-remove { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 6px; border-radius: 8px; transition: color .2s ease, background-color .2s ease; flex-shrink: 0; }
.file-remove:hover { color: var(--danger); background: var(--bg-card); }
.file-remove svg { width: 15px; height: 15px; color: inherit; }

.textarea-wrap { position: relative; }
.expand-btn {
    position: absolute;
    top: 10px; right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
}
.expand-btn:hover { color: var(--orange-600); border-color: var(--orange-500); }
.expand-btn svg { width: 15px; height: 15px; }

.form-error {
    display: flex;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
    color: #b91c1c;
    background: var(--danger-bg);
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 13px;
    margin-bottom: 16px;
}
[data-theme="dark"] .form-error { color: #fca5a5; border-color: rgba(239,68,68,.3); }

/* ═══════════════════════════════════════════════════════════
   MODALS & OVERLAYS
   ═══════════════════════════════════════════════════════════ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 42, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-inner {
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: 92vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: rise .25s ease both;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-head h3 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.modal-head h3 svg { width: 17px; height: 17px; color: var(--orange-600); }

#modalTextarea {
    flex: 1;
    border: none;
    border-radius: 0;
    resize: none;
    padding: 20px;
    font-size: 15.5px;
    line-height: 1.65;
    min-height: 0;
}
#modalTextarea:focus { box-shadow: none; }

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
}
#modalCount { font-size: 13px; color: var(--text-secondary); }

.overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .25s ease both;
}
.overlay-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 44px 32px;
    text-align: center;
    animation: rise .3s ease both;
}
.overlay-state h3 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin: 20px 0 8px; }
.overlay-state p { font-size: 14.5px; color: var(--text-secondary); margin-bottom: 4px; }
.overlay-state .btn { margin-top: 18px; width: 100%; }
.overlay-state .btn + .btn { margin-top: 10px; }

.spinner {
    width: 58px; height: 58px;
    margin: 0 auto;
    border-radius: 50%;
    border: 5px solid var(--orange-100);
    border-top-color: var(--orange-500);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.success-ring, .error-ring {
    width: 64px; height: 64px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pop .4s cubic-bezier(.36, 1.6, .5, 1) both;
}
.success-ring { background: var(--success-bg); color: var(--success); }
.error-ring   { background: var(--danger-bg); color: var(--danger); }
.success-ring svg, .error-ring svg { width: 30px; height: 30px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--text-primary);
    color: var(--text-inverse);
    font-size: 14px;
    font-weight: 500;
    padding: 13px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    max-width: calc(100vw - 32px);
    animation: toastIn .35s cubic-bezier(.36, 1.3, .5, 1) both;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast svg { width: 18px; height: 18px; color: var(--orange-500); flex-shrink: 0; }
.toast a { color: #fdba74; font-weight: 700; }
.toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); padding: 4px; border-radius: 6px;
    flex-shrink: 0;
    transition: color .2s ease;
}
.toast-close:hover { color: var(--text-inverse); }
.toast-close svg { width: 14px; height: 14px; color: inherit; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-actions { justify-content: flex-end; }
}

@media (max-width: 480px) {
    .linkedin-page { padding: 18px 12px 48px; }
    .card { padding: 20px 16px; }
    .tab-btn { font-size: 12.5px; padding: 9px 12px; }
    .tab-btn svg { width: 14px; height: 14px; }
    .card-head { flex-direction: column-reverse; }
    .sheet-links { align-self: flex-end; }
    .topbar-title span { display: none; }
    .login-card { padding: 30px 22px 22px; }
    .overlay-card { padding: 34px 22px; }
    [data-tip]::after { display: none; }
    .stats-row { grid-template-columns: 1fr; }
    .stat-info p { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
