/* ==========================================================================
   TalentVare BRD mocks — shared shell stylesheet
   --------------------------------------------------------------------------
   Single source of truth for every static design mock in this folder.

   Design tokens are copied VERBATIM from talentvare-web/src/index.css.
   That file is the app's global stylesheet and is never edited — this is a
   read-only copy so the mocks stay colour-accurate.

   Component styles below are transcriptions of the real components:
     navbar       -> src/components/navbar/navbar-desktop.tsx
     tab sidebar  -> src/components/tab-sidebar.tsx  (+ ui/sidebar.tsx)
     table        -> src/components/app-table.tsx    (+ ui/table.tsx)
     badges       -> src/components/status-badge.tsx (+ ui/badge.tsx)
     buttons      -> src/components/ui/button.tsx
     cards        -> src/components/ui/card.tsx
   ========================================================================== */

/* ==========================================================================
   1. Design tokens (verbatim from src/index.css)
   ========================================================================== */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: #173E8F;
  --primary-rgb: 23 62 143;
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --radius: 0.625rem;

  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-border: oklch(0.922 0 0);

  /* Radius scale from the @theme inline block */
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);

  /* Tailwind shadow presets used across the mocks */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* app-table.tsx hardcodes the header cell background */
  --table-head-bg: #eff3ff;

  /* Sidebar widths (ui/sidebar.tsx SIDEBAR_WIDTH / SIDEBAR_WIDTH_ICON) */
  --sidebar-width: 14rem;
  --sidebar-width-icon: 3rem;

  /* Navbar height — the tab sidebar is offset by this (top-14) */
  --navbar-height: 3.5rem;

  /* Hero banner (modules/home/page.tsx HeroBanner) */
  --hero-gradient: linear-gradient(135deg, rgba(215,225,255,0.96) 0%, rgba(240,244,255,0.98) 50%, rgba(210,222,255,0.95) 100%);
  --hero-shadow: 0 24px 80px -52px rgba(23,62,143,0.5);
  --hero-blob-1: rgba(255,255,255,0.45);
  --hero-panel-bg: rgba(255,255,255,0.55);
  --hero-panel-ring: rgba(255,255,255,0.6);
  --hero-pill-bg: rgba(255,255,255,0.7);
  --hero-pill-fg: var(--primary);

  /* Semantic status colours, lifted from status-badge.tsx (Tailwind palette) */
  --ok-bg: #d1fae5;        /* emerald-100 */
  --ok-fg: #047857;        /* emerald-700 */
  --warn-bg: #fef3c7;      /* amber-100  */
  --warn-fg: #b45309;      /* amber-700  */
  --info-bg: #dbeafe;      /* blue-100   */
  --info-fg: #1d4ed8;      /* blue-700   */
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: #173E8F;
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);

  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);

  --table-head-bg: #1a2340;

  --hero-gradient: linear-gradient(135deg, rgba(23,62,143,0.55) 0%, rgba(15,40,100,0.65) 50%, rgba(10,28,80,0.6) 100%);
  --hero-blob-1: rgb(var(--primary-rgb) / 0.1);
  --hero-panel-bg: rgba(255,255,255,0.05);
  --hero-panel-ring: rgba(255,255,255,0.1);
  --hero-pill-bg: rgba(255,255,255,0.1);
  --hero-pill-fg: var(--primary-foreground);

  --ok-bg: rgba(2, 44, 34, 0.5);
  --ok-fg: #34d399;
  --warn-bg: rgba(69, 26, 3, 0.5);
  --warn-fg: #fbbf24;
  --info-bg: rgba(23, 37, 84, 0.5);
  --info-fg: #60a5fa;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-size: 0.75rem;
  line-height: 1rem;
}

* { scrollbar-width: thin; scrollbar-color: oklch(0.85 0 0) transparent; }
.dark * { scrollbar-color: oklch(0.3 0 0) transparent; }

img, svg { display: block; }
svg { flex-shrink: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; }

/* Switch panels set their own inline `display` when visible, which otherwise
   outranks the UA [hidden] rule and leaves every panel showing at once. */
[data-switch-panel][hidden] { display: none !important; }

.icon      { width: 1rem;     height: 1rem; }
.icon-xs   { width: 0.75rem;  height: 0.75rem; }
.icon-sm   { width: 0.875rem; height: 0.875rem; }
.icon-lg   { width: 1.25rem;  height: 1.25rem; }
.icon-xl   { width: 1.5rem;   height: 1.5rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-foreground); }

/* App shell: h-svh flex column, navbar sticky, main scrolls (protected-layout.tsx) */
.app-shell { display: flex; flex-direction: column; height: 100svh; overflow: hidden; }
.route-shell { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }

/* ==========================================================================
   3. Navbar — components/navbar/navbar-desktop.tsx
   ========================================================================== */
.navbar {
  position: sticky; top: 0; z-index: 50; width: 100%;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 80%, transparent);
  background: color-mix(in oklab, var(--background) 80%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.navbar-inner {
  display: none;
  min-height: var(--navbar-height);
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
}
@media (min-width: 768px) { .navbar-inner { display: grid; } }

.navbar-logo { display: flex; height: 2rem; align-items: center; }
.navbar-logo img { height: 1.75rem; width: auto; max-width: 150px; object-fit: contain; }
.dark .navbar-logo img { filter: brightness(0) invert(1); }

/* Tab bar — ui/tabs.tsx + the navbar's overrides */
.navbar-tabs { display: flex; min-width: 0; width: 100%; align-items: center; justify-content: center; }
.tabs-list {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2rem; padding: 0.25rem; gap: 0.375rem;
  border-radius: var(--radius-xl);
  background: var(--muted);
  color: var(--muted-foreground);
}
.tab {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  height: calc(100% - 1px);
  gap: 0.375rem;
  padding: 0.125rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.75rem; font-weight: 500; line-height: 1rem; white-space: nowrap;
  color: color-mix(in oklab, var(--foreground) 60%, transparent);
  transition: all 0.15s ease;
}
.tab:hover { color: var(--foreground); }
.dark .tab { color: var(--muted-foreground); }
.dark .tab:hover { color: var(--foreground); }

.tab[data-active] {
  border-color: rgb(var(--primary-rgb) / 0.15);
  background: rgb(var(--primary-rgb) / 0.1);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.dark .tab[data-active] {
  border-color: rgb(var(--primary-rgb) / 0.35);
  background: rgb(var(--primary-rgb) / 0.25);
  color: var(--primary-foreground);
}

.tab-dot {
  margin-left: 0.125rem; width: 0.375rem; height: 0.375rem;
  border-radius: 9999px; background: var(--primary);
}
.dark .tab-dot { background: var(--primary-foreground); }

.navbar-actions { display: flex; width: 100%; align-items: center; justify-content: flex-end; gap: 0.5rem; }

/* navbar-shared.ts actionButtonClassName */
.action-btn {
  position: relative;
  display: flex; width: 2rem; height: 2rem; align-items: center; justify-content: center;
  border-radius: 9999px;
  color: var(--muted-foreground);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.action-btn:hover,
.action-btn[aria-expanded="true"] { background: var(--muted); color: var(--foreground); }

.notif-dot {
  position: absolute; right: 0.5rem; top: 0.5rem;
  width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: var(--primary);
}

.navbar-separator {
  align-self: center; width: 1px; height: 2rem;
  background: color-mix(in oklab, var(--border) 80%, transparent);
}

.avatar {
  display: flex; width: 2rem; height: 2rem; flex-shrink: 0;
  align-items: center; justify-content: center;
  overflow: hidden; border-radius: 9999px;
  background: var(--muted); color: var(--muted-foreground);
  font-size: 0.75rem; font-weight: 500;
}
.avatar-lg { width: 2.25rem; height: 2.25rem; }
.avatar-xl { width: 3rem; height: 3rem; font-size: 0.875rem; }

/* Theme toggle crossfade (mode-toggle.tsx) */
.theme-sun, .theme-moon { transition: transform 0.2s ease; }
.theme-moon { position: absolute; transform: scale(0) rotate(90deg); }
.dark .theme-sun { transform: scale(0) rotate(-90deg); }
.dark .theme-moon { transform: scale(1) rotate(0deg); }

.mobile-note {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem; color: var(--muted-foreground);
}
@media (min-width: 768px) { .mobile-note { display: none; } }

/* ==========================================================================
   4. Dropdowns / popovers — ui/dropdown-menu.tsx
   ========================================================================== */
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 0.375rem); z-index: 60;
  display: none; flex-direction: column;
  min-width: 14rem; padding: 0.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--popover); color: var(--popover-foreground);
  box-shadow: var(--shadow-lg);
}
.dropdown[data-open="true"] .dropdown-panel { display: flex; }
.dropdown-panel--sm    { min-width: 10rem; }
.dropdown-panel--suite { min-width: 12rem; padding: 0.5rem; }
.dropdown-panel--wide  { min-width: 22.5rem; padding: 1rem; }
.dropdown-panel--left  { right: auto; left: 0; }

.dropdown-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem; line-height: 1rem; text-align: left;
  transition: background-color 0.12s ease;
}
.dropdown-item:hover { background: var(--accent); color: var(--accent-foreground); }
.dropdown-item svg { color: var(--muted-foreground); }
.dropdown-item--destructive,
.dropdown-item--destructive svg { color: var(--destructive); }

.dropdown-label {
  padding: 0.25rem 0.375rem;
  font-size: 0.625rem; font-weight: 500; color: var(--muted-foreground);
}
.dropdown-separator { height: 1px; margin: 0.25rem -0.25rem; background: var(--border); }
.dropdown-user { display: flex; align-items: center; gap: 0.75rem; padding: 0.375rem 0.5rem; }
.dropdown-user-name  { font-size: 0.75rem; font-weight: 500; color: var(--foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-user-email { font-size: 0.625rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.suite-fallback {
  display: flex; width: 1.25rem; height: 1.25rem; flex-shrink: 0;
  align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: rgb(var(--primary-rgb) / 0.1); color: var(--primary);
  font-size: 0.5625rem; font-weight: 600;
}
.dark .suite-fallback { color: var(--primary-foreground); background: rgb(var(--primary-rgb) / 0.35); }

/* Keyboard hint. VareSuite users are on Windows — show Ctrl, never the Mac key. */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--muted); color: var(--muted-foreground);
  font-size: 0.625rem; font-weight: 500;
}

/* ==========================================================================
   5. Buttons — ui/button.tsx
   ========================================================================== */
.btn {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  height: 2rem; gap: 0.375rem;
  padding: 0 0.625rem;
  border: 1px solid transparent; border-radius: var(--radius-lg);
  background: var(--primary); color: var(--primary-foreground);
  font-size: 0.75rem; font-weight: 500; white-space: nowrap;
  transition: all 0.15s ease;
}
.btn:hover { background: color-mix(in srgb, var(--primary) 80%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }
.btn svg { width: 1rem; height: 1rem; }

.btn--sm { height: 1.75rem; gap: 0.25rem; padding: 0 0.625rem; border-radius: min(var(--radius-md), 12px); font-size: 0.8rem; }
.btn--sm svg { width: 0.875rem; height: 0.875rem; }
.btn--lg { height: 2.25rem; }

.btn--outline {
  border-color: var(--border); background: var(--background); color: var(--foreground);
}
.btn--outline:hover { background: var(--muted); }
.dark .btn--outline { border-color: var(--input); background: color-mix(in oklab, var(--input) 30%, transparent); }

.btn--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn--secondary:hover { background: color-mix(in oklab, var(--secondary) 80%, transparent); }

.btn--ghost { background: transparent; color: inherit; }
.btn--ghost:hover { background: var(--muted); color: var(--foreground); }

.btn--destructive {
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.btn--destructive:hover { background: color-mix(in oklab, var(--destructive) 20%, transparent); }

.btn--icon    { width: 2rem;    padding: 0; }
.btn--icon-sm { width: 1.75rem; height: 1.75rem; padding: 0; border-radius: min(var(--radius-md), 12px); }

/* ==========================================================================
   6. Badges — ui/badge.tsx + status-badge.tsx
   ========================================================================== */
.badge {
  display: inline-flex; width: fit-content; height: 1.25rem; flex-shrink: 0;
  align-items: center; justify-content: center; gap: 0.25rem;
  overflow: hidden;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent; border-radius: var(--radius-4xl);
  font-size: 0.6875rem; font-weight: 500; white-space: nowrap;
}
.badge svg { width: 0.75rem; height: 0.75rem; }

.badge--approved  { background: var(--ok-bg);   color: var(--ok-fg); }
.badge--pending   { background: var(--warn-bg); color: var(--warn-fg); }
.badge--info      { background: var(--info-bg); color: var(--info-fg); }
.badge--rejected  { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }
.badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge--outline   { border-color: var(--border); color: var(--foreground); }
.badge--primary   { background: var(--primary); color: var(--primary-foreground); }

/* ==========================================================================
   7. Cards — ui/card.tsx
   ========================================================================== */
.card {
  display: flex; flex-direction: column; gap: 1rem;
  overflow: hidden;
  padding: 1rem 0;
  border-radius: var(--radius-xl);
  background: var(--card); color: var(--card-foreground);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent);
  font-size: 0.75rem;
}
.card--flush { padding: 0; }
.card-header { display: flex; flex-direction: column; gap: 0.25rem; padding: 0 1rem; }
.card-title  { font-size: 0.875rem; font-weight: 500; line-height: 1.375; }
.card-desc   { font-size: 0.75rem; color: var(--muted-foreground); }
.card-body   { padding: 0 1rem; }

/* Panel: the ring-1 ring-border/70 + shadow-sm card used by home + case pages */
.panel-card {
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm), 0 0 0 1px color-mix(in oklab, var(--border) 70%, transparent);
}
.dark .panel-card { background: color-mix(in oklab, var(--card) 75%, transparent); }

/* ==========================================================================
   8. Page scaffolding
   ========================================================================== */
/* Route body used by non-sidebar pages (home) */
.page {
  display: flex; flex-direction: column; gap: 1.25rem;
  overflow-y: auto; padding: 1rem;
}
@media (min-width: 640px)  { .page { gap: 1.5rem; padding: 1.5rem; } }
@media (min-width: 768px)  { .page { min-height: 0; flex: 1; } }
@media (min-width: 1280px) { .page { padding: 1.75rem 2rem; } }

/* Route body used by sidebar pages (SidebarInset > div.p-4 md:p-6 xl:px-6) */
.page-inset {
  display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 1rem;
  overflow: hidden; padding: 1rem;
}
@media (min-width: 768px) { .page-inset { padding: 1.5rem; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; column-gap: 0.5rem; row-gap: 0.75rem; }
.page-head-title { min-width: 0; margin-right: auto; }
.page-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.75rem; }
.page-head-actions { display: flex; flex-wrap: nowrap; align-items: center; column-gap: 0.5rem; row-gap: 0.5rem; }
.page-head-actions .input-group { flex: 1 1 8rem; min-width: 8rem; }
.page-head-actions > :not(.input-group) { flex-shrink: 0; }
.section-title { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.75rem; }

.toolbar { display: flex; align-items: center; gap: 0.5rem; }

/* ==========================================================================
   9. Tab sidebar — components/tab-sidebar.tsx
   ========================================================================== */
.with-sidebar { display: flex; min-height: 0; width: 100%; flex: 1; overflow: hidden; }

.tab-sidebar {
  display: none; width: var(--sidebar-width); flex-shrink: 0; flex-direction: column;
  border-right: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  background: color-mix(in oklab, var(--background) 95%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
@media (min-width: 768px) { .tab-sidebar { display: flex; } }

.tab-sidebar-content { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow-y: auto; padding-top: 0.5rem; }
.tab-sidebar-group { padding: 0.75rem 0.5rem; }
.tab-sidebar-group-label {
  padding: 0 0.5rem 0.5rem;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em;
  color: color-mix(in oklab, var(--muted-foreground) 80%, transparent);
}
.tab-sidebar-menu { display: flex; flex-direction: column; gap: 0.25rem; }
.tab-sidebar-item {
  display: flex; height: 2.5rem; width: 100%; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-lg);
  font-size: 0.75rem; font-weight: 500; line-height: 1.25;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tab-sidebar-item:hover { background: rgb(var(--primary-rgb) / 0.08); color: var(--primary); }
.dark .tab-sidebar-item:hover { background: rgb(var(--primary-rgb) / 0.15); color: var(--primary-foreground); }
.tab-sidebar-item[data-active] { background: rgb(var(--primary-rgb) / 0.1); color: var(--primary); }
.dark .tab-sidebar-item[data-active] { background: rgb(var(--primary-rgb) / 0.2); color: var(--primary-foreground); }
.tab-sidebar-item .count {
  margin-left: auto;
  font-size: 0.6875rem; font-weight: 600; color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.tab-sidebar-item[data-active] .count { color: inherit; }

/* Sections whose design is not drafted yet: shown so the intended module
   shape is visible, but inert so the mock has no dead links. */
.tab-sidebar-item[data-soon] { opacity: 0.45; cursor: default; }
.tab-sidebar-item[data-soon]:hover { background: transparent; color: inherit; }
.tab-sidebar-item[data-soon] .count { font-weight: 400; }

.tab-sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 0.75rem 0.5rem;
}

/* ==========================================================================
   10. Table — app-table.tsx + ui/table.tsx
   --------------------------------------------------------------------------
   Layout follows the documented AppTable pattern:
     border box     -> flex flex-1 flex-col overflow-hidden rounded-lg border
     scroll viewport-> flex-1 overflow-auto  (table at natural height inside)
   Never put a height on .data-table itself — rows would stretch to fill.
   ========================================================================== */
.table-box {
  display: flex; min-height: 0; flex: 1; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.table-scroll { min-height: 0; flex: 1; overflow: auto; }

.data-table { width: 100%; border-bottom: 1px solid var(--border); font-size: 0.75rem; table-layout: fixed; }
.data-table thead tr { border-bottom: 1px solid var(--border); }
.data-table th {
  position: sticky; top: 0; z-index: 30;
  height: 2rem; padding: 0 0.5rem;
  background: var(--table-head-bg);
  text-align: start; vertical-align: middle;
  font-weight: 500; white-space: nowrap; color: var(--foreground);
  box-shadow: 0 1px 0 var(--border);
  border-right: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}
.data-table th:last-child { border-right: 0; }
.data-table tbody tr {
  height: 2rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.12s ease;
}
.data-table tbody tr:last-child { border-bottom: 0; }
.data-table tbody tr[data-clickable] { cursor: pointer; }
.data-table tbody tr:hover { background: color-mix(in oklab, var(--muted) 50%, transparent); }
.data-table tbody tr[data-selected] { background: color-mix(in oklab, var(--muted) 70%, transparent); }
.data-table td {
  padding: 0.375rem 0.5rem;
  vertical-align: middle; white-space: nowrap;
  border-right: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
  overflow: hidden; text-overflow: ellipsis;
}
.data-table td:last-child { border-right: 0; }
.data-table .cell-actions { text-align: center; }

/* Empty state: a sticky sibling of the table, NOT a colSpan row — a wide
   colSpan row scrolls the message off-screen horizontally. */
.table-empty {
  position: sticky; left: 0; right: 0;
  display: flex; height: 10rem; align-items: center; justify-content: center;
  font-size: 0.875rem; color: var(--muted-foreground);
}

/* Pagination footer (AppTableFooter) */
.table-footer {
  position: sticky; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
  background: var(--background);
  padding: 0.75rem 1rem;
}
.table-footer-count { white-space: nowrap; font-size: 0.75rem; color: var(--muted-foreground); }
.table-footer-size  { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.table-footer-pages { display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem; }

.page-link {
  display: inline-flex; min-width: 2rem; height: 2rem;
  align-items: center; justify-content: center; gap: 0.25rem;
  padding: 0 0.5rem;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 0.75rem; font-weight: 500;
  transition: all 0.15s ease;
}
.page-link:hover { background: var(--muted); }
.page-link[data-active] { border-color: var(--border); background: var(--background); box-shadow: var(--shadow-sm); }
.page-link[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }

/* ==========================================================================
   11. Form controls — ui/input.tsx, ui/select.tsx, ui/input-group.tsx
   ========================================================================== */
.input, .select {
  display: flex; height: 2rem; width: 100%; align-items: center;
  padding: 0 0.625rem;
  border: 1px solid var(--input); border-radius: var(--radius-lg);
  background: var(--background); color: var(--foreground);
  font-size: 0.75rem;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.input:focus-visible, .select:focus-visible {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}
.input::placeholder { color: var(--muted-foreground); }
.input:disabled, .select:disabled { opacity: 0.5; cursor: not-allowed; }
.dark .input, .dark .select { background: color-mix(in oklab, var(--input) 30%, transparent); }

.select { appearance: none; padding-right: 1.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 0.875rem;
}
.select--sm { height: 1.75rem; min-width: 4.5rem; font-size: 0.75rem; }

textarea.input { height: auto; min-height: 4.5rem; padding: 0.5rem 0.625rem; line-height: 1.25rem; resize: vertical; }

/* Search input group */
.input-group { position: relative; display: flex; width: 100%; max-width: 24rem; align-items: center; }
.input-group svg { position: absolute; left: 0.625rem; width: 0.875rem; height: 0.875rem; color: var(--muted-foreground); pointer-events: none; }
.input-group .input { padding-left: 1.875rem; }

/* Field / FieldGroup (ui/field.tsx) */
.field { display: flex; flex-direction: column; gap: 0.375rem; }
.field-label { font-size: 0.75rem; font-weight: 500; }
.field-label .req { color: var(--destructive); }
.field-hint { font-size: 0.6875rem; color: var(--muted-foreground); }
.field-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px)  { .field-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1280px) { .field-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.field--full { grid-column: 1 / -1; }

/* Checkbox */
.checkbox {
  display: inline-flex; width: 1rem; height: 1rem; flex-shrink: 0;
  align-items: center; justify-content: center;
  border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--background); color: transparent;
}
.checkbox[data-checked] { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.checkbox svg { width: 0.75rem; height: 0.75rem; }

/* ==========================================================================
   12. Shared blocks used by the lifecycle mocks
   ========================================================================== */

/* Split layout: list + detail panel.
   The row needs overflow-hidden to bound the flex chain, and each panel needs
   `flex flex-col overflow-hidden` so its inner body can scroll. */
.split-row { display: flex; min-height: 0; flex: 1; gap: 1rem; overflow: hidden; }
.split-main { display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
.split-side {
  display: none; width: 24rem; flex-shrink: 0; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card);
}
@media (min-width: 1024px) { .split-side { display: flex; } }
.split-side-head { flex-shrink: 0; border-bottom: 1px solid var(--border); padding: 0.875rem 1rem; }
.split-side-body { min-height: 0; flex: 1; overflow-y: auto; padding: 1rem; }
.split-side-foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: 0.75rem 1rem; }

/* A bordered sub-panel. shrink-0 is deliberate: an overflow-hidden flex child
   inside a scrollable flex column collapses to its border height without it. */
.subpanel {
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.subpanel-head {
  display: flex; align-items: center; gap: 0.75rem;
  background: color-mix(in oklab, var(--muted) 50%, transparent);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 0.875rem;
}
.subpanel-title { font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.01em; }
.subpanel-body { padding: 0.25rem 0; }

/* Progress bar */
.progress { height: 0.375rem; width: 100%; overflow: hidden; border-radius: 9999px; background: var(--muted); }
.progress-fill { height: 100%; border-radius: 9999px; background: var(--primary); transition: width 0.3s ease; }
.dark .progress-fill { background: color-mix(in srgb, var(--primary) 100%, white 25%); }
.progress--ok .progress-fill { background: var(--ok-fg); }
.progress-inline { display: flex; align-items: center; gap: 0.5rem; }
.progress-inline .progress { width: 3.5rem; }
.progress-label { font-size: 0.6875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* Checklist item row */
.check-row {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}
.check-row:last-child { border-bottom: 0; }
.check-row[data-readonly] { opacity: 0.6; }
.check-row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.1875rem; }
.check-row-label { font-size: 0.8125rem; font-weight: 500; line-height: 1.25rem; }
.check-row-meta  { font-size: 0.6875rem; color: var(--muted-foreground); line-height: 1rem; }
.check-row-side  { display: flex; flex-shrink: 0; align-items: center; gap: 0.5rem; }

.state-dot {
  display: flex; width: 1.25rem; height: 1.25rem; flex-shrink: 0; margin-top: 0.125rem;
  align-items: center; justify-content: center;
  border-radius: 9999px;
}
.state-dot--done    { background: var(--ok-bg);   color: var(--ok-fg); }
.state-dot--pending { background: var(--warn-bg); color: var(--warn-fg); }
.state-dot--todo    { background: var(--muted);   color: var(--muted-foreground); }
.state-dot--blocked { background: color-mix(in oklab, var(--destructive) 12%, transparent); color: var(--destructive); }
.state-dot svg { width: 0.75rem; height: 0.75rem; }

/* Owner chip on a section header */
.owner-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgb(var(--primary-rgb) / 0.08); color: var(--primary);
  font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
}
.dark .owner-chip { background: rgb(var(--primary-rgb) / 0.25); color: var(--primary-foreground); }
.owner-chip--muted { background: var(--muted); color: var(--muted-foreground); }

/* Callout / notice */
.callout {
  display: flex; gap: 0.625rem; flex-shrink: 0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-lg);
  font-size: 0.6875rem; line-height: 1.125rem;
}
.callout--info { background: rgb(var(--primary-rgb) / 0.06); color: var(--foreground); box-shadow: inset 0 0 0 1px rgb(var(--primary-rgb) / 0.15); }
.dark .callout--info { background: rgb(var(--primary-rgb) / 0.18); }
.callout--warn { background: var(--warn-bg); color: var(--warn-fg); }
.callout--ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.callout--danger {
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--destructive) 25%, transparent);
}
.callout svg { flex-shrink: 0; margin-top: 0.0625rem; }

/* Key/value list */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.75rem; }
.kv dt { color: var(--muted-foreground); white-space: nowrap; }
.kv dd { text-align: right; font-weight: 500; }

/* Activity timeline */
.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; display: flex; gap: 0.75rem; padding-bottom: 1rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: 0.59375rem; top: 1.375rem; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  display: flex; width: 1.25rem; height: 1.25rem; flex-shrink: 0;
  align-items: center; justify-content: center;
  border-radius: 9999px;
  background: var(--muted); color: var(--muted-foreground);
  z-index: 1;
}
.timeline-dot svg { width: 0.6875rem; height: 0.6875rem; }
.timeline-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.125rem; }
.timeline-text { font-size: 0.75rem; line-height: 1.125rem; }
.timeline-time { font-size: 0.625rem; color: var(--muted-foreground); }

/* Vertical stepper (used by the employee self-service form) */
.stepper { display: flex; flex-direction: column; gap: 0.25rem; }
.stepper-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-lg);
  font-size: 0.75rem; font-weight: 500; text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.stepper-item:hover { background: var(--muted); }
.stepper-item[data-active] { background: rgb(var(--primary-rgb) / 0.1); color: var(--primary); }
.dark .stepper-item[data-active] { background: rgb(var(--primary-rgb) / 0.2); color: var(--primary-foreground); }
.stepper-num {
  display: flex; width: 1.25rem; height: 1.25rem; flex-shrink: 0;
  align-items: center; justify-content: center;
  border-radius: 9999px;
  background: var(--muted); color: var(--muted-foreground);
  font-size: 0.625rem; font-weight: 600;
}
.stepper-item[data-active] .stepper-num { background: var(--primary); color: var(--primary-foreground); }
.stepper-num--done { background: var(--ok-bg); color: var(--ok-fg); }
.stepper-num--done svg { width: 0.6875rem; height: 0.6875rem; }

/* File upload row */
.upload {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px dashed color-mix(in oklab, var(--border) 90%, transparent);
  border-radius: var(--radius-lg);
}
.upload-name { min-width: 0; flex: 1; }
.file-chip {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 0.6875rem;
}

/* Breadcrumb / back link */
.crumbs { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--muted-foreground); }
.crumbs a:hover { color: var(--foreground); text-decoration: underline; }
.crumbs svg { width: 0.75rem; height: 0.75rem; }

/* Small stat tile row */
.stat-row { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0,1fr)); flex-shrink: 0; }
@media (min-width: 1024px) { .stat-row { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm), 0 0 0 1px color-mix(in oklab, var(--border) 70%, transparent);
}
.dark .stat { background: color-mix(in oklab, var(--card) 75%, transparent); }
.stat-label { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); }
.stat-value { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 0.6875rem; color: var(--muted-foreground); }

/* Employee identity block */
.identity { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.identity-name { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.02em; }
.identity-meta { font-size: 0.6875rem; color: var(--muted-foreground); }

/* Skill chip. Recruitment screens show an expertise level 1–5 alongside the
   skill name (BRD §3.2), so the level rides inside the chip as filled dots. */
.skill {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--radius-sm);
  background: var(--muted); color: var(--foreground);
  font-size: 0.625rem; white-space: nowrap;
}
.skill-lvl { display: inline-flex; gap: 0.09375rem; }
.skill-lvl i {
  width: 0.25rem; height: 0.25rem; border-radius: 9999px;
  background: color-mix(in oklab, var(--muted-foreground) 35%, transparent);
}
.skill-lvl i[data-on] { background: var(--primary); }
.dark .skill-lvl i[data-on] { background: color-mix(in srgb, var(--primary) 100%, white 35%); }

/* Plain chip with no level (key skills on a hiring request) */
.chip {
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-sm);
  background: var(--muted); color: var(--muted-foreground);
  font-size: 0.625rem; white-space: nowrap;
}
.chip-row { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }

/* Two-line table cell */
.cell-stack { display: flex; flex-direction: column; gap: 0.0625rem; min-width: 0; }
.cell-stack .primary { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.cell-stack .secondary { font-size: 0.6875rem; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   13. Dialog / sheet — ui/dialog.tsx
   --------------------------------------------------------------------------
   Toggled by shell.js via [data-dialog-open] / [data-dialog-close].
   The body uses the FieldGroup pattern: a scrollable flex column, so any
   bordered overflow-hidden panel inside it needs shrink-0 (see .subpanel).
   ========================================================================== */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 1rem;
  background: color-mix(in oklab, var(--foreground) 45%, transparent);
  backdrop-filter: blur(2px);
}
.dialog-backdrop[data-open="true"] { display: flex; }

.dialog {
  display: flex; width: 100%; max-width: 34rem; max-height: 90vh; flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--popover); color: var(--popover-foreground);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
}
.dialog--wide { max-width: 44rem; }

.dialog-head {
  display: flex; flex-shrink: 0; align-items: flex-start; gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.dialog-title { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.02em; }
.dialog-desc  { margin-top: 0.125rem; font-size: 0.75rem; color: var(--muted-foreground); }
.dialog-close { margin-left: auto; }

/* FieldGroup: scrollable flex column */
.dialog-body {
  display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 1.25rem;
  overflow-y: auto;
  padding: 1.25rem;
}
.dialog-foot {
  display: flex; flex-shrink: 0; align-items: center; justify-content: flex-end; gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
}
.dialog-foot--split { justify-content: space-between; }

/* ==========================================================================
   14. Switch — ui/switch.tsx
   ========================================================================== */
.switch {
  position: relative;
  display: inline-flex; width: 2rem; height: 1.125rem; flex-shrink: 0;
  align-items: center;
  padding: 0.125rem;
  border-radius: 9999px;
  background: color-mix(in oklab, var(--muted-foreground) 40%, transparent);
  transition: background-color 0.15s ease;
}
.switch::after {
  content: ''; display: block;
  width: 0.875rem; height: 0.875rem;
  border-radius: 9999px; background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.switch[data-checked] { background: var(--primary); }
.switch[data-checked]::after { transform: translateX(0.875rem); }
.switch[data-disabled] { opacity: 0.5; }

.switch-field {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.switch-field-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.0625rem; }

/* ==========================================================================
   15. Letter preview — used by the offer generator and the MD review
   --------------------------------------------------------------------------
   A rendered document, not a form. Values merged from the template are marked
   with .var so HR and the MD can see at a glance which figures came from the
   system and which were typed.
   ========================================================================== */
.letter {
  overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background);
}
.letter-page {
  display: flex; flex-direction: column; gap: 0.875rem;
  padding: 1.5rem;
  font-size: 0.75rem; line-height: 1.375rem;
}
.letter-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
}
.letter-logo { height: 1.5rem; width: auto; max-width: 130px; object-fit: contain; }
.dark .letter-logo { filter: brightness(0) invert(1); }
.letter-ref { text-align: right; font-size: 0.6875rem; color: var(--muted-foreground); }
.letter-title {
  font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em;
  text-transform: uppercase;
}
.letter p { margin: 0; }
.letter-terms { display: flex; flex-direction: column; gap: 0.375rem; margin: 0.25rem 0; }
.letter-term { display: flex; gap: 0.75rem; }
.letter-term dt { width: 9.5rem; flex-shrink: 0; color: var(--muted-foreground); }
.letter-term dd { font-weight: 500; }

/* A value merged from the candidate / finalisation record */
.var {
  padding: 0 0.1875rem;
  border-radius: 2px;
  background: rgb(var(--primary-rgb) / 0.1);
  box-shadow: 0 1px 0 rgb(var(--primary-rgb) / 0.35);
  font-weight: 500;
}
.dark .var { background: rgb(var(--primary-rgb) / 0.35); }

.letter-sign {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem;
  margin-top: 0.5rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
}
.sign-block { display: flex; flex-direction: column; gap: 0.375rem; min-width: 12rem; }
.sign-slot {
  display: flex; height: 3rem; align-items: center; justify-content: center;
  border: 1px dashed color-mix(in oklab, var(--border) 90%, transparent);
  border-radius: var(--radius-md);
  font-size: 0.625rem; color: var(--muted-foreground);
}
.sign-slot[data-signed] {
  border-style: solid; border-color: color-mix(in oklab, var(--ok-fg) 45%, transparent);
  background: var(--ok-bg); color: var(--ok-fg);
  gap: 0.375rem; font-weight: 600;
}
.sign-slot svg { width: 0.875rem; height: 0.875rem; }
.sign-name { font-size: 0.6875rem; font-weight: 500; }
.sign-role { font-size: 0.625rem; color: var(--muted-foreground); }

/* Version pill for offer re-issues */
.version {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-sm);
  background: var(--muted); color: var(--muted-foreground);
  font-size: 0.625rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.version svg { width: 0.625rem; height: 0.625rem; }

/* Mock-only ribbon so reviewers know these are static designs */
.mock-ribbon {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 1.5rem;
  background: var(--warn-bg); color: var(--warn-fg);
  font-size: 0.6875rem; font-weight: 500;
}
.mock-ribbon svg { width: 0.75rem; height: 0.75rem; }
.mock-ribbon a { text-decoration: underline; }
