/* =============================================================================
   TalentVelo - Global stylesheet
   -----------------------------------------------------------------------------
   One shared stylesheet for every page (login, dashboard, admin, ...), so the
   branding and the responsive behaviour stay identical across the application.

   Sections
     1. Design tokens (dark + light theme)
     2. Base / reset
     3. Layout helpers
     4. Header, brand, navigation, moving ticker
     5. Buttons
     6. Cards and stat tiles
     7. Forms
     8. Badges, chips, alerts
     9. Tables (responsive)
    10. Authentication pages (login, register, ...)
    11. Social icons and WhatsApp
    12. Footer
    13. Page specific components
    14. Responsive breakpoints
    15. Accessibility / reduced motion
   ============================================================================= */

/* 1. Design tokens ---------------------------------------------------------- */
:root {
    --tv-bg: #080D1A;
    --tv-surface: #101829;
    --tv-surface-2: #0B1322;
    --tv-text: #F1F5F9;
    --tv-muted: #94A3B8;
    --tv-border: #1F2C45;
    --tv-input-bg: #0B1322;
    --tv-nav-bg: rgba(8, 13, 26, 0.88);
    --tv-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);

    --tv-primary: #3B82F6;
    --tv-primary-strong: #2563EB;
    --tv-cyan: #06B6D4;
    --tv-accent: #F59E0B;
    --tv-success: #22C55E;
    --tv-danger: #EF4444;
    --tv-purple: #A855F7;
    --tv-accent-text: #60A5FA;   /* blue text that stays readable on the current background */

    --tv-gradient: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
    --tv-radius: 16px;
    --tv-radius-sm: 10px;
}

[data-theme="light"] {
    --tv-bg: #F3F6FB;
    --tv-surface: #FFFFFF;
    --tv-surface-2: #F8FAFC;
    --tv-text: #0F172A;
    --tv-muted: #64748B;
    --tv-border: #DCE4EF;
    --tv-input-bg: #FFFFFF;
    --tv-nav-bg: rgba(255, 255, 255, 0.9);
    --tv-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --tv-accent-text: #1D4ED8;
}

/* Portal accent colours (used by the three login portals) */
[data-portal="candidate"] { --tv-hero: linear-gradient(145deg, #2563EB 0%, #1D4ED8 45%, #0E7490 100%); --tv-portal: #3B82F6; }
[data-portal="recruiter"] { --tv-hero: linear-gradient(145deg, #7C3AED 0%, #4F46E5 50%, #1E3A8A 100%); --tv-portal: #8B5CF6; }
[data-portal="admin"]     { --tv-hero: linear-gradient(145deg, #0F172A 0%, #1E293B 45%, #B45309 135%); --tv-portal: #F59E0B; }

/* 2. Base / reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--tv-bg);
    color: var(--tv-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    transition: background 0.25s ease, color 0.25s ease;
}
h1, h2, h3, h4, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: var(--tv-primary); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 3. Layout helpers ---------------------------------------------------------- */
.tv-main {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 32px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.tv-main-md { max-width: 1200px; }
.tv-main-sm { max-width: 960px; }
.tv-main-xs { max-width: 680px; }
.tv-grid-2 { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.tv-grid-telemetry { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.tv-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tv-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tv-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tv-row-between { justify-content: space-between; }
.tv-back { color: var(--tv-primary); text-decoration: none; font-weight: 700; font-size: 14px; }
.tv-back:hover { text-decoration: underline; }
.tv-muted { color: var(--tv-muted); }
.tv-hidden { display: none !important; }

/* 4. Header, brand, navigation, ticker --------------------------------------- */
.tv-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--tv-nav-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--tv-border);
}
.tv-nav {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.tv-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--tv-text);
    flex-shrink: 0;
}
.tv-brand img { width: 38px; height: 38px; display: block; }
.tv-wordmark { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.4px; line-height: 1; color: var(--tv-text); }
.tv-wordmark b {
    font-weight: 800;
    background: var(--tv-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.tv-slogan-mini { display: block; margin-top: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--tv-muted); }

.tv-menu { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tv-link {
    color: var(--tv-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.tv-link:hover { color: var(--tv-text); background: rgba(59, 130, 246, 0.12); }
.tv-link.active { color: var(--tv-text); background: rgba(59, 130, 246, 0.18); box-shadow: inset 0 -2px 0 var(--tv-primary); }
.tv-link-admin { color: var(--tv-accent-text); }
.tv-icon-btn {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 6px;
}
.tv-burger {
    display: none;
    margin-left: auto;
    width: 42px; height: 42px;
    align-items: center; justify-content: center;
    background: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

/* Moving text: "Update your profile for more openings" (right to left) */
.tv-ticker {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    max-width: 430px;
    height: 36px;
    margin: 0 8px;
    overflow: hidden;
    border-radius: 999px;
    text-decoration: none;
    color: #FBBF24;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.55);
}
.tv-ticker-track {
    flex: none;
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;               /* start just outside the right edge */
    font-size: 13.5px;
    font-weight: 700;
    animation: tv-marquee 14s linear infinite;
    will-change: transform;
}
.tv-ticker:hover .tv-ticker-track,
.tv-ticker:focus-visible .tv-ticker-track { animation-play-state: paused; }
@keyframes tv-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }   /* scroll fully out on the left */
}
[data-theme="light"] .tv-ticker { color: #B45309; }

/* 5. Buttons ----------------------------------------------------------------- */
.tv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}
.tv-btn:hover { transform: translateY(-1px); }
.tv-btn-primary { background: var(--tv-gradient); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
.tv-btn-success { background: linear-gradient(135deg, #22C55E, #16A34A); color: #fff; box-shadow: 0 6px 18px rgba(34, 197, 94, 0.3); }
.tv-btn-danger  { background: var(--tv-danger); color: #fff; }
.tv-btn-ghost   { background: transparent; border-color: var(--tv-border); color: var(--tv-text); }
.tv-btn-soft    { background: rgba(59, 130, 246, 0.14); border-color: rgba(59, 130, 246, 0.35); color: var(--tv-accent-text); }
.tv-btn-soft-danger  { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.35); color: #FCA5A5; }
.tv-btn-soft-success { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.4); color: #4ADE80; }
.tv-btn-block { width: 100%; }
.tv-btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.tv-btn-soft:hover { background: var(--tv-primary-strong); color: #fff; }
.tv-btn-soft-danger:hover { background: var(--tv-danger); color: #fff; }
.tv-btn-soft-success:hover { background: #16A34A; color: #fff; }
[data-portal="recruiter"] .tv-btn-primary.tv-btn-portal { background: linear-gradient(135deg, #8B5CF6, #4F46E5); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35); }
[data-portal="admin"] .tv-btn-primary.tv-btn-portal { background: linear-gradient(135deg, #F59E0B, #D97706); box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35); }

/* 6. Cards and stat tiles ---------------------------------------------------- */
.tv-card {
    background: var(--tv-surface);
    border: 1px solid var(--tv-border);
    border-radius: var(--tv-radius);
    padding: 24px;
    box-shadow: var(--tv-shadow);
    min-width: 0;
}
.tv-card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 16px; font-weight: 800; }
.tv-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tv-card-head .tv-card-title { margin-bottom: 0; }
.tv-lead { color: var(--tv-muted); font-size: 13.5px; margin-bottom: 16px; line-height: 1.6; }
.tv-page-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }

.tv-welcome {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 28px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 55%, #0E7490 120%);
    border: 1px solid var(--tv-border);
}
.tv-welcome h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.tv-welcome p { color: #CBD5E1; font-size: 14px; }

.tv-stat { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: 18px; min-width: 0; }
.tv-stat-icon { flex: none; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 14px; font-size: 24px; background: rgba(59, 130, 246, 0.14); }
.tv-stat h4 { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--tv-muted); margin-bottom: 4px; }
.tv-stat p { font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }

/* 7. Forms ------------------------------------------------------------------- */
.tv-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.tv-field > label { font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--tv-muted); }
.tv-field input:not([type="checkbox"]):not([type="file"]),
.tv-field textarea,
.tv-field select {
    width: 100%;
    padding: 12px 14px;
    background: var(--tv-input-bg);
    color: var(--tv-text);
    border: 1px solid var(--tv-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tv-field input[type="file"] { padding: 10px; background: var(--tv-input-bg); border: 1px dashed var(--tv-border); border-radius: 10px; cursor: pointer; width: 100%; }
.tv-field input:focus, .tv-field textarea:focus, .tv-field select:focus { border-color: var(--tv-primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.tv-field textarea { resize: vertical; min-height: 90px; }
.tv-field small, .tv-hint { color: var(--tv-muted); font-size: 11.5px; line-height: 1.5; }
.tv-error-text { color: #FCA5A5; font-size: 12px; }
.tv-pw { position: relative; display: flex; align-items: center; }
.tv-pw input { padding-right: 46px !important; }
.tv-pw button { position: absolute; right: 8px; background: none; border: 0; cursor: pointer; font-size: 16px; padding: 6px; color: var(--tv-muted); }
.tv-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.tv-check input { width: 18px; height: 18px; cursor: pointer; }
.tv-field > label.tv-check { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 500; color: var(--tv-text); }
.tv-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.tv-span-2 { grid-column: span 2; }
.tv-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tv-form-actions .tv-btn-primary, .tv-form-actions .tv-btn-success { flex: 1; }

/* 8. Badges, chips, alerts --------------------------------------------------- */
.tv-badge { display: inline-block; padding: 3px 10px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tv-badge-admin     { background: rgba(59, 130, 246, 0.18); color: var(--tv-accent-text); border-color: rgba(59, 130, 246, 0.4); }
.tv-badge-recruiter { background: rgba(168, 85, 247, 0.18); color: #C084FC; border-color: rgba(168, 85, 247, 0.4); }
.tv-badge-user      { background: rgba(148, 163, 184, 0.15); color: var(--tv-muted); border-color: var(--tv-border); }
.tv-badge-new       { background: rgba(59, 130, 246, 0.15); color: var(--tv-accent-text); border-color: rgba(59, 130, 246, 0.3); margin-left: 8px; font-size: 11px; }
.tv-badge-match     { background: rgba(34, 197, 94, 0.15); color: #22C55E; border-color: rgba(34, 197, 94, 0.3); padding: 6px 14px; font-weight: 800; }
.tv-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tv-chip { padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.28); color: var(--tv-accent-text); }
.tv-chip-ok   { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.28); color: #22C55E; padding: 3px 10px; font-size: 11.5px; }
.tv-chip-warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: #F59E0B; padding: 4px 12px; font-size: 12px; }
.tv-alert { padding: 12px 16px; margin-bottom: 16px; border: 1px solid; border-radius: 10px; font-size: 13.5px; }
.tv-alert-error   { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.45); color: #FCA5A5; }
.tv-alert-success { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.4); color: #86EFAC; }
.tv-alert-info    { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.4); color: #93C5FD; }
[data-theme="light"] .tv-alert-error   { color: #B91C1C; }
[data-theme="light"] .tv-alert-success { color: #15803D; }
[data-theme="light"] .tv-alert-info    { color: #1D4ED8; }
[data-theme="light"] .tv-badge-admin, [data-theme="light"] .tv-chip, [data-theme="light"] .tv-btn-soft { color: #1D4ED8; }
.tv-empty { padding: 28px; text-align: center; color: var(--tv-muted); border: 1px dashed var(--tv-border); border-radius: 14px; font-size: 14px; }


/* Light theme: pale "dark mode" status colours are replaced by stronger ones for contrast */
[data-theme="light"] .tv-btn-soft-success, [data-theme="light"] .tv-chip-ok, [data-theme="light"] .tv-badge-match { color: #15803D; }
[data-theme="light"] .tv-btn-soft-danger, [data-theme="light"] .tv-error-text { color: #B91C1C; }
[data-theme="light"] .tv-chip-warn { color: #B45309; }
[data-theme="light"] .tv-badge-recruiter { color: #7E22CE; }
[data-theme="light"] .tv-session-pill { color: #15803D; }
[data-theme="light"] .tv-link-admin { color: #1D4ED8; }

/* 9. Tables (turn into stacked cards on small screens) ------------------------ */
.tv-table-wrap { width: 100%; overflow-x: auto; }
.tv-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.tv-table th { padding: 12px 16px; background: var(--tv-surface-2); color: var(--tv-muted); border-bottom: 1px solid var(--tv-border); font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.tv-table td { padding: 14px 16px; border-bottom: 1px solid var(--tv-border); vertical-align: middle; overflow-wrap: anywhere; }
.tv-table .tv-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tv-inline-form { display: inline-flex; gap: 8px; align-items: center; }
.tv-inline-form select { padding: 6px 10px; font-size: 12.5px; background: var(--tv-input-bg); color: var(--tv-text); border: 1px solid var(--tv-border); border-radius: 8px; }

/* 10. Authentication pages ---------------------------------------------------- */
.tv-auth-body {
    min-height: 100vh;
    padding: 24px;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1100px 560px at 8% -8%, rgba(37, 99, 235, 0.28), transparent),
        radial-gradient(900px 480px at 100% 110%, rgba(6, 182, 212, 0.2), transparent),
        var(--tv-bg);
}
.tv-auth {
    width: 1040px;
    max-width: 100%;
    min-height: 640px;
    display: flex;
    overflow: hidden;
    border: 1px solid var(--tv-border);
    border-radius: 24px;
    background: var(--tv-surface);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
}
.tv-auth-hero {
    flex: 1.05;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    color: #fff;
    background: var(--tv-hero, var(--tv-gradient));
    position: relative;
    overflow: hidden;
}
.tv-auth-hero::after {   /* soft decorative glow */
    content: "";
    position: absolute; right: -120px; bottom: -120px;
    width: 340px; height: 340px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}
.tv-auth-hero .tv-brand, .tv-auth-hero .tv-wordmark { color: #fff; }
.tv-auth-hero .tv-brand img { width: 48px; height: 48px; }
.tv-auth-hero .tv-wordmark { font-size: 26px; }
.tv-auth-hero .tv-wordmark b { background: none; -webkit-text-fill-color: #FDE68A; color: #FDE68A; }
.tv-auth-hero .tv-slogan-mini { color: rgba(255, 255, 255, 0.75); }
.tv-pill { display: inline-block; margin-bottom: 14px; padding: 5px 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; background: rgba(255, 255, 255, 0.14); }
.tv-hero-copy h1 { font-size: 32px; line-height: 1.2; font-weight: 800; margin-bottom: 14px; }
.tv-hero-copy p { color: rgba(255, 255, 255, 0.85); font-size: 14.5px; line-height: 1.65; }
.tv-hero-list { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.tv-hero-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, 0.92); }
.tv-hero-list li::before { content: "\2713"; flex: none; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.tv-hero-slogan { font-size: 12.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); position: relative; z-index: 1; }
.tv-auth-form { flex: 1; min-width: 0; padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; }
.tv-auth-top { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.tv-auth-form h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.tv-auth-form .tv-lead { margin-bottom: 20px; }
.tv-portal-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 12px; }
.tv-portal-tabs a { padding: 9px 6px; text-align: center; font-size: 13px; font-weight: 700; color: var(--tv-muted); text-decoration: none; border-radius: 9px; transition: background 0.2s, color 0.2s; }
.tv-portal-tabs a:hover { color: var(--tv-text); }
.tv-portal-tabs a.active { background: var(--tv-portal, var(--tv-primary)); color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.tv-auth-links { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 20px; font-size: 13px; }
.tv-auth-links a { font-weight: 600; text-decoration: none; }
.tv-auth-links a:hover { text-decoration: underline; }
.tv-auth-foot { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--tv-muted); }
.tv-auth-foot a { font-weight: 700; text-decoration: none; }
.tv-connect { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--tv-border); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tv-connect-label { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--tv-muted); }
.tv-auth-copy { margin-top: 20px; font-size: 12px; color: var(--tv-muted); text-align: center; }
.tv-error-card { width: 520px; max-width: 100%; padding: 40px 32px; text-align: center; background: var(--tv-surface); border: 1px solid var(--tv-border); border-radius: 22px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55); }
.tv-error-card .tv-brand { margin-bottom: 22px; }
.tv-error-code { font-size: 52px; line-height: 1; margin-bottom: 12px; }
.tv-error-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.tv-error-ref { margin: 14px 0 22px; font-size: 12px; color: var(--tv-muted); }

/* 11. Social icons and WhatsApp ---------------------------------------------- */
.tv-social-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.tv-social {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--tv-muted);
    background: var(--tv-surface-2);
    border: 1px solid var(--tv-border);
    border-radius: 50%;
    transition: transform 0.15s, color 0.15s, background 0.15s, border-color 0.15s;
}
.tv-social svg { width: 18px; height: 18px; fill: currentColor; }
.tv-social:hover { transform: translateY(-2px); color: #fff; }
.tv-social-linkedin:hover  { background: #0A66C2; border-color: #0A66C2; }
.tv-social-twitter:hover   { background: #111111; border-color: #111111; }
.tv-social-facebook:hover  { background: #1877F2; border-color: #1877F2; }
.tv-social-instagram:hover { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); border-color: #DD2A7B; }
.tv-social-youtube:hover   { background: #FF0000; border-color: #FF0000; }
.tv-social-github:hover    { background: #333333; border-color: #333333; }
.tv-social-whatsapp:hover  { background: #25D366; border-color: #25D366; }
.tv-wa-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; background: #25D366; color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35); }
.tv-wa-btn svg { width: 18px; height: 18px; fill: #fff; }
.tv-wa-btn:hover { background: #1EBE5A; }
.tv-wa-fab { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #25D366; box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45); transition: transform 0.15s; }
.tv-wa-fab:hover { transform: scale(1.07); }
.tv-wa-fab svg { width: 30px; height: 30px; fill: #fff; }

/* 12. Footer ------------------------------------------------------------------ */
.tv-footer { margin-top: auto; background: var(--tv-surface-2); border-top: 1px solid var(--tv-border); }
.tv-footer-inner { max-width: 1440px; margin: 0 auto; padding: 22px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tv-footer .tv-brand img { width: 30px; height: 30px; }
.tv-footer .tv-wordmark { font-size: 17px; }
.tv-footer-copy { font-size: 12.5px; color: var(--tv-muted); }

/* 13. Page specific components ------------------------------------------------ */
/* Profile card (dashboard) */
.tv-profile-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 30px 26px; }
.tv-edit-btn { position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 50%; cursor: pointer; font-size: 15px; }
.tv-edit-btn:hover { background: var(--tv-primary-strong); color: #fff; }
.tv-avatar { width: 96px; height: 96px; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.15); border-radius: 50%; background: var(--tv-gradient); color: #fff; font-size: 32px; font-weight: 800; }
.tv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tv-avatar-sm { width: 60px; height: 60px; flex: none; margin: 0; font-size: 20px; border-width: 2px; }
.tv-avatar-lg { width: 84px; height: 84px; flex: none; margin: 0; font-size: 28px; }
.tv-profile-card h2 { font-size: 21px; font-weight: 800; margin-bottom: 2px; overflow-wrap: anywhere; }
.tv-profile-card .tv-role-line { color: var(--tv-muted); font-size: 13.5px; margin-bottom: 14px; }
.tv-session-pill { margin-bottom: 20px; padding: 5px 14px; font-size: 12px; font-weight: 700; color: #22C55E; background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.28); border-radius: 999px; }
.tv-details { width: 100%; padding-top: 18px; border-top: 1px solid var(--tv-border); display: flex; flex-direction: column; gap: 14px; text-align: left; font-size: 13.5px; }
.tv-detail-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tv-detail-row span:first-child { color: var(--tv-muted); font-weight: 500; }
.tv-detail-row span:last-child { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.tv-inline-edit { display: none; width: 100%; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--tv-border); text-align: left; }
.tv-inline-edit.open { display: block; }
.tv-inline-edit .tv-field { margin-bottom: 12px; }

/* Progress bar */
.tv-progress { width: 100%; height: 10px; margin-bottom: 16px; overflow: hidden; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 999px; }
.tv-progress > div { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.tv-progress .good { background: linear-gradient(90deg, #22C55E, #16A34A); }
.tv-progress .mid  { background: linear-gradient(90deg, #F59E0B, #D97706); }
.tv-progress .low  { background: linear-gradient(90deg, #EF4444, #DC2626); }
.tv-pct { padding: 4px 12px; font-size: 13px; font-weight: 800; color: var(--tv-accent-text); background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 999px; }
.tv-mini-label { margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--tv-muted); }

/* Job rows (dashboard) and job cards (openings) */
.tv-job-list { display: flex; flex-direction: column; gap: 12px; }
.tv-job-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; color: inherit; text-decoration: none; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.tv-job-row:hover, .tv-job-card:hover { border-color: var(--tv-primary); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12); }
.tv-job-main { min-width: 0; }
.tv-job-main h4, .tv-job-card h3 { margin-bottom: 4px; font-size: 16px; font-weight: 800; color: var(--tv-accent-text); }
.tv-job-meta { margin-bottom: 8px; font-size: 12.5px; color: var(--tv-muted); }
.tv-job-desc { font-size: 13.5px; line-height: 1.55; color: var(--tv-muted); }
.tv-job-card { position: relative; padding: 22px; cursor: pointer; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.tv-job-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; z-index: 2; }
.tv-job-card .tv-job-head { padding-right: 130px; }
.tv-drawer { max-height: 0; margin-top: 0; overflow: hidden; border-top: 0 solid var(--tv-border); transition: max-height 0.3s ease-out, margin-top 0.3s ease-out; }
.tv-job-card.expanded .tv-drawer { max-height: 700px; margin-top: 14px; padding-top: 14px; border-top-width: 1px; }
.tv-drawer p { white-space: pre-line; font-size: 13.5px; line-height: 1.6; color: var(--tv-muted); }
.tv-toggle-text { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--tv-primary); }
.tv-admin-box { margin-bottom: 26px; padding: 22px; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 16px; }
.tv-admin-box h3 { margin-bottom: 14px; font-size: 16px; font-weight: 800; color: var(--tv-accent-text); }

/* Candidate search */
.tv-search { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.tv-search input[type="text"] { flex: 1 1 260px; min-width: 0; padding: 12px 16px; background: var(--tv-input-bg); color: var(--tv-text); border: 1px solid var(--tv-border); border-radius: 10px; outline: none; }
.tv-search input[type="text"]:focus { border-color: var(--tv-primary); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.tv-candidate-list { display: flex; flex-direction: column; gap: 14px; }
.tv-candidate { display: flex; align-items: center; gap: 18px; padding: 18px 20px; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 16px; transition: border-color 0.2s, box-shadow 0.2s; }
.tv-candidate:hover { border-color: var(--tv-primary); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12); }
.tv-candidate-info { flex: 1; min-width: 0; }
.tv-candidate-info h3 { margin-bottom: 2px; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.tv-candidate-role { margin-bottom: 6px; font-size: 13.5px; font-weight: 600; color: var(--tv-accent-text); }
.tv-candidate-meta { margin-bottom: 8px; font-size: 12.5px; color: var(--tv-muted); overflow-wrap: anywhere; }
.tv-candidate-actions { display: flex; flex-direction: column; gap: 8px; min-width: 170px; }
.tv-no-resume { padding: 8px 14px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--tv-muted); border: 1px dashed var(--tv-border); border-radius: 10px; }

/* Biodata rows (profile + candidate profile) */
.tv-profile-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--tv-border); }
.tv-profile-id { display: flex; align-items: center; gap: 20px; min-width: 0; }
.tv-profile-id h2 { font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.tv-profile-id p { font-weight: 600; color: var(--tv-accent-text); }
.tv-bio-box { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 16px; }
.tv-bio-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--tv-border); border-radius: 10px; background: rgba(255, 255, 255, 0.015); }
.tv-bio-row.stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.tv-bio-label { min-width: 150px; font-weight: 600; color: var(--tv-muted); }
.tv-bio-value { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.tv-bio-row.stack .tv-bio-value { text-align: left; font-weight: 500; line-height: 1.6; color: var(--tv-muted); }

/* Live telemetry (admin) */
.tv-health { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 12px; }
.tv-health span { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--tv-muted); }
.tv-health strong { font-size: 14px; text-align: right; }
.tv-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tv-metric { padding: 16px; text-align: center; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 12px; }
.tv-metric span { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--tv-muted); }
.tv-metric strong { font-size: 15px; font-weight: 800; }
.tv-updated { margin-top: 14px; text-align: right; font-size: 11px; color: var(--tv-muted); }

/* 14. Responsive breakpoints --------------------------------------------------- */
@media (max-width: 1100px) {
    .tv-grid-2, .tv-grid-telemetry { grid-template-columns: minmax(0, 1fr); }
    .tv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {                /* save space: the slogan is shown in the footer and on the login page */
    .tv-header .tv-slogan-mini { display: none; }
}

@media (max-width: 1100px) {                /* collapse the navigation into the hamburger menu */
    .tv-nav { flex-wrap: wrap; padding: 10px 16px; }
    .tv-burger { display: inline-flex; }
    .tv-menu {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        margin: 0; padding: 12px 16px 16px;
        background: var(--tv-surface);
        border-bottom: 1px solid var(--tv-border);
        box-shadow: 0 18px 30px rgba(0, 0, 0, 0.3);
    }
    .tv-menu.open { display: flex; }
    .tv-link { padding: 12px 14px; }
    .tv-menu .tv-icon-btn { margin: 6px 0; align-self: flex-start; }
    .tv-menu .tv-btn { width: 100%; }
    .tv-ticker { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
}

@media (max-width: 960px) {                 /* tablet */
    .tv-main { padding: 24px 20px 40px; }
}

@media (max-width: 820px) {                 /* tablet / phone: stack the auth card */
    .tv-auth-body { padding: 14px; justify-content: flex-start; }
    .tv-auth { flex-direction: column; min-height: 0; border-radius: 20px; }
    .tv-auth-hero { flex: none; padding: 22px 24px; gap: 10px; }
    .tv-hero-copy h1 { margin-bottom: 0; font-size: 22px; }
    .tv-hero-copy p, .tv-hero-list, .tv-hero-slogan { display: none; }
    .tv-pill { margin-bottom: 8px; }
    .tv-auth-hero .tv-brand img { width: 40px; height: 40px; }
    .tv-auth-hero .tv-wordmark { font-size: 22px; }
    .tv-auth-form { flex: none; padding: 24px 22px 28px; }
}

@media (max-width: 720px) {                 /* phone */
    body { font-size: 14.5px; }
    .tv-main { padding: 18px 14px 36px; gap: 18px; }
    .tv-card { padding: 18px; border-radius: 14px; }
    .tv-stats, .tv-stats-3 { grid-template-columns: minmax(0, 1fr); }
    .tv-form-grid { grid-template-columns: minmax(0, 1fr); }
    .tv-span-2 { grid-column: auto; }
    .tv-field input:not([type="checkbox"]):not([type="file"]), .tv-field textarea, .tv-field select, .tv-search input[type="text"] { font-size: 16px; }
    .tv-welcome { padding: 20px; }
    .tv-welcome h1 { font-size: 20px; }
    .tv-job-row { flex-direction: column; align-items: flex-start; }
    .tv-job-card .tv-job-head { padding-right: 0; }
    .tv-job-actions { position: static; margin-bottom: 12px; }
    .tv-candidate { flex-direction: column; align-items: flex-start; }
    .tv-candidate-actions { width: 100%; }
    .tv-profile-id { flex-direction: column; align-items: flex-start; }
    .tv-bio-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .tv-bio-value { text-align: left; }
    .tv-metric-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .tv-footer-inner { flex-direction: column; text-align: center; padding: 20px 16px; }
    .tv-wa-fab { display: none; }   /* the page already offers a WhatsApp button and icon */

    /* tables become stacked cards; each cell shows its column name from data-label */
    .tv-table thead { display: none; }
    .tv-table, .tv-table tbody, .tv-table tr, .tv-table td { display: block; width: 100%; }
    .tv-table tr { margin-bottom: 12px; padding: 8px 14px; background: var(--tv-surface-2); border: 1px solid var(--tv-border); border-radius: 12px; }
    .tv-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border: 0; text-align: right; }
    .tv-table td::before { content: attr(data-label); flex: none; font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--tv-muted); text-align: left; }
    .tv-table td.tv-cell-actions { flex-direction: column; align-items: stretch; }
    .tv-table td.tv-cell-actions::before { margin-bottom: 4px; }
    .tv-table .tv-actions { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .tv-wordmark { font-size: 19px; }
    .tv-slogan-mini { display: none; }
    .tv-auth-form { padding: 22px 16px 26px; }
    .tv-auth-hero { padding: 20px 18px; }
    .tv-portal-tabs a { font-size: 12.5px; padding: 9px 2px; }
    .tv-metric-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 15. Accessibility / reduced motion ------------------------------------------- */
:focus-visible { outline: 2px solid var(--tv-primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
    .tv-ticker-track { animation: none; padding-left: 16px; overflow: hidden; text-overflow: ellipsis; }
}
