/* static/style.css */

:root {
    --navy: #004D71;
    --navy-deep: #003552;
    --orange: #FF6B00;
    --orange-deep: #e55a00;
    --teal: #4295A5;
    --ink: #24303a;
    --muted: #64757e;
    --line: #e4e9ec;
    --line-soft: #eef1f3;
    --paper: #f4f6f7;
    --card: #ffffff;
    --radius: 6px;
    --shadow-flat: 0 1px 2px rgba(15, 35, 45, 0.06);
    /* Richer tokens for the Intelligence/BI surface specifically -- a
       deliberately more premium treatment than the flat, dense working
       views (candidate/job/company lists), since this is the "read at a
       glance, feel considered" layer of the app. */
    --radius-lg: 14px;
    --shadow-card: 0 1px 2px rgba(15, 35, 45, 0.04), 0 6px 20px rgba(15, 35, 45, 0.07);
    --shadow-card-hover: 0 2px 6px rgba(15, 35, 45, 0.06), 0 10px 28px rgba(15, 35, 45, 0.1);
    --good: #1a9c6d;
    --bad: #d1483f;
    /* A wider, warmer multi-series palette for charts with 5+ series
       (activity-type breakdowns etc.) -- the old 3-navy-tone palette read
       flat and samey once a chart needed more than 3 colors. */
    --chart-1: #FF6B00;
    --chart-2: #004D71;
    --chart-3: #4295A5;
    --chart-4: #B75FCF;
    --chart-5: #E5484D;
    --chart-6: #2FA36B;
    --chart-7: #D4A72C;
    --chart-8: #7C8CF8;
}

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

/* Base type scale set here so every rem-based size in the file shrinks
   proportionally from one place -- denser by design, not by accident. */
html {
    font-size: 14px;
}

body {
    font-family: -apple-system, "Segoe UI", sans-serif;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    font-size: 0.95rem;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background-color: var(--navy);
    color: white;
    padding: 16px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    display: block;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 1px;
}

.sidebar a {
    display: block;
    padding: 8px 18px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.86rem;
    transition: background-color 0.15s ease;
    position: relative;
}

.sidebar a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar a.active {
    color: var(--orange);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar a.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--orange);
}

/* Dashboard sits alone above the grouped sections -- it's the one link
   that isn't part of a category, so it gets its own visual treatment
   rather than blending into "People & Pipeline". */
.nav-solo {
    display: block;
    padding: 9px 18px;
    margin: 0 0 10px;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-solo:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-group-label {
    padding: 10px 18px 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

/* Content Area */
.content {
    flex: 1;
    min-width: 0; /* without this, a wide flex child (e.g. the kanban
        board on /applications) stretches .content itself instead of
        scrolling within its own overflow-x:auto container */
    margin-left: 220px;
    padding: 16px 20px;
}

/* Quick Add + Show More */
.quick-add-btn {
    display: block;
    margin: 0 18px 14px;
    padding: 8px;
    background-color: var(--orange);
    color: white;
    text-align: center;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}

.quick-add-btn:hover {
    background-color: var(--orange-deep);
}

.show-more-menu {
    margin-top: 6px;
    padding: 0 18px;
}

.show-more-menu summary {
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 6px 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.show-more-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.show-more-menu li a {
    display: block;
    padding: 7px 0;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.82rem;
}

.show-more-menu li a:hover,
.show-more-menu li a.active {
    color: var(--orange);
}

/* Pipeline strip -- compact, clickable summary bar. Each stat is a small
   pill in one row, separated by hairlines rather than full borders, so the
   set reads as one bar instead of competing cards. */
.pipeline-strip {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
}

.pipeline-card {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 7px 13px;
    text-decoration: none;
    border-right: 1px solid var(--line-soft);
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.pipeline-card:hover {
    background-color: #f0f4f8;
}

.pipeline-card .count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.pipeline-card .label {
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h1 {
    font-size: 1.35rem;
    color: var(--navy);
    letter-spacing: -0.01em;
}

.page-header h2 {
    font-size: 1.02rem;
    color: var(--navy);
}

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

/* Stage Filter */
.stage-filter select {
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    background-color: white;
    font-size: 0.88rem;
    cursor: pointer;
}

/* Tables */
.applications-table,
.candidates-table,
.jobs-table,
.companies-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card);
    box-shadow: var(--shadow-flat);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.86rem;
}

.applications-table th,
.candidates-table th,
.jobs-table th,
.companies-table th,
.data-table th {
    background-color: #f4f7f9;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--navy);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
}

.applications-table td,
.candidates-table td,
.jobs-table td,
.companies-table td,
.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line-soft);
}

.applications-table tr:hover,
.candidates-table tr:hover,
.jobs-table tr:hover,
.companies-table tr:hover,
.data-table tr:hover {
    background-color: #f9fbfd;
}

.applications-table a,
.candidates-table a,
.jobs-table a,
.companies-table a,
.data-table a {
    color: var(--orange);
    text-decoration: none;
}

.applications-table a:hover,
.candidates-table a:hover,
.jobs-table a:hover,
.companies-table a:hover,
.data-table a:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-green {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-orange {
    background-color: #fff3e0;
    color: #ef6c00;
}

.badge-grey {
    background-color: #f0f2f3;
    color: #5c6b73;
}

.badge-red {
    background-color: #fdecea;
    color: #b00020;
}

/* Forms */
.search-form,
.filter-tabs {
    margin-bottom: 14px;
}

.search-form input[type="text"] {
    padding: 7px 12px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.88rem;
    width: 280px;
    margin-right: 8px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 5px 13px;
    border-radius: 20px;
    background-color: #eef2f5;
    color: var(--navy);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.filter-tab.active,
.filter-tab:hover {
    background-color: var(--orange);
    color: white;
}

/* Buttons */
.btn {
    padding: 7px 13px;
    border-radius: var(--radius);
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--orange);
    color: white;
}

.btn-primary:hover {
    background-color: var(--orange-deep);
}

.btn-small {
    padding: 4px 9px;
    font-size: 0.78rem;
}

.btn-small.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: white;
    color: var(--navy);
    border: 1px solid var(--line);
}

.btn-icon:hover {
    background-color: #f0f4f8;
    border-color: var(--teal);
}

/* Stage Progress */
.stage-progress {
    display: flex;
    gap: 3px;
    align-items: center;
    justify-content: flex-start;
}

.stage-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: bold;
    color: #666;
}

.stage-box.filled {
    background-color: var(--teal);
    color: white;
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--navy);
    padding: 16px;
}

.login-card {
    background: white;
    padding: 32px;
    border-radius: 10px;
    width: 320px;
    max-width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-card h1 {
    color: var(--navy);
    margin-bottom: 18px;
    font-size: 1.3rem;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-card input {
    padding: 8px 11px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.9rem;
}

.login-error {
    color: #c62828;
    background: #fdecea;
    padding: 7px 11px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: var(--muted);
}

.topbar-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
}

/* Global omnisearch -- lives in the topbar on every page (distinct from
   Advanced Search, which is a dedicated candidates-only faceted page). */
.global-search {
    position: relative;
    width: 320px;
    max-width: 40vw;
}

.global-search input {
    width: 100%;
    padding: 6px 11px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.global-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--teal);
    border-radius: var(--radius);
    max-height: 380px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.global-search-results.open {
    display: block;
}

.global-search-group-label {
    padding: 6px 12px 3px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--muted);
    background: var(--paper);
}

.global-search-row {
    display: flex;
    align-items: center;
}

.global-search-row:hover {
    background-color: #f0f4f8;
}

.global-search-item {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 7px 12px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.85rem;
}

.global-search-item .sub {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
}

.global-search-quick-add {
    flex: none;
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    padding: 3px 9px;
    margin-right: 8px;
    border: 1px solid var(--teal);
    border-radius: 12px;
    white-space: nowrap;
}

/* Touch devices need a real tap target (WCAG/Apple HIG minimum 44px);
   mouse users don't need the extra height, so this is scoped to coarse
   pointers rather than bloating the dropdown row on desktop. */
@media (hover: none) and (pointer: coarse) {
    .global-search-quick-add {
        min-height: 44px;
        padding: 3px 12px;
    }
}

.global-search-quick-add:hover {
    background-color: var(--teal);
    color: white;
}

/* Saved search views */
.saved-views-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.saved-views-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.saved-view-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef2f5;
    border-radius: 20px;
    padding: 4px 6px 4px 12px;
}

.saved-view-chip a {
    color: var(--navy);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
}

.saved-view-chip a:hover {
    text-decoration: underline;
}

.saved-view-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 2px 6px;
}

.saved-view-remove:hover {
    color: #c62828;
}

.save-view-form {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.save-view-form input[type="text"] {
    padding: 6px 11px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.82rem;
    width: 220px;
}

/* Ownership handoff (Team page) */
.reassign-menu summary {
    cursor: pointer;
    color: var(--teal);
    font-size: 0.8rem;
    font-weight: 600;
    list-style: none;
}

.reassign-menu summary::-webkit-details-marker {
    display: none;
}

.reassign-form {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.reassign-form select {
    padding: 4px 8px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.78rem;
    max-width: 160px;
}

/* Sidebar "Take a tour" trigger */
.tour-trigger {
    display: block;
    width: calc(100% - 24px);
    margin: 10px 12px;
    padding: 8px 10px;
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
}

.tour-trigger:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.95);
}

/* Onboarding tour overlay */
.tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 35, 0.6);
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-card {
    background: white;
    border-radius: 10px;
    padding: 26px 28px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.tour-progress {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--teal);
    font-weight: 700;
    margin-bottom: 8px;
}

.tour-card h3 {
    color: var(--navy-deep);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.tour-card p {
    font-size: 0.88rem;
    color: var(--ink);
    line-height: 1.5;
}

.tour-card kbd {
    background: var(--paper);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
}

.tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.tour-skip {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
}

.tour-nav {
    display: flex;
    gap: 8px;
}

.global-search-empty {
    padding: 12px;
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
}

.topbar form {
    display: inline;
}

.topbar button.link-btn {
    background: none;
    border: none;
    color: var(--orange);
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* Record forms */
.record-form {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    max-width: 460px;
    box-shadow: var(--shadow-flat);
}

.record-form label {
    display: block;
    margin-bottom: 11px;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.82rem;
}

.record-form input,
.record-form select,
.record-form textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 7px 10px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.9rem;
    font-weight: normal;
    font-family: inherit;
}

.record-form textarea {
    resize: vertical;
    min-height: 60px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-secondary {
    background-color: #eef2f5;
    color: var(--navy);
}

.btn-secondary:hover {
    background-color: #e2e9ee;
}

.page-header .btn {
    white-space: nowrap;
}

/* Activity timeline */
.activity-timeline {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
    margin-top: 12px;
    box-shadow: var(--shadow-flat);
}

.activity-item {
    border-left: 3px solid var(--teal);
    padding: 3px 0 3px 12px;
    margin-bottom: 11px;
}

.activity-item .activity-meta {
    font-size: 0.72rem;
    color: #888;
}

.activity-item .activity-type {
    display: inline-block;
    background: #f0f4f8;
    color: var(--navy);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.68rem;
    text-transform: uppercase;
    margin-right: 5px;
}

/* Any table gets wrapped in this at runtime (app.js) so a wide table
   scrolls within itself instead of forcing the whole page sideways. */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    max-width: 100%;
    min-width: 0;
}
.table-scroll table {
    box-shadow: none;
}

/* Hamburger toggle -- hidden on desktop, shown only under the mobile
   breakpoint below. Fixed so it stays reachable while the page scrolls. */
.nav-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 40;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius);
    background: var(--navy);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: white;
    border-radius: 2px;
}
.nav-backdrop {
    display: none;
}

/* Result count / pagination */
.result-count {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0 0 8px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 12px;
}

.pagination a {
    padding: 5px 10px;
    border: 1px solid var(--teal);
    border-radius: var(--radius);
    color: var(--navy);
    text-decoration: none;
    font-size: 0.8rem;
}

.pagination a:hover {
    background-color: var(--teal);
    color: #fff;
}

.pagination a.disabled {
    pointer-events: none;
    opacity: 0.4;
}

.pagination-current {
    padding: 0 6px;
    font-weight: 600;
    color: var(--ink);
    font-size: 0.82rem;
}

.autocomplete-picker {
    position: relative;
}

.autocomplete-input {
    width: 100%;
    box-sizing: border-box;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--teal);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.autocomplete-result-row {
    padding: 6px 11px;
    cursor: pointer;
    font-size: 0.85rem;
}

.autocomplete-result-row:hover {
    background-color: #f0f4f8;
}

/* ---------------------------------------------------------------------
   Dashboard -- the landing page. KPI row (management only), then a
   two-column layout: exceptions + activity feed (wide) next to today's
   events/tasks (narrow).
   --------------------------------------------------------------------- */
.dash-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.dash-kpi {
    flex: 1;
    min-width: 170px;
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    overflow: hidden; /* a KPI value can be a very large number (see the
        known currency-mixing bug) -- clip rather than let it break out of
        the card on narrow screens where it can't be scaled down enough */
}

.dash-kpi:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}

.dash-kpi-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.dash-kpi-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.dash-kpi-warn .dash-kpi-value {
    color: var(--orange);
}

.dash-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.dash-kpi-trend.up { color: var(--good); }
.dash-kpi-trend.down { color: var(--bad); }
.dash-kpi-trend.flat { color: var(--muted); }

.dash-kpi-trend .arrow { font-size: 0.7rem; }

.dash-kpi-sub {
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 6px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    align-items: start;
}

.dash-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0; /* grid items default to min-width:auto, which lets a wide
        table inside force this column (and the whole grid track) wider
        than the viewport instead of scrolling within its own container */
}

.dash-panel {
    background: var(--card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}

.dash-panel-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.dash-panel-head h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-deep);
    letter-spacing: -0.01em;
}

.dash-panel-sub {
    font-size: 0.72rem;
    color: var(--muted);
}

/* Profile card -- My Dashboard's header, an avatar-initials circle since
   we have no real photo data, plus whatever real role/team/location info
   exists for that user. */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 18px;
    color: white;
}

.profile-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.profile-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.profile-card-meta {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Gauge chart -- a Chart.js doughnut with a center-text plugin (see
   app.js renderGaugeChart), replicating Vincere's circular target-vs-
   actual rings instead of a bare percentage number. */
.gauge-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

.gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.gauge-panel {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.gauge-panel-stats {
    flex: 1;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gauge-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 6px;
}

.gauge-stat-row strong {
    font-variant-numeric: tabular-nums;
    color: var(--navy);
}

.dash-note {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 8px;
    font-style: italic;
}

.dash-activity-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.dash-activity-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.82rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-soft);
}

.dash-activity-body {
    flex: 1;
    color: var(--ink);
}

.dash-activity-time {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
}

.dash-mini-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    padding: 7px 0;
    border-bottom: 1px solid var(--line-soft);
}

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

.dash-mini-row span {
    color: var(--muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* An empty state that carries its own next step, instead of just a plain
   sentence with the relevant button sitting elsewhere on the page. */
.empty-state {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.empty-state p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Keyboard shortcuts help ("?" key) */
.shortcuts-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 35, 0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcuts-help-card {
    background: white;
    border-radius: 10px;
    padding: 22px 26px;
    width: 300px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.shortcuts-help-card h3 {
    color: var(--navy-deep);
    font-size: 1rem;
    margin-bottom: 14px;
}

.shortcuts-help-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--ink);
}

.shortcuts-help-row kbd {
    background: var(--paper);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 7px;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    min-width: 18px;
    text-align: center;
}

.shortcuts-help-hint {
    margin-top: 14px;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

/* Bulk action bar: hidden until 1+ row checkbox is ticked (see
   initBulkSelect in app.js), then sticks above the table with a count and
   the available bulk action(s). */
.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--navy);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.bulk-action-bar.visible {
    display: flex;
}

.bulk-action-bar select {
    padding: 5px 9px;
    border-radius: var(--radius);
    border: none;
    font-size: 0.82rem;
}

.bulk-action-bar #bulkCount {
    font-weight: 600;
}

@media (max-width: 768px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
    /* Stack KPI cards full-width on mobile -- side-by-side at this width
       leaves too little room for a large tabular number (e.g. a currency
       total) to render without clipping or shrinking illegibly small. */
    .dash-kpis {
        flex-direction: column;
    }
    .dash-kpi {
        min-width: 0;
    }
    .dash-kpi-value {
        font-size: 1.5rem;
    }
}

/* ---------------------------------------------------------------------
   Charts -- every list page gets a "Charts" button in the page header
   that opens this modal on demand (data fetched only when opened, so it
   never slows down the base page load). Rendered with vendored Chart.js
   (static/vendor/chart.umd.min.js), no CDN dependency.
   --------------------------------------------------------------------- */
.chart-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 35, 0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chart-modal-overlay.open {
    display: flex;
}

.chart-modal {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 920px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.chart-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.chart-modal-head h2 {
    font-size: 1.05rem;
    color: var(--navy);
}

.chart-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
}

.chart-modal-close:hover {
    color: var(--ink);
}

.chart-modal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.chart-modal-filters:empty {
    display: none;
}

.chart-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.chart-filter select {
    padding: 4px 8px;
    border-radius: var(--radius);
    border: 1px solid #ccc;
    font-size: 0.82rem;
    color: var(--ink);
    background: white;
}

.chart-filter-reset {
    background: none;
    border: none;
    color: var(--orange);
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    margin-left: auto;
}

.chart-modal-body {
    padding: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.cv-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 35, 0.55);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cv-modal-overlay.open {
    display: flex;
}

.cv-modal {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 860px;
    height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cv-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.cv-modal-head h2 {
    font-size: 1.05rem;
    color: var(--navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cv-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cv-modal-body {
    flex: 1;
    overflow: hidden;
}

.cv-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 640px) {
    .cv-modal {
        height: 92vh;
    }
    .cv-modal-head h2 {
        font-size: 0.9rem;
    }
}

/* Two-column layout used on My Dashboard (gauge pair, jobs/companies pair)
   -- collapses to one column on narrow screens instead of forcing the grid
   track wider than the viewport. */
.dash-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dash-two-col > * {
    min-width: 0; /* grid items default to min-width:auto, which lets a wide
        table inside force this column wider than the viewport -- see the
        matching note on .dash-col above */
}

@media (max-width: 768px) {
    .dash-two-col {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .gauge-panel {
        flex-direction: column;
        text-align: center;
    }
}

/* Sub-tab strip -- used on Intelligence pages that mirror a Vincere
   report's own top-level sub-tab nav (e.g. Pipeline Activities' Over
   Time/By Consultant/By Company/By Placed,Closed,Open). Panels toggle via
   plain JS display:none/block, no page reload. */
.subtab-strip {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.subtab-strip button {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
}
.subtab-strip button:hover { color: var(--navy-deep); }
.subtab-strip button.active { color: var(--orange); border-bottom-color: var(--orange); }
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }

.chart-panel h3 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.chart-panel canvas {
    max-height: 260px;
}

.chart-loading,
.chart-empty {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 30px 0;
}

@media (max-width: 768px) {
    body { overflow-x: hidden; }

    .nav-toggle {
        display: flex;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 20, 30, 0.45);
        z-index: 29;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .nav-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .container {
        flex-direction: column;
    }

    /* Off-canvas: hidden by default, slides in over the content when
       .nav-toggle is clicked (see initMobileNav in app.js). */
    .sidebar {
        width: 82%;
        max-width: 280px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 30;
        padding-top: 64px;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 14px 12px;
        padding-top: 58px;
    }

    /* Stat cards: a horizontally-swipeable strip instead of a vertical
       stack that would push all real page content down a full screen. */
    .pipeline-strip {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 14px;
    }
    .pipeline-card {
        flex: 0 0 auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form input[type="text"] {
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
        box-sizing: border-box;
    }

    /* Topbar (entity switcher / user / export / sign out) was one
       unwrapping flex row that forced the entire page to scroll
       sideways -- let it wrap and stack instead. */
    .topbar {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
        padding-right: 42px; /* clear the fixed hamburger button */
    }
    .topbar select {
        max-width: 100%;
        box-sizing: border-box;
    }
    .topbar-identity form {
        max-width: 100%;
        min-width: 0;
    }
    .global-search {
        width: 100%;
        max-width: 100%;
        order: 2; /* identity row first, search below it on mobile */
    }
    .topbar-identity {
        order: 1;
        flex-wrap: wrap;
        min-width: 0;
        width: 100%;
    }

    .applications-table,
    .candidates-table,
    .jobs-table,
    .companies-table,
    .data-table {
        font-size: 0.78rem;
    }

    .applications-table th,
    .candidates-table th,
    .jobs-table th,
    .companies-table th,
    .data-table th,
    .applications-table td,
    .candidates-table td,
    .jobs-table td,
    .companies-table td,
    .data-table td {
        padding: 7px 8px;
        white-space: nowrap;
    }

    .record-form {
        max-width: 100%;
    }

    .chart-modal-body {
        grid-template-columns: 1fr;
    }
}

/* Intelligence / reporting suite */
.intel-group {
    margin-bottom: 22px;
}

.intel-group-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 10px;
}

.intel-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.intel-tile {
    display: block;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-decoration: none;
    box-shadow: var(--shadow-flat);
    transition: border-color 0.15s ease;
}

.intel-tile:hover {
    border-color: var(--teal);
}

.intel-tile-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.intel-tile-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin-bottom: 2px;
}

.intel-tile-sub {
    font-size: 0.72rem;
    color: var(--muted);
}

.intel-chart-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-flat);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.intel-chart-card h3 {
    font-size: 0.9rem;
    color: var(--navy-deep);
    margin-bottom: 10px;
}

.intel-chart-wrap {
    max-width: 720px;
}

@media (max-width: 720px) {
    .intel-tile-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* AI match results (job<->candidate, either direction) */
.match-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-flat);
    padding: 14px 18px;
    margin-bottom: 12px;
}

.match-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.match-card-head h3 {
    font-size: 1rem;
    margin: 0;
}

.match-score {
    background: var(--navy);
    color: white;
    border-radius: 20px;
    padding: 4px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.match-card-sub {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
}

.match-factors {
    margin-top: 8px;
    font-size: 0.85rem;
}

.match-factors summary {
    cursor: pointer;
    color: var(--teal);
    font-weight: 600;
    font-size: 0.82rem;
}

.match-factors ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.match-factors li {
    margin-bottom: 4px;
    color: var(--ink);
}
