/* ============================================================
   SICIP Support — stylesheet
   Skills for Industry Competitiveness and Innovation Program
   ------------------------------------------------------------
   Theme derived from the SICIP logo (public/images/logo.png):
     navy   #03004F  — the "SICIP" wordmark   → primary, text, chrome
     orange #FF731E  — the bulb and gear      → accent, calls to action
   Contrast rules (WCAG 2.1 AA, verified — see docs/13-ui-theme.md):
     • brand orange is NEVER used for text on white (2.7:1); orange
       text uses --orange-700 (5.2:1), orange buttons use navy text.
     • every text/background pair below is ≥ 4.5:1.

   Plain CSS on purpose — no build step, no npm install needed.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* ---- brand: navy (logo wordmark) ---- */
  --navy-950: #02003a;
  --navy-900: #03004f;          /* logo */
  --navy-800: #0f0b63;
  --navy-700: #1c1776;
  --navy-600: #3b35a8;
  --navy-500: #5a55c0;
  --navy-300: #b9b8e0;
  --navy-200: #d9d8f0;
  --navy-100: #ececf8;
  --navy-50:  #f5f5fc;

  /* ---- brand: orange (logo bulb) ---- */
  --orange-500: #ff731e;        /* logo */
  --orange-600: #ec5f0a;
  --orange-700: #c2410c;        /* text-safe orange */
  --orange-800: #9a3412;
  --orange-200: #ffd0b0;
  --orange-100: #ffe6d4;
  --orange-50:  #fff4ec;

  /* ---- neutrals (cool, navy-tinted) ---- */
  --ink:        #1c1b3a;
  --text-muted: #5e5d7a;
  --line:       #e4e4ef;
  --line-strong:#cfcfe0;
  --canvas:     #f6f6fb;
  --surface:    #ffffff;
  --surface-2:  #fafafe;

  /* ---- semantic ---- */
  --success: #146c43; --success-bg: #e3f4ea; --success-line: #b5dfc6;
  --danger:  #b42318; --danger-bg:  #fdecea; --danger-line:  #f3c1bb;
  --info:    #1e4fb8; --info-bg:    #e6edfb;

  /* ---- ticket status ---- */
  --st-submitted: #55546f;   --st-submitted-bg: #f0f0f6;
  --st-accepted:  #1e4fb8;   --st-accepted-bg:  #e6edfb;
  --st-assigned:  #5b3cc4;   --st-assigned-bg:  #eee9fb;
  --st-progress:  #b4410a;   --st-progress-bg:  #ffeedf;
  --st-completed: #17784a;   --st-completed-bg: #e3f4ea;
  --st-closed:    #4a4966;   --st-closed-bg:    #ececf3;
  --st-reopened:  #b42318;   --st-reopened-bg:  #fdecea;

  /* ---- priority ---- */
  --pr-low: #5e5d7a; --pr-medium: #1e4fb8; --pr-high: #c2410c; --pr-urgent: #b42318;

  /* ---- type ---- */
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* ---- shape & depth ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(3, 0, 79, 0.06);
  --shadow-card: 0 1px 2px rgba(3, 0, 79, 0.05), 0 4px 16px rgba(3, 0, 79, 0.05);
  --shadow-raised: 0 12px 40px rgba(3, 0, 79, 0.12), 0 2px 6px rgba(3, 0, 79, 0.06);
  --ring: 0 0 0 3px rgba(255, 115, 30, 0.35);
  --border-hairline: 1px solid var(--line);

  --max-width: 1200px;
  --sidebar-width: 264px;
  --topbar-height: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* ---- legacy aliases (older markup and inline styles) ---- */
  --color-ink: var(--ink);
  --color-slate-900: var(--navy-900);
  --color-slate-700: #3d3c5c;
  --color-slate-500: var(--text-muted);
  --color-slate-300: var(--line-strong);
  --color-slate-200: var(--line);
  --color-slate-100: var(--navy-50);
  --color-paper: var(--canvas);
  --color-paper-raised: var(--surface);
  --color-amber: var(--orange-700);
  --color-amber-soft: var(--orange-50);
  --color-amber-border: var(--orange-200);
  --color-danger: var(--danger);
  --color-danger-bg: var(--danger-bg);
  --color-success: var(--success);
  --color-success-bg: var(--success-bg);
  --color-status-accepted: var(--navy-600);
}

/* ============================================================ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--navy-900);
}
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.04rem; }

a { color: var(--navy-600); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--orange-600); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--orange-100); color: var(--navy-900); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; text-decoration: none; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ============================================================ layout */

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }
.container-wide { max-width: 1080px; }

.page { padding: 32px 0 72px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head p { margin: 6px 0 0; color: var(--text-muted); font-size: 0.92rem; max-width: 70ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--orange-700);
}

/* ---------------- public header ---------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: var(--border-hairline);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy-900); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 52px; width: auto; display: block; }
.brand-divider { width: 1px; height: 28px; background: var(--line-strong); }
.brand-product {
  font-family: var(--font-display); font-weight: 800; font-size: 1.02rem;
  letter-spacing: -0.01em; color: var(--navy-900); line-height: 1.1;
}
.brand-product small {
  display: block; font-family: var(--font-body); font-weight: 500;
  font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.02em;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; color: #3d3c5c;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: var(--navy-50); color: var(--navy-900); text-decoration: none; }
.nav a.is-active { background: var(--navy-100); color: var(--navy-900); }
.nav .btn { margin-left: 6px; }

/* ---------------- hero ---------------- */

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: #fff;
  background:
    radial-gradient(700px 320px at 88% -10%, rgba(255, 115, 30, 0.45), transparent 60%),
    radial-gradient(600px 300px at -10% 120%, rgba(90, 85, 192, 0.55), transparent 60%),
    linear-gradient(135deg, var(--navy-950), var(--navy-900) 45%, var(--navy-700));
  padding: 56px 0 104px;
}
.hero::after {           /* faint gear motif, echoing the logo */
  content: ''; position: absolute; right: -60px; top: 50%; width: 360px; height: 360px;
  transform: translateY(-50%); z-index: -1; opacity: .08;
  background: radial-gradient(circle, transparent 38%, #fff 39%, #fff 49%, transparent 50%),
              conic-gradient(from 0deg, #fff 0 8%, transparent 0 17%, #fff 0 25%, transparent 0 33%, #fff 0 42%, transparent 0 50%, #fff 0 58%, transparent 0 67%, #fff 0 75%, transparent 0 83%, #fff 0 92%, transparent 0);
  -webkit-mask: radial-gradient(circle, #000 58%, transparent 59%);
          mask: radial-gradient(circle, #000 58%, transparent 59%);
  border-radius: 50%;
}
.hero .eyebrow { color: var(--orange-200); }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); max-width: 22ch; margin-top: 10px; }
.hero p { color: rgba(255, 255, 255, 0.84); max-width: 62ch; margin: 14px 0 0; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero-compact { padding: 44px 0 88px; }

.hero-overlap { margin-top: -72px; position: relative; z-index: 2; }

/* ---------------- footer ---------------- */

.site-footer {
  background: var(--navy-950); color: rgba(255, 255, 255, 0.78);
  padding: 44px 0 28px; font-size: 0.86rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-logo {
  display: inline-block; background: #fff; border-radius: var(--radius-md);
  padding: 10px 14px; box-shadow: var(--shadow-xs);
}
.footer-logo img { height: 44px; display: block; }
.footer-title { color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin: 0 0 12px; }
.site-footer a { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------------- staff console shell ---------------- */

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: var(--border-hairline);
  display: flex; flex-direction: column; padding: 20px 16px;
}
.sidebar-brand { display: block; padding: 4px 8px 18px; border-bottom: var(--border-hairline); margin-bottom: 14px; }
.sidebar-brand img { height: 46px; display: block; }
.sidebar-brand span {
  display: block; margin-top: 8px; font-family: var(--font-display); font-weight: 800;
  font-size: 0.95rem; color: var(--navy-900);
}

.side-nav { display: grid; gap: 2px; }
.side-nav-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 12px 6px;
}
.side-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-md);
  color: #3d3c5c; font-weight: 600; font-size: 0.92rem;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.side-nav a:hover { background: var(--navy-50); color: var(--navy-900); text-decoration: none; }
.side-nav a.is-active { background: var(--navy-900); color: #fff; box-shadow: var(--shadow-xs); }
.side-nav a.is-active::before {
  content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--orange-500);
}
.side-nav .count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--orange-500); color: var(--navy-900); font-size: 0.72rem; font-weight: 800; text-align: center;
}

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: var(--border-hairline); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  color: var(--navy-900); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.02em;
}
.user-card strong { display: block; font-size: 0.88rem; line-height: 1.2; color: var(--navy-900); }
.user-card div > span { display: block; font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.sidebar-footer form { margin-top: 8px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-height);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(246, 246, 251, 0.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: var(--border-hairline);
}
.topbar-title { font-family: var(--font-display); font-weight: 700; color: var(--navy-900); font-size: 1rem; }
.topbar-title small { color: var(--text-muted); font-weight: 500; font-family: var(--font-body); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn.menu-toggle { display: none; }          /* .btn would otherwise show it on desktop */

.console { padding: 28px 28px 64px; max-width: 1320px; width: 100%; }

.sidebar-scrim { display: none; }

/* legacy user chip (kept for compatibility) */
.user-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.user-chip strong { font-size: 0.85rem; }
.user-chip span { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.04em; }

/* ============================================================ surfaces */

.card {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.card-body { padding: 24px; }
.card-head {
  padding: 16px 24px; border-bottom: var(--border-hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h3 { display: flex; align-items: center; gap: 10px; }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .grid > * > .card + .card:first-child { margin-top: 0; }   /* grid gap handles spacing */
.card-accent { border-top: 4px solid var(--orange-500); }
.card-raised { box-shadow: var(--shadow-raised); border-color: transparent; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-detail { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-aside { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 28px; }

/* ============================================================ signature: tracking stamp */

.tracking-stamp {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.92em; letter-spacing: 0.02em;
  color: var(--navy-900); background: var(--orange-50);
  border: 1.5px dashed var(--orange-500); border-radius: var(--radius-sm);
  padding: 0.28em 0.7em; white-space: nowrap;
}
.tracking-stamp-lg { font-size: 1.4rem; padding: 0.5em 1em; border-width: 2px; }

/* ============================================================ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; line-height: 1.2;
  border-radius: var(--radius-md); padding: 11px 18px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease),
              box-shadow .15s var(--ease), transform .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-700); color: #fff; }
.btn-accent { background: var(--orange-500); color: var(--navy-900); box-shadow: 0 6px 18px rgba(255, 115, 30, 0.28); }
.btn-accent:hover:not(:disabled) { background: var(--orange-600); color: var(--navy-900); }
.btn-secondary { background: var(--surface); color: var(--navy-900); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--navy-50); border-color: var(--navy-300); }
.btn-ghost { background: transparent; color: var(--navy-900); }
.btn-ghost:hover:not(:disabled) { background: var(--navy-50); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover:not(:disabled) { background: var(--orange-50); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.btn-outline-light:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: #fff; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }

.btn .spinner {
  width: 16px; height: 16px; border-radius: 50%; display: none;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn[aria-busy="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

input, select, textarea {
  font-family: var(--font-body); font-size: 0.94rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: 11px 13px; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2303004f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:hover, select:hover, textarea:hover { border-color: var(--navy-300); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange-500); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #8a89a3; }
input:disabled, select:disabled, textarea:disabled { background: var(--navy-50); color: var(--text-muted); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; padding: 0; accent-color: var(--navy-900); }
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field-invalid input, .field-invalid select, .field-invalid textarea,
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }

label { display: block; font-weight: 600; font-size: 0.86rem; color: var(--navy-900); margin-bottom: 7px; }
.field { margin-bottom: 20px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.field-error { color: var(--danger); font-size: 0.82rem; margin: 6px 0 0; font-weight: 500; }
.field-error::before { content: '⚠ '; }
.helper-text { color: var(--text-muted); font-size: 0.82rem; margin: 6px 0 0; }
.helper-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.char-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.char-count.is-low { color: var(--orange-700); font-weight: 600; }
.required { color: var(--danger); }

.input-group { position: relative; }
.input-group .input-action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; color: var(--text-muted);
  font-weight: 600; font-size: 0.8rem; padding: 6px 10px; border-radius: var(--radius-sm);
}
.input-group .input-action:hover { color: var(--navy-900); background: var(--navy-50); }
.input-group input { padding-right: 70px; }

.check { display: flex; align-items: center; gap: 10px; }
.check label { margin: 0; font-weight: 500; }

fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--navy-900);
  padding: 0; margin-bottom: 18px; width: 100%;
}

.inline-form { display: inline; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > * { flex: 1 1 160px; }
.form-row > .form-row-actions { flex: 0 0 auto; }

/* ---------------- multi-step form ---------------- */

.form-section { padding: 26px 28px; border-bottom: var(--border-hairline); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-head {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 14px; align-items: center;
  width: 100%; margin-bottom: 20px; padding: 0;
  float: left;              /* keeps the legend inside the fieldset's padding instead of on its border */
}
.form-section-head + * { clear: both; }
.form-section-head .step-num { grid-row: span 2; align-self: start; }
.form-section-head h2 { font-size: 1.08rem; }
.form-section-sub { grid-column: 2; margin-top: 3px; color: var(--text-muted); font-size: 0.86rem; font-family: var(--font-body); font-weight: 400; }
.step-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-900); color: #fff; font-weight: 800; font-size: 0.86rem; font-family: var(--font-display);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.form-section.is-complete .step-num { background: var(--orange-500); color: var(--navy-900); }
.form-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 20px 28px; background: var(--surface-2); border-top: var(--border-hairline);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.form-footer p { margin: 0; color: var(--text-muted); font-size: 0.84rem; max-width: 46ch; }

.stepper { display: grid; gap: 4px; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.stepper li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--radius-md); color: var(--text-muted); font-weight: 600; font-size: 0.88rem; }
.stepper li .step-num { width: 26px; height: 26px; font-size: 0.76rem; background: var(--navy-100); color: var(--navy-900); }
.stepper li.is-complete { color: var(--navy-900); }
.stepper li.is-complete .step-num { background: var(--orange-500); color: var(--navy-900); }

/* ---------------- file drop zone ---------------- */

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 26px 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface-2);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
  font-weight: 500; color: var(--text-muted); margin: 0;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--orange-500); background: var(--orange-50); }
.dropzone strong { color: var(--navy-900); }
.dropzone .icon { width: 30px; height: 30px; color: var(--orange-700); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone:focus-within { border-color: var(--orange-500); box-shadow: var(--ring); }

.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 0.86rem;
  background: var(--surface); border: var(--border-hairline); border-radius: var(--radius-md);
}
.file-list li .attachment-size { margin-left: auto; }
.file-list li.is-invalid { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger); }
.file-summary { font-size: 0.82rem; margin-top: 8px; color: var(--text-muted); }
.file-summary.is-invalid { color: var(--danger); font-weight: 600; }

/* ============================================================ tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); font-weight: 700; padding: 12px 16px;
  background: var(--surface-2); border-bottom: var(--border-hairline); white-space: nowrap;
}
thead th:first-child { border-top-left-radius: var(--radius-lg); }
thead th:last-child { border-top-right-radius: var(--radius-lg); }
td { padding: 14px 16px; border-bottom: var(--border-hairline); vertical-align: middle; }
/* Data tables keep one line per cell and scroll sideways on narrow screens
   instead of wrapping every word into a tall row. */
.table-wrap td { white-space: nowrap; }
.table-wrap td .muted, .table-wrap td small { font-size: 0.8rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.row-link { transition: background-color .12s var(--ease); }
tbody tr.row-link:hover { background: var(--navy-50); }
tr.muted td { color: var(--text-muted); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ============================================================ badges */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-SUBMITTED { color: var(--st-submitted); background: var(--st-submitted-bg); }
.badge-ACCEPTED { color: var(--st-accepted); background: var(--st-accepted-bg); }
.badge-ASSIGNED { color: var(--st-assigned); background: var(--st-assigned-bg); }
.badge-IN_PROGRESS { color: var(--st-progress); background: var(--st-progress-bg); }
.badge-COMPLETED { color: var(--st-completed); background: var(--st-completed-bg); }
.badge-CLOSED { color: var(--st-closed); background: var(--st-closed-bg); }
.badge-REOPENED { color: var(--st-reopened); background: var(--st-reopened-bg); }

.priority { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 700; }
.priority::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: currentColor; }
.priority-LOW { color: var(--pr-low); }
.priority-MEDIUM { color: var(--pr-medium); }
.priority-HIGH { color: var(--pr-high); }
.priority-URGENT { color: var(--pr-urgent); }
.priority-none { color: var(--text-muted); font-weight: 500; }
.priority-none::before { background: var(--line-strong); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 0.78rem; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* ============================================================ alerts */

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-md); padding: 14px 16px; font-size: 0.9rem;
  margin-bottom: 20px; border: 1px solid transparent; box-shadow: var(--shadow-xs);
  animation: alert-in .25s var(--ease);
}
.alert > div { flex: 1; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert-dismiss {
  background: transparent; border: 0; color: inherit; cursor: pointer; opacity: .7;
  font-size: 1.1rem; line-height: 1; padding: 2px 4px; border-radius: 4px;
}
.alert-dismiss:hover { opacity: 1; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ============================================================ misc content */

.meta-list { display: grid; gap: 16px; }
.meta-list div { display: grid; gap: 3px; }
.meta-list dt, .meta-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: 700;
}
.meta-list dd, .meta-value { margin: 0; font-size: 0.92rem; color: var(--ink); }

.stat { padding: 20px 22px; position: relative; overflow: hidden; }
.stat::after {
  content: ''; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%;
  background: var(--orange-50);
}
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; position: relative; z-index: 1; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: 8px; color: var(--navy-900); position: relative; z-index: 1; }

.prose { font-size: 0.95rem; line-height: 1.7; overflow-wrap: anywhere; }
.prose p { margin: 0 0 0.8em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 0.8em; padding-left: 20px; }
.prose code { font-family: var(--font-mono); font-size: 0.86em; background: var(--navy-50); padding: 1px 6px; border-radius: 4px; }
.prose blockquote { margin: 0 0 0.8em; padding-left: 14px; border-left: 3px solid var(--orange-200); color: #3d3c5c; }

.reply { padding: 18px 0; border-bottom: var(--border-hairline); }
.reply:last-child { border-bottom: none; padding-bottom: 0; }
.reply:first-child { padding-top: 0; }
.reply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.84rem; flex-wrap: wrap; }
.reply-author { font-weight: 700; color: var(--navy-900); }
.reply-role {
  font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  color: var(--navy-700); background: var(--navy-100); border-radius: 999px; padding: 2px 8px;
}
.reply-time { color: var(--text-muted); margin-left: auto; }
.reply-submitter { background: var(--orange-50); border-radius: var(--radius-md); padding: 14px 16px !important; margin: 6px 0; border-bottom: 0; }
.reply-submitter .reply-role { background: var(--orange-100); color: var(--orange-800); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-event { position: relative; padding-bottom: 20px; }
.timeline-event:last-child { padding-bottom: 0; }
.timeline-event::before {
  content: ''; position: absolute; left: -26px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--orange-500);
}
.timeline-event:last-child::before { background: var(--orange-500); }
.timeline-action { font-weight: 700; font-size: 0.9rem; color: var(--navy-900); }
.timeline-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.timeline-note { margin-top: 6px; font-size: 0.86rem; background: var(--navy-50); border-radius: var(--radius-md); padding: 8px 12px; }

/* ---------------- ticket progress (public tracking) ---------------- */

.progress-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; counter-reset: p; }
.progress-track li { position: relative; text-align: center; font-size: 0.76rem; font-weight: 600; color: var(--text-muted); padding-top: 38px; }
.progress-track li::before {
  counter-increment: p; content: counter(p);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--text-muted); font-weight: 800; font-size: 0.78rem;
}
.progress-track li::after {
  content: ''; position: absolute; top: 13px; left: calc(-50% + 14px); right: calc(50% + 14px); height: 2px; background: var(--line-strong);
}
.progress-track li:first-child::after { display: none; }
.progress-track li.is-done { color: var(--navy-900); }
.progress-track li.is-done::before { content: '✓'; background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.progress-track li.is-done::after, .progress-track li.is-current::after { background: var(--navy-900); }
.progress-track li.is-current { color: var(--navy-900); font-weight: 800; }
.progress-track li.is-current::before { background: var(--orange-500); border-color: var(--orange-500); color: var(--navy-900); box-shadow: 0 0 0 5px var(--orange-100); }

/* ---------------- lists, info blocks ---------------- */

.pagination { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 14px 22px; border-top: var(--border-hairline); flex-wrap: wrap; }
.pagination-info { font-size: 0.84rem; color: var(--text-muted); }
.pagination-links { display: flex; gap: 6px; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state h3 { color: var(--navy-900); margin-bottom: 8px; }
.empty-state::before {
  content: ''; display: block; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--orange-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%23c2410c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E") center no-repeat;
}

.bell { position: relative; display: inline-flex; }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--orange-500); color: var(--navy-900);
  font-size: 0.68rem; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--canvas);
}

.notification-row { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: var(--border-hairline); }
.notification-row:last-child { border-bottom: none; }
.notification-row.is-unread { font-weight: 600; }
.dot-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--orange-500); flex: none; box-shadow: 0 0 0 4px var(--orange-50); }

.chart-bar { display: grid; grid-template-columns: 170px 1fr 48px; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 0.86rem; }
.chart-bar:last-child { margin-bottom: 0; }
/* Both are spans so they can sit inside a grid row; without display:block the
   inline default would drop the height and the fill would never paint. */
.chart-track { display: block; background: var(--navy-50); border-radius: 999px; height: 10px; overflow: hidden; }
.chart-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--navy-900), var(--navy-600)); border-radius: 999px; }
.chart-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy-900); }

.attachment-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: var(--border-hairline); font-size: 0.87rem; }
.attachment-row:last-child { border-bottom: none; }
.attachment-size { margin-left: auto; color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.info-list li { display: flex; gap: 12px; font-size: 0.88rem; color: #3d3c5c; }
.info-list .info-icon {
  flex: none; width: 34px; height: 34px; border-radius: var(--radius-md); display: grid; place-items: center;
  background: var(--orange-50); color: var(--orange-700);
}
.info-list strong { display: block; color: var(--navy-900); font-size: 0.9rem; }

.callout {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius-lg);
  background: var(--orange-50); border: 1px solid var(--orange-200);
}
.callout .icon { color: var(--orange-700); margin-top: 2px; }
.callout + .card, .card + .callout { margin-top: 20px; }
.callout h3 { margin-bottom: 4px; }

.copy-btn { margin-left: 8px; }
.copy-btn[data-copied="true"] { color: var(--success); border-color: var(--success-line); }

.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.small { font-size: 0.84rem; }
.stack > * + * { margin-top: 14px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ============================================================ bulk actions (G9) */

.bulk-bar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-lg);
  background: var(--navy-900); color: #fff; box-shadow: var(--shadow-raised);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar select, .bulk-bar input { width: auto; min-width: 150px; padding: 8px 12px; }
.bulk-bar select { padding-right: 34px; }
.bulk-bar [data-for] { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.bulk-bar [data-for][hidden] { display: none; }
.bulk-bar .btn-ghost { color: #fff; }
.bulk-bar .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.bulk-count { margin-right: 6px; }
tr.is-selected td { background: var(--orange-50); }

/* ============================================================ live updates (G8) */

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; width: min(340px, calc(100vw - 40px)); }
.toast {
  display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--navy-900); color: #fff; box-shadow: var(--shadow-raised);
  border-left: 4px solid var(--orange-500); animation: alert-in .25s var(--ease);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.toast:hover { text-decoration: none; background: var(--navy-800); color: #fff; }
.toast strong { font-size: 0.9rem; }
.toast span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--navy-300); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
.live-banner {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 18px;
  background: var(--surface); border: 1px solid var(--orange-200); border-radius: 999px;
  box-shadow: var(--shadow-raised); font-weight: 600; color: var(--navy-900); font-size: 0.9rem;
}
.live-banner[hidden] { display: none; }

/* ============================================================ auth page */

.auth-wrap { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-panel {
  position: relative; overflow: hidden; color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 115, 30, 0.4), transparent 60%),
    linear-gradient(160deg, var(--navy-950), var(--navy-900) 55%, var(--navy-700));
}
.auth-panel h2 { color: #fff; font-size: 1.9rem; font-weight: 800; max-width: 18ch; }
.auth-panel p { color: rgba(255, 255, 255, 0.82); max-width: 44ch; }
.auth-panel .footer-logo { align-self: flex-start; }
.auth-panel .footer-logo img { height: 52px; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .page-head { display: block; }

/* ============================================================ responsive */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-detail { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { padding: 36px 24px; }

  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, var(--sidebar-width)); z-index: 60;
    transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-raised);
  }
  .app-shell.is-nav-open .sidebar { transform: none; }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: rgba(2, 0, 58, 0.45);
    opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
  }
  .app-shell.is-nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .console { padding: 20px 16px 56px; }
}

@media (max-width: 720px) {
  .site-header .container { height: 64px; }
  .brand-logo { height: 36px; }
  .brand-divider, .brand-product small { display: none; }
  .nav a span { display: none; }            /* icon-only links; each has an aria-label */
  .nav a, .nav .btn { padding: 9px; }
  .hero-actions .btn { white-space: normal; flex: 1 1 100%; }
  .helper-row { flex-wrap: wrap; gap: 0 12px; }
  .form-footer .btn { width: 100%; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .form-section, .form-footer { padding-left: 18px; padding-right: 18px; }
  .card-body { padding: 18px; }
  .hero { padding: 40px 0 92px; }
  .progress-track li { font-size: 0.66rem; }
  .chart-bar { grid-template-columns: 110px 1fr 40px; }
}

@media print {
  .site-header, .site-footer, .sidebar, .topbar, .hero-actions, .btn { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
