/* ==========================================================================
   TalentFlow — ATS design system
   One stylesheet for the whole application. Replaces site.css, style.css,
   theme.css, leftnav.css and modern-theme.css. Layered on Bootstrap 5.
   Sections: 1 tokens · 2 base · 3 shell · 4 page header · 5 cards
   6 buttons · 7 forms · 8 tables & lists · 9 badges & status · 10 feedback
   11 overlays · 12 navigation widgets · 13 recruitment components
   14 auth & public pages · 15 legacy aliases · 16 utilities · 17 responsive
   ========================================================================== */

/* 1. TOKENS ================================================================ */
:root {
    /* Brand: indigo -> violet "talent" gradient, with teal as the hire colour */
    --ats-brand-50:  #eef2ff;
    --ats-brand-100: #e0e7ff;
    --ats-brand-200: #c7d2fe;
    --ats-brand-400: #818cf8;
    --ats-brand-500: #6366f1;
    --ats-brand-600: #4f46e5;
    --ats-brand-700: #4338ca;
    --ats-brand-900: #1e1b4b;
    --ats-violet-500: #8b5cf6;
    --ats-violet-600: #7c3aed;
    --ats-teal-500: #14b8a6;
    --ats-teal-600: #0d9488;

    --ats-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #a855f7 100%);
    --ats-gradient-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    --ats-gradient-hire: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    --ats-gradient-sidebar: linear-gradient(180deg, #111034 0%, #1e1b4b 55%, #2e1065 100%);

    /* Neutrals (slate) */
    --ats-canvas: #f4f6fb;
    --ats-surface: #ffffff;
    --ats-surface-2: #f8fafc;
    --ats-border: #e6e9f2;
    --ats-border-strong: #d4d9e6;
    --ats-text: #0f172a;
    --ats-text-2: #334155;
    --ats-muted: #64748b;
    --ats-subtle: #94a3b8;

    /* Feedback */
    --ats-success: #059669;  --ats-success-bg: #ecfdf5;
    --ats-warning: #b45309;  --ats-warning-bg: #fffbeb;
    --ats-danger:  #dc2626;  --ats-danger-bg:  #fef2f2;
    --ats-info:    #0369a1;  --ats-info-bg:    #f0f9ff;

    /* Hiring pipeline stage colours */
    --stage-new: #64748b;
    --stage-screen: #0ea5e9;
    --stage-short: #6366f1;
    --stage-interview: #8b5cf6;
    --stage-offer: #f59e0b;
    --stage-hired: #10b981;
    --stage-rejected: #ef4444;
    --stage-hold: #a16207;

    /* Type */
    --ats-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --ats-font-display: "Plus Jakarta Sans", "Inter", "Segoe UI", system-ui, sans-serif;
    --ats-fs-xs: .75rem; --ats-fs-sm: .8125rem; --ats-fs-base: .875rem;
    --ats-fs-md: 1rem; --ats-fs-lg: 1.125rem; --ats-fs-xl: 1.375rem; --ats-fs-2xl: 1.75rem;

    /* Shape & depth */
    --ats-radius-sm: 8px; --ats-radius: 12px; --ats-radius-lg: 16px; --ats-radius-pill: 999px;
    --ats-shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --ats-shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --ats-shadow-md: 0 8px 24px -8px rgba(15, 23, 42, .12), 0 2px 6px rgba(15, 23, 42, .04);
    --ats-shadow-lg: 0 24px 48px -16px rgba(30, 27, 75, .25);
    --ats-ring: 0 0 0 4px rgba(99, 102, 241, .18);

    /* Layout */
    --ats-sidebar-w: 268px;
    --ats-sidebar-w-collapsed: 80px;
    --ats-topbar-h: 64px;
    --ats-ease: cubic-bezier(.2, .8, .2, 1);
    --ats-t: .2s var(--ats-ease);

    /* Legacy variables still referenced by some views' inline styles */
    --primary-color: var(--ats-brand-600);
    --primary: var(--ats-brand-600);
    --primary-soft-bg: var(--ats-brand-50);
    --border-color: var(--ats-border);

    /* Bootstrap bridge */
    --bs-primary: #4f46e5; --bs-primary-rgb: 79, 70, 229;
    --bs-body-font-family: var(--ats-font);
    --bs-body-color: var(--ats-text);
    --bs-body-bg: var(--ats-canvas);
    --bs-border-color: var(--ats-border);
    --bs-link-color: var(--ats-brand-600); --bs-link-hover-color: var(--ats-brand-700);
    --bs-border-radius: var(--ats-radius-sm);
}

/* 2. BASE ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--ats-font);
    font-size: var(--ats-fs-base);
    line-height: 1.55;
    color: var(--ats-text);
    background: var(--ats-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--ats-font-display); color: var(--ats-text); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--ats-fs-2xl); } h2 { font-size: var(--ats-fs-xl); } h3 { font-size: var(--ats-fs-lg); }
h4, h5 { font-size: var(--ats-fs-md); } h6 { font-size: var(--ats-fs-base); }
a { color: var(--ats-brand-600); text-decoration: none; transition: color var(--ats-t); }
a:hover { color: var(--ats-brand-700); }
hr { border-color: var(--ats-border); opacity: 1; }
::selection { background: var(--ats-brand-200); }
.text-muted { color: var(--ats-muted) !important; }
small, .small { font-size: var(--ats-fs-sm); }

/* 3. SHELL ================================================================ */
.ats-shell { display: flex; min-height: 100vh; }

.ats-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 1040;
    width: var(--ats-sidebar-w);
    display: flex; flex-direction: column;
    background: var(--ats-gradient-sidebar);
    color: #c7d2fe;
    transition: width var(--ats-t), transform var(--ats-t);
}
.ats-sidebar::after { /* subtle glow */
    content: ""; position: absolute; inset: auto -40% 0 auto; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(168, 85, 247, .25), transparent 70%);
    pointer-events: none;
}
.ats-brand {
    display: flex; align-items: center; gap: .75rem;
    height: var(--ats-topbar-h); padding: 0 1.25rem; flex-shrink: 0;
    color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.ats-brand:hover { color: #fff; }
.ats-brand-mark {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 1.1rem; color: #fff;
    background: var(--ats-gradient); box-shadow: 0 6px 16px -4px rgba(124, 58, 237, .6);
}
.ats-brand-name { font-family: var(--ats-font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; line-height: 1.1; }
.ats-brand-name small { display: block; font-family: var(--ats-font); font-weight: 500; font-size: .7rem; color: #a5b4fc; letter-spacing: .04em; text-transform: uppercase; }

.ats-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem 1.5rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.ats-nav-group + .ats-nav-group { margin-top: 1.1rem; }
.ats-nav-heading {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: .25rem .75rem .4rem; background: none; border: 0;
    font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #8b8fd6;
    cursor: pointer;
}
.ats-nav-heading .bi { transition: transform var(--ats-t); font-size: .7rem; }
.ats-nav-group.is-collapsed .ats-nav-heading .bi { transform: rotate(-90deg); }
.ats-nav-group.is-collapsed .ats-nav-list { display: none; }
.ats-nav-list { list-style: none; margin: 0; padding: 0; }
.ats-nav-link {
    position: relative; display: flex; align-items: center; gap: .75rem;
    padding: .55rem .75rem; margin: 2px 0; border-radius: 10px;
    color: #c7d2fe; font-weight: 500; font-size: .875rem; white-space: nowrap;
    transition: background var(--ats-t), color var(--ats-t);
}
.ats-nav-link .bi { font-size: 1.1rem; width: 1.25rem; text-align: center; flex-shrink: 0; opacity: .9; }
.ats-nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.ats-nav-link[aria-current="page"] {
    color: #fff; background: rgba(255, 255, 255, .12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.ats-nav-link[aria-current="page"]::before {
    content: ""; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 4px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #a78bfa, #6366f1);
}
.ats-sidebar-footer { padding: .9rem 1rem; border-top: 1px solid rgba(255, 255, 255, .06); flex-shrink: 0; }
.ats-role-chip {
    display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .65rem; border-radius: var(--ats-radius-pill);
    background: rgba(255, 255, 255, .08); color: #e0e7ff; font-size: .72rem; font-weight: 600; white-space: nowrap;
}

.ats-main { flex: 1; min-width: 0; margin-left: var(--ats-sidebar-w); display: flex; flex-direction: column; transition: margin var(--ats-t); }

.ats-topbar {
    position: sticky; top: 0; z-index: 1030;
    height: var(--ats-topbar-h); display: flex; align-items: center; gap: 1rem;
    padding: 0 1.75rem;
    background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--ats-border);
}
.ats-icon-btn {
    position: relative; display: inline-grid; place-items: center;
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
    background: transparent; color: var(--ats-text-2); font-size: 1.15rem;
    transition: background var(--ats-t), color var(--ats-t), border-color var(--ats-t);
}
.ats-icon-btn:hover { background: var(--ats-brand-50); color: var(--ats-brand-700); }
.ats-icon-btn .ats-dot {
    position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--ats-danger); color: #fff; font-size: .65rem; font-weight: 700; line-height: 18px; text-align: center;
    border: 2px solid #fff;
}
.ats-topbar-title { font-family: var(--ats-font-display); font-weight: 700; font-size: 1rem; color: var(--ats-text); margin: 0; }
.ats-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.ats-user-btn {
    display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .3rem .3rem;
    border-radius: var(--ats-radius-pill); border: 1px solid var(--ats-border); background: #fff;
    color: var(--ats-text); transition: box-shadow var(--ats-t), border-color var(--ats-t);
}
.ats-user-btn:hover { border-color: var(--ats-brand-200); box-shadow: var(--ats-shadow-sm); }
.ats-user-meta { line-height: 1.15; text-align: left; }
.ats-user-meta strong { display: block; font-size: .8125rem; }
.ats-user-meta span { font-size: .7rem; color: var(--ats-muted); }

.ats-content { flex: 1; padding: 1.75rem; max-width: 1600px; width: 100%; margin: 0 auto; }
.ats-content:focus { outline: none; }
.ats-footer { padding: 1rem 1.75rem; color: var(--ats-subtle); font-size: var(--ats-fs-xs); border-top: 1px solid var(--ats-border); background: var(--ats-surface); }

/* Collapsed sidebar (desktop) */
body.ats-sidebar-collapsed .ats-sidebar { width: var(--ats-sidebar-w-collapsed); }
body.ats-sidebar-collapsed .ats-main { margin-left: var(--ats-sidebar-w-collapsed); }
body.ats-sidebar-collapsed .ats-brand-name,
body.ats-sidebar-collapsed .ats-nav-heading,
body.ats-sidebar-collapsed .ats-nav-link span,
body.ats-sidebar-collapsed .ats-sidebar-footer .ats-role-text { display: none; }
body.ats-sidebar-collapsed .ats-nav-group.is-collapsed .ats-nav-list { display: block; }
body.ats-sidebar-collapsed .ats-nav-link { justify-content: center; padding: .65rem; }
body.ats-sidebar-collapsed .ats-brand { justify-content: center; padding: 0; }
body.ats-sidebar-collapsed .ats-sidebar-footer { text-align: center; }

.ats-backdrop { display: none; }

/* 4. PAGE HEADER ========================================================== */
.ats-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-title { font-family: var(--ats-font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; color: var(--ats-text); margin: 0 0 .25rem; }
.page-subtitle { color: var(--ats-muted); font-size: var(--ats-fs-base); margin: 0; }
.breadcrumb { font-size: var(--ats-fs-sm); margin-bottom: .5rem; --bs-breadcrumb-divider: "›"; }
.breadcrumb-item a { color: var(--ats-muted); }
.breadcrumb-item a:hover { color: var(--ats-brand-600); }
.breadcrumb-item.active { color: var(--ats-text-2); font-weight: 500; }

/* 5. CARDS ================================================================ */
.card, .table-card, .setting-card, .ats-card {
    background: var(--ats-surface); border: 1px solid var(--ats-border);
    border-radius: var(--ats-radius-lg); box-shadow: var(--ats-shadow-sm);
}
.card { overflow: hidden; }
.card-header, .generic-card-header {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.25rem; background: transparent; border-bottom: 1px solid var(--ats-border);
    font-family: var(--ats-font-display); font-weight: 700; font-size: .95rem; color: var(--ats-text);
}
.generic-card-header h1, .generic-card-header h2, .generic-card-header h3,
.generic-card-header h4, .generic-card-header h5, .generic-card-header h6 { margin: 0; font-size: .95rem; }
.card-body, .generic-card-body { padding: 1.25rem; }
.card-footer { background: var(--ats-surface-2); border-top: 1px solid var(--ats-border); padding: .9rem 1.25rem; }
.section-icon, .job-section-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: inline-grid; place-items: center; font-size: 1rem;
    color: var(--ats-brand-600); background: var(--ats-brand-50);
}
.generic-row { row-gap: .25rem; }

/* KPI / stat cards (card-mini is the scaffolded name) */
.card-mini, .ats-stat {
    position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    height: 100%; padding: 1.1rem 1.25rem; overflow: hidden;
    background: var(--ats-surface); border: 1px solid var(--ats-border); border-radius: var(--ats-radius-lg);
    box-shadow: var(--ats-shadow-sm); transition: transform var(--ats-t), box-shadow var(--ats-t);
}
.card-mini:hover, .ats-stat:hover { transform: translateY(-2px); box-shadow: var(--ats-shadow-md); }
.card-mini > i, .ats-stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    font-size: 1.25rem !important; color: #fff !important; background: var(--ats-gradient);
    box-shadow: 0 8px 16px -8px rgba(79, 70, 229, .7);
}
.ats-stat-label, .card-mini .text-muted.small { font-size: var(--ats-fs-xs) !important; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ats-muted) !important; }
.ats-stat-value, .card-mini .fs-4 { font-family: var(--ats-font-display); font-size: 1.6rem !important; font-weight: 800 !important; line-height: 1.1; color: var(--ats-text); }
.ats-stat-trend { font-size: var(--ats-fs-xs); color: var(--ats-muted); }
.ats-stat--teal .ats-stat-icon { background: var(--ats-gradient-hire); box-shadow: 0 8px 16px -8px rgba(13, 148, 136, .7); }
.ats-stat--amber .ats-stat-icon { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 8px 16px -8px rgba(245, 158, 11, .7); }
.ats-stat--sky .ats-stat-icon { background: linear-gradient(135deg, #0ea5e9, #6366f1); box-shadow: 0 8px 16px -8px rgba(14, 165, 233, .7); }
.ats-stat--rose .ats-stat-icon { background: linear-gradient(135deg, #f43f5e, #ec4899); box-shadow: 0 8px 16px -8px rgba(244, 63, 94, .7); }

/* Hero banner (dashboard greeting) */
.ats-hero {
    position: relative; overflow: hidden; border-radius: var(--ats-radius-lg);
    padding: 1.75rem 2rem; color: #fff; background: var(--ats-gradient); box-shadow: var(--ats-shadow-lg);
}
.ats-hero::after {
    content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 65%);
}
.ats-hero h1 { color: #fff; font-size: 1.6rem; margin: 0 0 .35rem; }
.ats-hero p { margin: 0; color: rgba(255, 255, 255, .85); }
.ats-hero .btn { position: relative; z-index: 1; }

/* 6. BUTTONS ============================================================== */
.btn {
    --bs-btn-font-weight: 600; --bs-btn-font-size: .85rem;
    --bs-btn-padding-x: 1rem; --bs-btn-padding-y: .5rem; --bs-btn-border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    transition: transform var(--ats-t), box-shadow var(--ats-t), background var(--ats-t), color var(--ats-t), border-color var(--ats-t);
}
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: .78rem; --bs-btn-border-radius: 8px; }
.btn-lg { --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .7rem; --bs-btn-font-size: .95rem; }
.btn-primary, .btn-primary-custom, .table-btn-primary, .btn-custom {
    color: #fff !important; border: 0 !important; background: var(--ats-gradient) !important;
    box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .8);
}
.btn-primary:hover, .btn-primary-custom:hover, .table-btn-primary:hover, .btn-custom:hover {
    color: #fff; box-shadow: 0 10px 22px -8px rgba(79, 70, 229, .9); filter: brightness(1.05);
}
.btn-success { background: var(--ats-gradient-hire); border: 0; }
.btn-outline-primary { --bs-btn-color: var(--ats-brand-600); --bs-btn-border-color: var(--ats-brand-200); --bs-btn-hover-bg: var(--ats-brand-50); --bs-btn-hover-color: var(--ats-brand-700); --bs-btn-hover-border-color: var(--ats-brand-400); --bs-btn-active-bg: var(--ats-brand-100); --bs-btn-active-color: var(--ats-brand-700); }
.btn-outline-secondary, .btn-light, .btn-outline-custom, .table-btn {
    color: var(--ats-text-2); background: #fff; border: 1px solid var(--ats-border-strong);
}
.btn-outline-secondary:hover, .btn-light:hover, .btn-outline-custom:hover, .table-btn:hover {
    color: var(--ats-brand-700); background: var(--ats-brand-50); border-color: var(--ats-brand-200);
}
.btn-outline-danger { --bs-btn-color: var(--ats-danger); --bs-btn-border-color: #fecaca; --bs-btn-hover-bg: var(--ats-danger); --bs-btn-hover-border-color: var(--ats-danger); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); border: 0; }
.btn-link { font-weight: 600; }
.table-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    height: 38px; padding: 0 .9rem; border-radius: 10px; font-size: .82rem; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: background var(--ats-t), color var(--ats-t), border-color var(--ats-t), box-shadow var(--ats-t);
}
.table-btn-clear { color: var(--ats-muted); }
.filter-arrow { transition: transform var(--ats-t); font-size: .75rem; }
.filter-collapse-btn[aria-expanded="true"] .filter-arrow { transform: rotate(180deg); }
.filter-collapse-btn[aria-expanded="true"] { color: var(--ats-brand-700); background: var(--ats-brand-50); border-color: var(--ats-brand-200); }
.filter-btn-group { display: flex; gap: .5rem; }

/* Icon actions in table rows */
.ats-row-actions, .action_icon { display: inline-flex; align-items: center; gap: .25rem; }
.ats-row-actions a, .ats-row-actions button, td .d-flex > a[aria-label], .action_icon a {
    display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
    color: var(--ats-muted); background: transparent; border: 0; transition: background var(--ats-t), color var(--ats-t);
}
.ats-row-actions a:hover, td .d-flex > a[aria-label]:hover, .action_icon a:hover { background: var(--ats-brand-50); color: var(--ats-brand-700); }
td .d-flex > a.text-danger:hover, .ats-row-actions .is-danger:hover { background: var(--ats-danger-bg); color: var(--ats-danger) !important; }
td .d-flex.gap-3 { gap: .15rem !important; }

/* 7. FORMS ================================================================ */
label, .form-label, .generic-form-group > label, .table-filter-label {
    display: inline-block; margin-bottom: .4rem; font-size: .8rem; font-weight: 600; color: var(--ats-text-2);
}
.generic-form-group { margin-bottom: 1.1rem; }
.form-control, .form-select, .generic-input, .generic-select, .generic-textarea, .form-control-custom, .table-filter {
    display: block; width: 100%; min-height: 42px; padding: .55rem .85rem;
    font-size: var(--ats-fs-base); color: var(--ats-text); background-color: #fff;
    border: 1px solid var(--ats-border-strong); border-radius: 10px; box-shadow: var(--ats-shadow-xs);
    transition: border-color var(--ats-t), box-shadow var(--ats-t), background-color var(--ats-t);
}
.form-select, select.generic-select, select.table-filter {
    padding-right: 2.25rem; appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right .85rem center; background-size: 12px 10px;
}
textarea.form-control, .generic-textarea { min-height: 110px; resize: vertical; }
.form-control::placeholder, .generic-input::placeholder { color: var(--ats-subtle); }
.form-control:hover, .form-select:hover, .generic-input:hover, .generic-select:hover, .generic-textarea:hover { border-color: #b8c0d6; }
.form-control:focus, .form-select:focus, .generic-input:focus, .generic-select:focus, .generic-textarea:focus,
.form-control-custom:focus, .table-filter:focus {
    outline: 0; border-color: var(--ats-brand-500); box-shadow: var(--ats-ring);
}
.form-control:disabled, .form-control[readonly], .generic-input[readonly] { background: var(--ats-surface-2); color: var(--ats-muted); }
.form-control.is-invalid, .form-select.is-invalid, .is-invalid.generic-input, .is-invalid.generic-select, .is-invalid.generic-textarea,
.input-validation-error { border-color: var(--ats-danger) !important; box-shadow: 0 0 0 4px rgba(220, 38, 38, .1) !important; }
.field-validation-error, .text-danger.small, span[data-valmsg-for] { display: block; margin-top: .3rem; font-size: .78rem; font-weight: 500; color: var(--ats-danger); }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.form-check-input { width: 1.1em; height: 1.1em; border-color: var(--ats-border-strong); }
.form-check-input:checked { background-color: var(--ats-brand-600); border-color: var(--ats-brand-600); }
.form-check-input:focus { box-shadow: var(--ats-ring); border-color: var(--ats-brand-500); }
.form-switch .form-check-input { width: 2.2em; }
.form-text { color: var(--ats-muted); font-size: .78rem; }
.input-group-custom, .password-group { position: relative; }
.password-toggle { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ats-muted); cursor: pointer; }
.custom-control { display: flex; align-items: center; gap: .5rem; }
.input-group-text { background: var(--ats-surface-2); border-color: var(--ats-border-strong); color: var(--ats-muted); border-radius: 10px; }

/* Form layout used by all Create/Edit pages */
.ats-form-actions, .form-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: .6rem;
    margin: 1.5rem -1.25rem -1.25rem; padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--ats-border);
    border-radius: 0 0 var(--ats-radius-lg) var(--ats-radius-lg);
}

/* Profile / logo upload */
.profile-image-wrapper, .profile-upload { position: relative; display: inline-block; }
.profile-image {
    width: 110px; height: 110px; object-fit: cover; border-radius: 22px;
    border: 4px solid #fff; box-shadow: var(--ats-shadow-md); background: var(--ats-surface-2);
}
.upload-icon {
    position: absolute; right: -6px; bottom: -6px; width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; background: var(--ats-gradient); border: 3px solid #fff; cursor: pointer;
}

/* 8. TABLES & LISTS ======================================================= */
.table-card { overflow: hidden; }
.table-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--ats-border); }
.table-search { position: relative; max-width: 420px; }
.table-search .form-control, .ats-search .form-control { padding-left: 2.5rem; background: var(--ats-surface-2); }
.table-search .form-control:focus { background: #fff; }
.table-search > .bi, .ats-search > .bi { color: var(--ats-subtle); pointer-events: none; }
.table-filter-collapse { border-bottom: 1px solid var(--ats-border); }
.table-filter-collapse.mt-3 { margin-top: 0 !important; }
.table-filter-wrapper { padding: 1rem 1.25rem 1.25rem; background: var(--ats-surface-2); }
.ats-active-filters { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem 1.25rem; border-bottom: 1px solid var(--ats-border); }
.ats-active-filters:empty { display: none; }

.custom-scroll-table, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table, .custom-table { margin: 0; --bs-table-bg: transparent; --bs-table-hover-bg: #f8f9ff; color: var(--ats-text-2); }
.custom-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table > thead > tr > th, .custom-table thead th {
    position: sticky; top: 0; z-index: 1;
    padding: .75rem 1rem; background: var(--ats-surface-2); border-bottom: 1px solid var(--ats-border);
    font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ats-muted);
    white-space: nowrap; cursor: default;
}
.custom-table thead th.sorting, .custom-table thead th.sorting_asc, .custom-table thead th.sorting_desc { cursor: pointer; }
.custom-table thead th.sorting_asc, .custom-table thead th.sorting_desc { color: var(--ats-brand-700); }
.sort-icon { font-size: .65rem; opacity: .45; }
th.sorting_asc .sort-icon, th.sorting_desc .sort-icon { opacity: 1; color: var(--ats-brand-600); }
.table > tbody > tr > td, .custom-table tbody td {
    padding: .8rem 1rem; vertical-align: middle; border-bottom: 1px solid #eef1f6; font-size: .845rem;
}
.custom-table tbody tr { transition: background var(--ats-t); }
.custom-table tbody tr:hover { background: #f8f9ff; }
.custom-table tbody tr:last-child td { border-bottom: 0; }
.highlight-text { color: var(--ats-text); font-weight: 500; }
.ats-cell-clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ats-cell-primary { display: flex; align-items: center; gap: .75rem; min-width: 220px; }
.ats-cell-primary strong { display: block; color: var(--ats-text); font-weight: 600; }
.ats-cell-primary span { display: block; font-size: .78rem; color: var(--ats-muted); }
.ats-table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.25rem; border-top: 1px solid var(--ats-border); }

.pagination { gap: .25rem; margin: 0; }
.page-link {
    min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 .6rem;
    border-radius: 8px !important; border: 1px solid transparent; color: var(--ats-text-2); font-size: .8rem; font-weight: 600;
}
.page-link:hover { background: var(--ats-brand-50); color: var(--ats-brand-700); border-color: transparent; }
.page-item.active .page-link { background: var(--ats-gradient); color: #fff; border-color: transparent; box-shadow: 0 4px 10px -4px rgba(79, 70, 229, .7); }
.page-item.disabled .page-link { color: var(--ats-subtle); background: transparent; }
.page-link:focus { box-shadow: var(--ats-ring); }

.empty-state, .ats-empty { padding: 3rem 1.5rem; text-align: center; color: var(--ats-muted); }
.ats-empty-icon, .empty-state > .bi, .table-card .bi-inbox {
    display: inline-grid !important; place-items: center; width: 64px; height: 64px; margin-bottom: 1rem;
    border-radius: 18px; font-size: 1.75rem !important; color: var(--ats-brand-600) !important; background: var(--ats-gradient-soft);
}
.ats-empty h5, .empty-state h5 { color: var(--ats-text); }

/* Hide the DataTables chrome that ats-table.js renders itself (only on its tables) */
.ats-dt .dataTables_filter, .ats-dt .dataTables_length, .ats-dt .dataTables_info, .ats-dt .dataTables_paginate { display: none !important; }
/* Other DataTables (common.js data-datatable="true") keep their own controls, styled */
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 8px !important; border: 0 !important; padding: .3rem .65rem !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--ats-gradient) !important; color: #fff !important; }
.dataTables_wrapper .dataTables_filter input { border: 1px solid var(--ats-border-strong); border-radius: 10px; padding: .35rem .7rem; }
table.dataTable { border-collapse: separate !important; margin: 0 !important; }
table.dataTable thead .sorting::before, table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before, table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before, table.dataTable thead .sorting_desc::after { display: none !important; }
table.dataTable.no-footer { border-bottom: 0; }

/* 9. BADGES & STATUS ====================================================== */
.badge {
    display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .65rem; border-radius: var(--ats-radius-pill);
    font-size: .72rem; font-weight: 600; letter-spacing: .01em; line-height: 1.1;
}
.badge.green, .badge.bg-success, .badge-success { background: var(--ats-success-bg) !important; color: var(--ats-success) !important; }
.badge.red, .badge.bg-danger, .badge-danger { background: var(--ats-danger-bg) !important; color: var(--ats-danger) !important; }
.badge.yellow, .badge.bg-warning, .badge-warning { background: var(--ats-warning-bg) !important; color: var(--ats-warning) !important; }
.badge.blue, .badge.bg-info, .badge-info { background: var(--ats-info-bg) !important; color: var(--ats-info) !important; }
.badge.grey, .badge.bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.badge.bg-primary { background: var(--ats-brand-50) !important; color: var(--ats-brand-700) !important; }
.badge.green::before, .badge.red::before, .badge.yellow::before, .badge.blue::before, .badge.grey::before, .ats-stage::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
header .badge::before, .ats-dot::before { display: none; }

/* Pipeline stages */
.ats-stage { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: var(--ats-radius-pill); font-size: .74rem; font-weight: 600; background: #f1f5f9; color: var(--stage-new); white-space: nowrap; }
.ats-stage[data-stage="Screening"] { background: #f0f9ff; color: #0369a1; }
.ats-stage[data-stage="Shortlisted"] { background: #eef2ff; color: #4338ca; }
.ats-stage[data-stage="Interview Scheduled"], .ats-stage[data-stage="Interview Completed"] { background: #f5f3ff; color: #6d28d9; }
.ats-stage[data-stage="Selected"], .ats-stage[data-stage="Offered"] { background: #fffbeb; color: #b45309; }
.ats-stage[data-stage="Hired"] { background: #ecfdf5; color: #047857; }
.ats-stage[data-stage="Rejected"], .ats-stage[data-stage="Withdrawn"] { background: #fef2f2; color: #b91c1c; }
.ats-stage[data-stage="On Hold"] { background: #fefce8; color: #a16207; }

.ats-chip, .fd-chip, .suggestion-badge {
    display: inline-flex; align-items: center; gap: .35rem; padding: .28rem .6rem; border-radius: var(--ats-radius-pill);
    background: var(--ats-surface-2); border: 1px solid var(--ats-border); color: var(--ats-text-2); font-size: .75rem; font-weight: 500;
}
.ats-chip button { border: 0; background: none; padding: 0; color: var(--ats-muted); line-height: 1; }
.ats-chip--brand { background: var(--ats-brand-50); border-color: var(--ats-brand-100); color: var(--ats-brand-700); }

/* 10. FEEDBACK ============================================================ */
.alert { border: 1px solid transparent; border-radius: var(--ats-radius); padding: .85rem 1rem; font-size: .86rem; box-shadow: var(--ats-shadow-xs); }
.alert .bi { font-size: 1.05rem; margin-top: .05rem; }
.alert-success { background: var(--ats-success-bg); border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: var(--ats-danger-bg); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--ats-warning-bg); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--ats-info-bg); border-color: #bae6fd; color: #075985; }
#toast-container > div { border-radius: var(--ats-radius) !important; box-shadow: var(--ats-shadow-lg) !important; opacity: 1 !important; font-family: var(--ats-font); }
.progress { height: 8px; border-radius: var(--ats-radius-pill); background: #eef1f6; }
.progress-bar { background: var(--ats-gradient); border-radius: var(--ats-radius-pill); }

/* 11. OVERLAYS ============================================================ */
.modal-content { border: 0; border-radius: var(--ats-radius-lg); box-shadow: var(--ats-shadow-lg); overflow: hidden; }
.modal-header { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--ats-border); }
.modal-title { font-family: var(--ats-font-display); font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { padding: 1rem 1.4rem; border-top: 1px solid var(--ats-border); background: var(--ats-surface-2); gap: .5rem; }
.modal-backdrop.show { opacity: .45; background: #0f172a; }
.dropdown-menu { border: 1px solid var(--ats-border); border-radius: var(--ats-radius); box-shadow: var(--ats-shadow-lg); padding: .4rem; font-size: .86rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; display: flex; align-items: center; gap: .6rem; color: var(--ats-text-2); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--ats-brand-50); color: var(--ats-brand-700); }
.dropdown-item.text-danger:hover { background: var(--ats-danger-bg); }
.dropdown-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ats-subtle); }
.tooltip-inner { border-radius: 8px; background: var(--ats-text); font-size: .75rem; }

/* 12. NAVIGATION WIDGETS ================================================== */
.nav-tabs { border-bottom: 1px solid var(--ats-border); gap: .25rem; }
.nav-tabs .nav-link {
    border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
    padding: .75rem 1rem; color: var(--ats-muted); font-weight: 600; font-size: .85rem;
    display: inline-flex; align-items: center; gap: .45rem;
}
.nav-tabs .nav-link:hover { color: var(--ats-text); border-bottom-color: var(--ats-border-strong); }
.nav-tabs .nav-link.active { color: var(--ats-brand-700); border-bottom-color: var(--ats-brand-600); background: transparent; }
.nav-tabs .nav-link .ats-count { font-size: .7rem; padding: .1rem .45rem; border-radius: 99px; background: var(--ats-surface-2); color: var(--ats-muted); }
.nav-tabs .nav-link.active .ats-count { background: var(--ats-brand-50); color: var(--ats-brand-700); }
.nav-pills .nav-link { border-radius: 10px; color: var(--ats-text-2); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--ats-gradient); }
.accordion { --bs-accordion-border-color: var(--ats-border); --bs-accordion-border-radius: var(--ats-radius); --bs-accordion-active-bg: var(--ats-brand-50); --bs-accordion-active-color: var(--ats-brand-700); --bs-accordion-btn-focus-box-shadow: var(--ats-ring); }
.accordion-button { font-weight: 600; font-size: .9rem; }

/* 13. RECRUITMENT COMPONENTS ============================================== */
/* Avatars */
.ats-avatar, .ats-avatar-lg, .ats-avatar-sm {
    display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%;
    color: #fff; font-weight: 700; background: var(--ats-gradient); text-transform: uppercase;
}
.ats-avatar { width: 38px; height: 38px; font-size: .8rem; }
.ats-avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.ats-avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .8); border-radius: 22px; }
.ats-avatar[data-tone="1"] { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.ats-avatar[data-tone="2"] { background: var(--ats-gradient-hire); }
.ats-avatar[data-tone="3"] { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.ats-avatar[data-tone="4"] { background: linear-gradient(135deg, #ec4899, #8b5cf6); }

/* Definition list for details pages */
.ats-info-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.1rem 1.5rem; margin: 0; }
.ats-info-list dt, .preview-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ats-subtle); margin-bottom: .2rem; }
.ats-info-list dd, .preview-value { margin: 0; color: var(--ats-text); font-weight: 500; word-break: break-word; }
.ats-info-list dd:empty::after, .preview-value:empty::after { content: "—"; color: var(--ats-subtle); }
.preview-item { padding: .6rem 0; border-bottom: 1px dashed var(--ats-border); }

/* Timeline (activity & status history) */
.ats-timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 1.75rem; }
.ats-timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(180deg, var(--ats-brand-200), var(--ats-border)); }
.ats-timeline-item { position: relative; padding: 0 0 1.25rem; }
.ats-timeline-item:last-child { padding-bottom: 0; }
.ats-timeline-dot {
    position: absolute; left: -1.75rem; top: 0; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; font-size: .7rem; color: #fff; background: var(--ats-brand-500);
    border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ats-border);
}
.ats-timeline-dot[data-kind="status"] { background: var(--stage-interview); }
.ats-timeline-dot[data-kind="note"] { background: var(--stage-offer); }
.ats-timeline-dot[data-kind="interview"] { background: var(--stage-screen); }
.ats-timeline-dot[data-kind="document"] { background: var(--stage-hired); }
.ats-timeline-dot[data-kind="application"] { background: var(--ats-brand-600); }
.ats-timeline-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; }
.ats-timeline-title { font-weight: 600; color: var(--ats-text); }
.ats-timeline-meta { font-size: .75rem; color: var(--ats-muted); }
.ats-timeline-body { margin-top: .3rem; padding: .6rem .8rem; border-radius: 10px; background: var(--ats-surface-2); color: var(--ats-text-2); font-size: .84rem; white-space: pre-line; }
.ats-day-divider { margin: .25rem 0 1rem -1.75rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ats-subtle); }

/* Pipeline progress (stage stepper) */
.ats-pipeline { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ats-pipeline li { flex: 1; min-width: 0; }
.ats-pipeline-bar { height: 6px; border-radius: 99px; background: #e8ebf3; }
.ats-pipeline li.is-done .ats-pipeline-bar { background: var(--ats-brand-400); }
.ats-pipeline li.is-current .ats-pipeline-bar { background: var(--ats-gradient); box-shadow: 0 0 0 3px rgba(99, 102, 241, .15); }
.ats-pipeline li.is-rejected .ats-pipeline-bar { background: var(--stage-rejected); }
.ats-pipeline-label { margin-top: .4rem; font-size: .68rem; font-weight: 600; color: var(--ats-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ats-pipeline li.is-current .ats-pipeline-label { color: var(--ats-brand-700); }

/* Funnel / distribution rows */
.ats-funnel-row { display: grid; grid-template-columns: 140px 1fr 48px; align-items: center; gap: .75rem; padding: .4rem 0; font-size: .82rem; }
.ats-funnel-track { height: 10px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.ats-funnel-fill { height: 100%; border-radius: 99px; background: var(--ats-gradient); }

/* Document tiles */
.ats-doc { display: flex; align-items: center; gap: .85rem; padding: .8rem .9rem; border: 1px solid var(--ats-border); border-radius: var(--ats-radius); background: #fff; transition: border-color var(--ats-t), box-shadow var(--ats-t); }
.ats-doc:hover { border-color: var(--ats-brand-200); box-shadow: var(--ats-shadow-sm); }
.ats-doc-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; color: #dc2626; background: #fef2f2; flex-shrink: 0; }
.ats-doc-icon[data-ext="doc"], .ats-doc-icon[data-ext="docx"] { color: #2563eb; background: #eff6ff; }
.ats-doc-name { font-weight: 600; color: var(--ats-text); word-break: break-all; }
.ats-doc-meta { font-size: .75rem; color: var(--ats-muted); }

/* Q&A */
.ats-qa { padding: .9rem 0; border-bottom: 1px solid var(--ats-border); }
.ats-qa:last-child { border-bottom: 0; }
.ats-qa-q { font-weight: 600; color: var(--ats-text); margin-bottom: .3rem; display: flex; gap: .5rem; }
.ats-qa-a { color: var(--ats-text-2); padding-left: 1.6rem; white-space: pre-line; }
.ats-qa-a.is-empty { color: var(--ats-subtle); font-style: italic; }

/* Workspace (details) layout: sticky side column */
.ats-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.ats-workspace-side { position: sticky; top: calc(var(--ats-topbar-h) + 1.25rem); display: grid; gap: 1.25rem; }
.ats-profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; padding: 1.5rem; }
.ats-profile-head h1 { font-size: 1.5rem; margin: 0; }
.ats-profile-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-top: .45rem; color: var(--ats-muted); font-size: .84rem; }
.ats-profile-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.ats-profile-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.ats-section-title { font-family: var(--ats-font-display); font-size: .95rem; font-weight: 700; margin: 0; }
.ats-kv { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--ats-border); font-size: .84rem; }
.ats-kv:last-child { border-bottom: 0; }
.ats-kv span:first-child { color: var(--ats-muted); }
.ats-kv span:last-child { color: var(--ats-text); font-weight: 600; text-align: right; }
.ats-score-ring { --v: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ats-brand-600) calc(var(--v) * 1%), #e8ebf3 0); }
.ats-score-ring span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }

/* Job wizard sections (existing markup) */
.job-section { background: #fff; border: 1px solid var(--ats-border); border-radius: var(--ats-radius-lg); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--ats-shadow-xs); }
.job-section-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.job-section-title { font-family: var(--ats-font-display); font-weight: 700; font-size: 1rem; margin: 0; }
.job-section-sub { color: var(--ats-muted); font-size: .8rem; margin: 0; }

/* 14. AUTH & PUBLIC PAGES ================================================= */
.login-page {
    min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr);
    background: var(--ats-canvas);
}
.ats-auth-aside {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: 3rem; color: #fff; background: var(--ats-gradient-sidebar);
}
.ats-auth-aside::before, .ats-auth-aside::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none;
}
.ats-auth-aside::before { width: 480px; height: 480px; right: -160px; top: -120px; background: radial-gradient(circle, rgba(139, 92, 246, .55), transparent 65%); }
.ats-auth-aside::after { width: 420px; height: 420px; left: -140px; bottom: -160px; background: radial-gradient(circle, rgba(20, 184, 166, .35), transparent 65%); }
.ats-auth-aside > * { position: relative; z-index: 1; }
.ats-auth-aside h2 { color: #fff; font-size: 2.1rem; line-height: 1.15; letter-spacing: -.03em; max-width: 30ch; }
.ats-auth-aside p { color: #c7d2fe; max-width: 46ch; }
.ats-auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .75rem; }
.ats-auth-points li { display: flex; gap: .7rem; align-items: flex-start; color: #e0e7ff; }
.ats-auth-points .bi { color: #5eead4; font-size: 1.1rem; }
.ats-auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-card {
    width: 100%; max-width: 440px; padding: 2.25rem; background: #fff;
    border: 1px solid var(--ats-border); border-radius: 20px; box-shadow: var(--ats-shadow-lg);
}
.login-logo { display: block; height: 40px; width: auto; margin: 0 0 1.5rem; }
.login-title { font-family: var(--ats-font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .35rem; }
.login-subtitle { color: var(--ats-muted); margin-bottom: 1.5rem; }
.forgot-link { font-size: .82rem; font-weight: 600; }
.login-divider { position: relative; text-align: center; margin: 1.25rem 0; }
.login-divider::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--ats-border); }
.login-divider span { position: relative; padding: 0 .75rem; background: #fff; font-size: .75rem; color: var(--ats-subtle); text-transform: uppercase; letter-spacing: .08em; }
.sso-btn, .login-card .btn-outline-secondary { width: 100%; height: 44px; }
.sso-icon { width: 18px; height: 18px; }
.login-card .btn-primary, .login-card .btn-primary-custom, .login-card button[type="submit"]:not(.btn-link):not(.password-toggle) { width: 100%; height: 46px; font-size: .92rem; }
.text-muted-custom { color: var(--ats-muted); }

/* Access denied / errors */
.card403 { max-width: 520px; margin: 4rem auto; padding: 2.5rem; text-align: center; background: #fff; border: 1px solid var(--ats-border); border-radius: 20px; box-shadow: var(--ats-shadow-md); }
.badge403, .shield-icon, .card403 .shield { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 1rem; border-radius: 22px; font-size: 2rem; color: #fff; background: linear-gradient(135deg, #f43f5e, #8b5cf6); }
.card403 .code { font-family: var(--ats-font-display); font-weight: 800; font-size: 2.5rem; letter-spacing: -.03em; background: var(--ats-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card403 .title { font-size: 1.25rem; font-weight: 700; }
.card403 .description { color: var(--ats-muted); }

/* Public apply success */
.apply-success-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--ats-gradient-soft); }
.success-icon { display: inline-grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; font-size: 2.25rem; color: #fff; background: var(--ats-gradient-hire); box-shadow: 0 16px 32px -12px rgba(13, 148, 136, .7); }
.success-message { color: var(--ats-text-2); }
.application-summary { background: var(--ats-surface-2); border: 1px solid var(--ats-border); border-radius: var(--ats-radius); padding: 1rem 1.25rem; }
.success-footer { color: var(--ats-muted); font-size: .8rem; }

/* 15. ACCESSIBILITY ======================================================= */
.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 2000; padding: .6rem 1rem; border-radius: 10px;
    background: var(--ats-brand-700); color: #fff; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: .75rem; color: #fff; }
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, .page-link:focus-visible {
    outline: 3px solid var(--ats-brand-500) !important; outline-offset: 2px; box-shadow: none;
}
.ats-sidebar a:focus-visible, .ats-sidebar button:focus-visible { outline-color: #c4b5fd !important; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* 16. UTILITIES =========================================================== */
.col-actions { width: 120px; }
.ats-soft-panel { background: var(--ats-brand-50); border: 1px solid var(--ats-brand-100); border-radius: var(--ats-radius); }
.ats-chip-toggle { display: inline-flex; width: auto; flex: 0 0 auto; cursor: pointer; }
.generic-textarea { min-height: 120px; }
.text-gradient { background: var(--ats-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fw-600 { font-weight: 600 !important; }
.ats-muted { color: var(--ats-muted); }
.ats-divider { height: 1px; background: var(--ats-border); margin: 1.25rem 0; }
.ui-datepicker { z-index: 2000 !important; border: 1px solid var(--ats-border) !important; border-radius: var(--ats-radius) !important; box-shadow: var(--ats-shadow-lg); font-family: var(--ats-font); padding: .5rem; }
.ui-datepicker .ui-widget-header { background: var(--ats-gradient); color: #fff; border: 0; border-radius: 8px; }
.ui-datepicker .ui-state-active { background: var(--ats-brand-600) !important; color: #fff !important; border-color: var(--ats-brand-600) !important; }

/* 17. RESPONSIVE ========================================================== */
@media (max-width: 1199.98px) {
    .ats-workspace { grid-template-columns: 1fr; }
    .ats-workspace-side { position: static; }
}
@media (max-width: 991.98px) {
    .ats-sidebar { transform: translateX(-100%); width: var(--ats-sidebar-w); box-shadow: var(--ats-shadow-lg); }
    .ats-main, body.ats-sidebar-collapsed .ats-main { margin-left: 0; }
    body.ats-sidebar-open .ats-sidebar { transform: none; }
    body.ats-sidebar-open .ats-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15, 23, 42, .45); }
    body.ats-sidebar-collapsed .ats-sidebar { width: var(--ats-sidebar-w); }
    body.ats-sidebar-collapsed .ats-brand-name, body.ats-sidebar-collapsed .ats-nav-heading,
    body.ats-sidebar-collapsed .ats-nav-link span { display: revert; }
    .ats-topbar { padding: 0 1rem; }
    .ats-content { padding: 1.25rem 1rem; }
    .login-page { grid-template-columns: 1fr; }
    .ats-auth-aside { display: none; }
}
@media (max-width: 767.98px) {
    .page-title { font-size: 1.3rem; }
    .table-header { flex-direction: column; align-items: stretch; }
    .table-search { max-width: none; }
    .ats-profile-actions { margin-left: 0; width: 100%; }
    .ats-profile-actions .btn { flex: 1; }
    .ats-funnel-row { grid-template-columns: 100px 1fr 36px; }
    .ats-user-meta { display: none; }
    .ats-hero { padding: 1.25rem; }
}

/* Print: content only */
@media print {
    .ats-sidebar, .ats-topbar, .ats-footer, .table-header, .table-filter-collapse, .ats-table-footer, .ats-profile-actions, .btn { display: none !important; }
    .ats-main { margin: 0 !important; }
    .ats-content { padding: 0; }
    .card, .table-card { box-shadow: none; border-color: #ccc; }
}
.min-w-0 { min-width: 0; }

/* Auth pane: the auth views wrap their card in Bootstrap grid columns sized
   for a full-width page; inside the split layout the pane itself sizes it. */
.ats-auth-main .container, .ats-auth-main .container-fluid { max-width: none; padding: 0; }
.ats-auth-main .row { margin: 0; min-height: auto !important; }
.ats-auth-main .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding: 0; }
.ats-auth-main .min-vh-100 { min-height: auto !important; }
.ats-auth-main .login-card { margin: 0 auto; }
.ats-auth-main .login-logo { text-align: left !important; }
.ats-auth-main .login-logo img { height: 36px; width: auto; }
.ats-auth-main .text-center:has(> .login-title) { text-align: left !important; }

/* Icon-prefixed inputs used on the auth pages */
.input-group-custom { position: relative; }
.input-group-custom > .bi, .input-group-custom > .fa { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--ats-subtle); pointer-events: none; z-index: 2; }
.input-group-custom > .form-control-custom, .input-group-custom > .form-control { padding-left: 2.6rem; }
.password-group .form-control-custom, .password-group .form-control { padding-right: 2.75rem; }
.login-card .form-check-label { font-weight: 500; }
