/* Recruitment Tracker — Design Tokens, per the official Omega_Softlogix_-_BRAND_GUIDE.pdf:
   colors #64DBE3 (bright cyan-teal) / #48AFB6 (deep teal) / #2B2A29 (near-black), font
   Montserrat (Semi Bold for "Omega"/headings, Medium for "Softlogix"/body). --navy is a
   further-darkened derivative of the brand teal (#48AFB6 alone is only 2.6:1 contrast
   against white — fails WCAG AA — so it's reserved for accents/borders, not text-on-teal
   backgrounds; --navy carries 7.44:1 contrast, used for the sidebar's active nav state,
   buttons, and headings).

   Visual direction: light & airy — white/light surfaces throughout, teal reserved for
   accents (buttons, links, active nav, chart colors) rather than covering large areas;
   soft shadows instead of heavy borders or colored card top-strips; generous whitespace.
   Nav lives in a left sidebar (grouped: Recruitment / Manage / Insights / Admin) instead
   of a single horizontal row — the old topbar squeezed 11 items into one line. */

:root {
    --navy: #175E64;
    --navy-deep: #0F3D40;
    --teal: #23838B;
    --teal-tint: #EAF6F7;
    --brand-cyan: #64DBE3;
    --brand-teal: #48AFB6;
    --amber: #F2A93B;
    --amber-deep: #D68F1F;
    --coral: #E8604C;
    --bg: #F7F9FA;
    --card: #FFFFFF;
    --ink: #2B2A29;
    --muted: #6B7685;
    --border: #E7EBEE;
    --green: #1A7F37;
    --green-bg: #DCF3E1;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 1px 3px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.04);
    --sidebar-w: 240px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Montserrat', -apple-system, Segoe UI, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

h1, h2, h3 { font-family: 'Montserrat', sans-serif; font-weight: 600; color: var(--navy-deep); letter-spacing: -0.01em; }

/* ==== App shell: sidebar + main content ==== */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand { padding: 20px 20px 16px; }
.sidebar-brand img { height: 30px; }
.brand-fallback { font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 18px; color: var(--navy); }

.sidebar-nav { flex: 1; padding: 4px 12px; }
.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 18px 12px 6px;
}
.nav-group-label:first-child { margin-top: 6px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.nav-link:hover { background: #F4F6F7; }
.nav-link.is-active { background: var(--teal-tint); color: var(--navy); font-weight: 600; }
.nav-link.is-active .nav-icon { color: var(--navy); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted); }
.nav-link:hover .nav-icon, .nav-link.is-active .nav-icon { color: var(--navy); }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
.back-link { color: var(--muted); text-decoration: none; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.back-link:hover { color: var(--navy); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { background: var(--teal); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.user-chip-text { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.user-chip .role { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.logout-link { color: var(--muted); flex-shrink: 0; display: inline-flex; }
.logout-link:hover { color: var(--coral); }
.logout-link svg { width: 17px; height: 17px; }

.main-content { flex: 1; min-width: 0; }
.container { max-width: 1150px; margin: 28px auto; padding: 0 28px; }

/* ==== Mobile drawer ==== */
.mobile-topbar { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 960px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 14px;
        position: sticky;
        top: 0;
        z-index: 30;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 10px 16px;
    }
    .drawer-toggle { background: none; border: none; padding: 4px; cursor: pointer; color: var(--navy); }
    .drawer-toggle svg { width: 22px; height: 22px; }

    .app-shell { position: relative; }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-md);
    }
    body.drawer-open .sidebar { transform: translateX(0); }
    body.drawer-open .drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 26, 0.4);
        z-index: 35;
    }

    .container { padding: 0 14px; margin: 16px auto; }
    .card { padding: 16px; overflow-x: auto; }
    .table { min-width: 640px; }
    .kpi-row, .rt-flex-row { flex-direction: column; }
    .rt-search-box { flex-wrap: wrap; }
    .rt-search-box input[type=search] { min-width: 0; width: 100%; }
}

/* ==== Cards ==== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table thead th { background: var(--teal-tint); color: var(--navy-deep); font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.table tbody tr:hover { background: #FAFBFC; }
.table a { color: var(--teal); font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.btn:hover { background: var(--navy-deep); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--teal-tint); border-color: var(--teal); }

/* ---- Alerts ---- */
.alert { padding: 10px 16px; border-radius: 8px; margin-bottom: 14px; background: var(--teal-tint); border-left: 4px solid var(--teal); font-size: 14px; }
.alert.error { background: #FBE1DC; border-left-color: var(--coral); color: #9b2c2c; }
.alert.success { background: var(--green-bg); border-left-color: var(--green); color: #1e6b34; }

.muted { color: var(--muted); }

/* ---- Layout utility: a wrapping row of side-by-side blocks (e.g. dashboard's
   chart + activity feed) — replaces repeated inline style="display:flex;gap:20px;
   flex-wrap:wrap;align-items:flex-start;" across views. ---- */
.rt-flex-row { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.rt-col-wide { flex: 2; min-width: 340px; }
.rt-col-narrow { flex: 1; min-width: 280px; }

/* ---- Forms ---- */
form label { display: block; margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--navy); }
form input[type=text], form input[type=email], form input[type=number], form input[type=password],
form input[type=date], form input[type=datetime-local], form input[type=search], form input[type=url],
form input[type=file], form select, form textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
form p { margin-top: 18px; margin-bottom: 0; }
form button[type=submit], form .btn { margin-top: 6px; }

.rt-search-box { display: flex; gap: 8px; align-items: center; margin: 4px 0 16px; }
.rt-search-box input[type=search] { min-width: 260px; }

/* ---- Status badges ---- */
.rt-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.rt-status-open, .rt-status-active, .rt-status-cleared, .rt-status-joined { background: var(--green-bg); color: var(--green); }
.rt-status-on-hold { background: #FDEBD0; color: var(--amber-deep); }
.rt-status-closed, .rt-status-withdrawn, .rt-status-resigned, .rt-status-applied, .rt-status-no-show { background: #EDEFF3; color: var(--muted); }
.rt-status-filled, .rt-status-offered, .rt-status-scheduled, .rt-status-accepted, .rt-status-offer-extended, .rt-status-interviewing { background: #DCEBF5; color: var(--navy); }
.rt-status-rejected, .rt-status-candidate-rejected, .rt-status-absconded, .rt-status-backed-out, .rt-status-rescheduled { background: #FBE1DC; color: var(--coral); }
.rt-status-interested { background: var(--green-bg); color: var(--green); }
.rt-status-not-interested, .rt-status-wrong-number { background: #FBE1DC; color: var(--coral); }
.rt-status-not-reachable, .rt-status-call-back-later { background: #FDEBD0; color: var(--amber-deep); }

.rt-vertical-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em; line-height: 1.4; }
.rt-vertical-it { background: #DCEBF5; color: var(--navy); }
.rt-vertical-nonit { background: #FDEBD0; color: var(--amber-deep); }

/* ---- KPI tiles (dashboard + reports) ---- */
.kpi-row { display: flex; flex-wrap: wrap; gap: 14px; }
.kpi-tile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 22px;
    min-width: 150px;
    flex: 1;
    box-shadow: var(--shadow-sm);
}
.kpi-tile h2 { font-size: 28px; margin: 0 0 4px; color: var(--navy); }
.kpi-tile p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }

/* ---- Dashboard timeline ---- */
.rt-timeline { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; max-height: 420px; overflow-y: auto; }
.rt-timeline-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rt-timeline-item:last-child { border-bottom: none; }
.rt-timeline-icon { font-size: 15px; }
.rt-timeline-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---- Login page ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); }
.login-box { width: 100%; max-width: 360px; padding: 0 16px; }
.login-box .card { text-align: center; padding: 40px 36px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); border: none; }
.login-logo { max-height: 48px; margin-bottom: 14px; }
.login-box h2 { font-size: 22px; }

/* ---- Report tabs (pill style) ---- */
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.report-tab {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: #F4F6F7;
}
.report-tab:hover { color: var(--navy); background: var(--teal-tint); }
.report-tab.is-active { background: var(--navy); color: #fff; }
.period-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.period-pill {
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    background: #fff;
    border: 1px solid var(--border);
}
.period-pill:hover { border-color: var(--teal); }
.period-pill.is-active { background: var(--teal-tint); border-color: var(--teal); color: var(--navy); }

/* ---- Candidate pipeline stepper ---- */
.rt-pipeline { display: flex; align-items: center; margin: 16px 0 24px; flex-wrap: wrap; }
.rt-pipeline-step { display: flex; flex-direction: column; align-items: center; min-width: 90px; text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.rt-pipeline-dot { width: 26px; height: 26px; border-radius: 50%; background: #EDEFF3; border: 2px solid var(--border); margin-bottom: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.rt-pipeline-line { flex: 1; height: 3px; background: var(--border); margin: 0 -4px 24px; min-width: 20px; }
.rt-pipeline-step.is-done .rt-pipeline-dot { background: var(--teal); border-color: var(--teal); }
.rt-pipeline-step.is-current .rt-pipeline-dot { background: var(--amber); border-color: var(--amber-deep); }
.rt-pipeline-step.is-current { color: var(--navy); }
.rt-pipeline-step.is-done { color: var(--teal); }
