/* ============================================================================
   novelution-ace.css — Novelution NRMS design system (clean "Ace" track)
   ----------------------------------------------------------------------------
   A single, self-contained stylesheet that reproduces the Novelution NRMS look:
   Ace admin theme (Bootstrap 3 lineage) + Open Sans + Font Awesome 4.7, with the
   Novelution brand accent (#E9601A).

   This is the CANONICAL CLASS CONTRACT for the Novelution-Ace track. Every class
   referenced in the markdown docs and the worked examples in style-guide.html is
   defined here. Build new pages with these classes and they match current style.

   HOW TO LOAD (in <head>, in this order):
     <link rel="stylesheet" href="novelution-ace.css">
     <link rel="stylesheet" href="fonts/font-awesome-407.min.css">   <!-- icons -->

   Origin: merged + extended from the Novelution design-kit
   (subaward-extraction-prototype/src/design-system/{colors_and_type,nrms-ace}.css),
   with status chips translated from precheck-app/components/ui.tsx and new
   page-pattern classes (filter bar, pagination, tabs, modal, states).
   ========================================================================== */

/* ============================================================================
   1. FONTS  (Open Sans, bundled — no web upload needed beyond these + FA)
   ========================================================================== */
@font-face {
  font-family: 'Open Sans';
  font-style: normal; font-weight: 300;
  src: local('Open Sans Light'), url('fonts/OpenSans-Light.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  font-style: normal; font-weight: 400;
  src: local('Open Sans'), url('fonts/OpenSans-Regular.ttf') format('truetype');
  font-display: swap;
}

/* ============================================================================
   2. DESIGN TOKENS
   ========================================================================== */
:root {
  /* === Type families ============================================ */
  --font-ui:      'Open Sans', 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;
  --font-body:    'Open Sans', 'Tahoma', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  --font-mono:    Consolas, 'Courier New', monospace;

  /* === BRAND ==================================================== */
  --nov-orange:        #E9601A;   /* primary brand accent — headings, key links, active rail, primary CTA */
  --nov-orange-dark:   #C44E12;   /* hover / pressed orange */
  --nov-orange-tint:   #FDEDE3;   /* faint orange wash — hovered rows, soft labels, callouts */
  --nov-teal-link:     #006A89;   /* legacy secondary link (in-record links) */

  /* === ACE PRIMARY (app chrome accent) ========================== */
  --blue:              #2B7DBC;   /* Ace primary blue — widget titles, default skin accent */
  --blue-bright:       #438EB9;   /* skin accent / icon blue / focus ring */
  --blue-strong:       #337AB7;   /* Bootstrap-3 primary — action buttons & plain links */
  --blue-border:       #428BCA;   /* primary button border */
  --blue-hover:        #2671AC;   /* primary button hover */

  /* === SEMANTIC (Ace button / badge family) ===================== */
  --green:             #87B87F;   /* success */
  --green-strong:      #69AA46;
  --info:              #6FB3E0;   /* info */
  --orange-warn:       #FFB44B;   /* warning */
  --red:               #D15B47;   /* danger / error */
  --purple:            #9585BF;
  --pink:              #D6487E;
  --inverse:           #555555;   /* dark "inverse" button / scroll-up */
  --grey-btn:          #ABBAC3;   /* default grey button */

  /* === FEEDBACK / SOFT STATUS SURFACES ========================== */
  --ok-bg:    #EAF4E6; --ok-bd:    #CFE6C4; --ok-fg:    #3C763D;   /* satisfied / on-track */
  --bad-bg:   #F7E3E0; --bad-bd:   #E6C4BD; --bad-fg:   #A94442;   /* not satisfied / at-risk */
  --rev-bg:   #F3EEFB; --rev-bd:   #DED3F2; --rev-fg:   #6F5DA6;   /* needs review (purple) */
  --neu-bg:   #EEF1F4; --neu-bd:   #D8DEE4; --neu-fg:   #6B7178;   /* not checked / generic tag */
  --scope-bg: #E8EEF6; --scope-bd: #CDDDEF; --scope-fg: #2B5B8C;   /* scope / informational */
  --warn-bg:  #FCF8E3;
  --info-bg:  #D1ECF1;

  /* === NEUTRALS / SURFACES ====================================== */
  --fg1:               #2A2E33;   /* primary text */
  --fg2:               #555659;   /* secondary text / input text / labels */
  --fg3:               #8A8E92;   /* muted / meta */
  --fg-on-dark:        #FFFFFF;

  --bg-app:            #FFFFFF;   /* page / content surface */
  --bg-shell:          #F2F2F2;   /* main-container behind cards */
  --bg-sidebar:        #F4F5F7;   /* light sidebar surface */
  --bg-thead-soft:     #EDF1F5;   /* table header tint */
  --row-stripe:        #FAFBFC;   /* zebra row */

  /* === BORDERS / LINES ========================================== */
  --line:              #DDDDDD;   /* hairline */
  --line-strong:       #C9CDD2;
  --widget-line:       #D8E0E6;   /* widget-box border */
  --widget-header-line:#DCE3E9;

  /* === RADII (Ace is mostly square) ============================= */
  --radius-0:    0px;
  --radius-sm:   2px;
  --radius-md:   4px;     /* buttons, inputs, widget boxes — the default */
  --radius-lg:   6px;
  --radius-pill: 999px;   /* badges / pills */

  /* === SHADOWS / ELEVATION ====================================== */
  --shadow-card:   0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-raised: 0 2px 6px rgba(0,0,0,.12);
  --shadow-pop:    0 4px 16px rgba(0,0,0,.18);   /* dropdowns / modals */
  --shadow-navbar: 0 1px 4px rgba(0,0,0,.10);

  /* === SPACING (4px base grid) ================================== */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* === TYPE SCALE (app UI, px) ================================== */
  --fs-h1:   24px;   /* page-header h1 (light weight) */
  --fs-h2:   20px;
  --fs-h3:   17px;
  --fs-h4:   15px;   /* widget-title */
  --fs-base: 13px;   /* app body / table text */
  --fs-sm:   12px;   /* meta, secondary links */
  --fs-xs:   11px;   /* badges, footnotes */
}

/* ============================================================================
   3. BASE + SEMANTIC TYPOGRAPHY
   ========================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--fg1);
  background: var(--bg-shell);
}
a { color: var(--blue-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-ui); color: var(--fg1); margin: 0 0 .5em; }
.nov-h1, h1 { font-size: var(--fs-h1); font-weight: 300; line-height: 1.2; }  /* Ace headers are light */
.nov-h2, h2 { font-size: var(--fs-h2); font-weight: 400; }
.nov-h3, h3 { font-size: var(--fs-h3); font-weight: 600; }
.nov-h4, h4 { font-size: var(--fs-h4); font-weight: 600; }
.nov-display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.5px; color: var(--nov-orange); line-height: 1.1; }
.nov-link { color: var(--nov-orange); font-weight: 700; }
.nov-link--teal { color: var(--nov-teal-link); }
.nov-label { font-size: var(--fs-sm); font-weight: 600; color: var(--fg2); }
.nov-meta, .muted { font-size: var(--fs-sm); color: var(--fg3); }
.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.tabular { font-variant-numeric: tabular-nums; }

/* Small grey meta "tag" pill used for sponsor / mechanism / section labels */
.tag { display:inline-block; background: var(--neu-bg); color: var(--fg2);
  font-size: var(--fs-xs); font-weight: 600; padding: 2px 7px; border-radius: var(--radius-sm); }

/* ============================================================================
   4. LAYOUT  (app shell — top navbar + optional sidebar + content)
   ========================================================================== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.navbar {
  display:flex; align-items:center; gap: var(--sp-4);
  height: 48px; padding: 0 var(--sp-5);
  background: #fff; border-bottom: 1px solid var(--widget-line);
  box-shadow: var(--shadow-navbar);
}
.navbar .brand { display:flex; align-items:center; gap: var(--sp-2); font-weight:700; color: var(--fg1); }
.navbar .brand .fa { color: var(--nov-orange); font-size: 18px; }
.navbar .brand .brand-sub { font-size: var(--fs-xs); color: var(--fg3); font-weight: 400; }
.navbar .nav-links { display:flex; gap: var(--sp-4); margin-left: var(--sp-5); }
.navbar .nav-links a { color: var(--fg2); font-size: var(--fs-base); }
.navbar .nav-links a:hover, .navbar .nav-links a.active { color: var(--nov-orange); text-decoration:none; }
.navbar .nav-right { margin-left: auto; display:flex; align-items:center; gap: var(--sp-3); }
.navbar .avatar { width:28px; height:28px; border-radius: var(--radius-pill);
  background: var(--nov-orange-tint); color: var(--nov-orange-dark);
  display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size: var(--fs-sm); }

.main { flex:1; display:flex; align-items:flex-start; background: var(--bg-shell); }
.content { flex:1; min-width:0; }
.page { max-width: 1180px; margin: 0 auto; padding: var(--sp-5) var(--sp-6); }

/* Page header: title + actions on one row */
.page-header { display:flex; align-items:flex-end; justify-content:space-between;
  gap: var(--sp-4); border-bottom: 1px solid var(--line); padding: 4px 0 12px; margin: 0 0 16px; }
.page-header h1 { margin:0; }
.page-header .page-sub { font-size: var(--fs-sm); color: var(--fg3); }
.page-actions { display:flex; gap: var(--sp-2); flex-shrink:0; }

/* ============================================================================
   5. BREADCRUMBS
   ========================================================================== */
.breadcrumbs { display:flex; align-items:center; gap:6px; font-size: var(--fs-sm); color: var(--fg3);
  background:#fff; border-bottom:1px solid var(--line); padding: 8px 24px; }
.breadcrumbs a { color: var(--blue-strong); }
.breadcrumbs .fa-home { color: var(--blue-bright); }
.breadcrumbs .sep { color: var(--line-strong); }
.breadcrumbs .active { color: var(--fg2); font-weight:600; }

/* ============================================================================
   6. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: 13px; line-height: 1;
  padding: 7px 12px; border: 1px solid transparent; border-radius: var(--radius-md);
  cursor: pointer; color: #fff; background: var(--grey-btn); border-color: var(--grey-btn);
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn .fa { font-size: 13px; }
.btn:hover { filter: brightness(.94); color:#fff; text-decoration:none; }
.btn:active { filter: brightness(.88); }
.btn[disabled], .btn.disabled { opacity: .65; cursor: not-allowed; }
.btn-xs { padding: 3px 8px; font-size: 12px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 15px; }

.btn-primary { background: var(--blue-strong); border-color: var(--blue-border); }
.btn-primary:hover { background: var(--blue-hover); filter:none; }
.btn-success { background: var(--green-strong); border-color: var(--green-strong); }
.btn-info    { background: var(--info); border-color: var(--info); }
.btn-warning { background: var(--orange-warn); border-color: var(--orange-warn); }
.btn-danger  { background: var(--red); border-color: var(--red); }
.btn-inverse { background: var(--inverse); border-color: var(--inverse); }
.btn-brand   { background: var(--nov-orange); border-color: var(--nov-orange); }   /* primary CTA */
.btn-brand:hover { background: var(--nov-orange-dark); filter:none; }
.btn-default { background:#fff; color: var(--fg2); border-color: var(--line-strong); }
.btn-default:hover { background:#f6f7f8; filter:none; color: var(--fg1); }
/* Outline variants for low-emphasis row actions */
.btn-outline-brand  { background:#fff; color: var(--nov-orange); border-color: var(--nov-orange); }
.btn-outline-brand:hover { background: var(--nov-orange-tint); filter:none; color: var(--nov-orange-dark); }
.btn-outline-primary{ background:#fff; color: var(--blue-strong); border-color: var(--blue-strong); }
.btn-outline-primary:hover { background: #eef4fb; filter:none; }

.btn-group { display:inline-flex; gap: 4px; }

/* ============================================================================
   7. FORM CONTROLS
   ========================================================================== */
.form-group { margin-bottom: 12px; }
.control-label { display:block; font-size:12px; font-weight:600; color: var(--fg2); margin-bottom: 4px; }
.control-label .req { color: var(--red); margin-left: 2px; }   /* required marker */
.form-control {
  width: 100%; font-family: var(--font-ui); font-size: 13px; color: var(--fg1);
  padding: 6px 9px; background:#fff; border: 1px solid var(--line-strong);
  border-radius: var(--radius-md); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: var(--fg3); }
.form-control:focus { border-color: var(--blue-bright); box-shadow: 0 0 0 2px rgba(67,142,185,.18); }
.form-control:disabled { background: #f3f4f5; color: var(--fg3); }
textarea.form-control { min-height: 84px; resize: vertical; }
select.form-control {
  appearance:none; padding-right:30px;
  background-image:
    linear-gradient(45deg,transparent 50%,var(--fg3) 50%),
    linear-gradient(135deg,var(--fg3) 50%,transparent 50%);
  background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px;
  background-size:5px 5px,5px 5px; background-repeat:no-repeat;
}
.help-text { font-size: var(--fs-sm); color: var(--fg3); margin-top: 4px; }
.field-error { font-size: var(--fs-sm); color: var(--bad-fg); margin-top: 4px; }
.form-control.is-invalid { border-color: var(--red); }

/* search/keyword input with a leading or trailing icon */
.input-icon { position: relative; display:block; }
.input-icon .fa { position:absolute; right:10px; top:50%; transform:translateY(-50%); color:var(--fg3); }
.input-icon .form-control { padding-right: 30px; }
.input-icon.icon-left .fa { left:10px; right:auto; }
.input-icon.icon-left .form-control { padding-left: 30px; padding-right: 9px; }

/* horizontal form (label left, control right) */
.form-horizontal .form-group { display:flex; gap: var(--sp-4); align-items:flex-start; }
.form-horizontal .control-label { flex: 0 0 180px; text-align:right; padding-top:7px; margin:0; }
.form-horizontal .form-field { flex:1; min-width:0; }
.form-actions { display:flex; gap: var(--sp-2); padding-top: var(--sp-3); }
.form-actions.center { justify-content:center; }
.form-actions.sticky { position: sticky; bottom: 0; background:#fff;
  border-top:1px solid var(--line); padding: var(--sp-3); margin-top: var(--sp-3); }

/* two-column field grid for create/edit forms */
.field-grid { display:grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 720px){ .field-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   8. BADGES, LABELS & STATUS CHIPS
   ========================================================================== */
.badge {
  display:inline-block; font-size:11px; font-weight:600; line-height:1; color:#fff;
  padding:4px 9px; border-radius: var(--radius-pill); background: var(--grey-btn); white-space: nowrap;
}
.badge-primary{background:var(--blue)} .badge-success{background:var(--green-strong)}
.badge-info{background:var(--info)} .badge-warning{background:var(--orange-warn)}
.badge-danger{background:var(--red)} .badge-brand{background:var(--nov-orange)}

/* Generic chip base — squared (radius-md), bordered, icon + text. */
.chip { display:inline-flex; align-items:center; gap:6px; font-size: var(--fs-xs); font-weight:600;
  padding: 3px 8px; border-radius: var(--radius-md); border:1px solid transparent; white-space:nowrap; }
.chip .fa { font-size: 11px; }

/* Health badge (rounded pill + dot + faint "AI" marker) — from HealthBadge */
.health-badge { display:inline-flex; align-items:center; gap:6px; font-size: var(--fs-xs); font-weight:600;
  padding: 4px 10px; border-radius: var(--radius-pill); border:1px solid transparent; white-space:nowrap; }
.health-badge .dot { width:6px; height:6px; border-radius:var(--radius-pill); background: currentColor; }
.health-badge .ai { font-size:9px; text-transform:uppercase; opacity:.6; }
.health-badge.is-ontrack   { background:var(--ok-bg);  color:var(--ok-fg);  border-color:var(--ok-bd);  }
.health-badge.is-atrisk    { background:var(--bad-bg); color:var(--bad-fg); border-color:var(--bad-bd); }
.health-badge.is-submitted { background:var(--scope-bg); color:var(--scope-fg); border-color:var(--scope-bd); }
.health-badge.is-ontrack   .dot { background:var(--green-strong); }
.health-badge.is-atrisk    .dot { background:var(--red); }
.health-badge.is-submitted .dot { background:var(--blue-strong); }

/* Check status tag — from CheckStatusTag */
.check-tag { display:inline-flex; align-items:center; gap:6px; font-size: var(--fs-xs); font-weight:600;
  padding: 3px 8px; border-radius: var(--radius-md); border:1px solid transparent; white-space:nowrap; }
.check-tag.is-satisfied     { background:var(--ok-bg);  color:var(--ok-fg);  border-color:var(--ok-bd);  }
.check-tag.is-not-satisfied { background:var(--bad-bg); color:var(--bad-fg); border-color:var(--bad-bd); }
.check-tag.is-needs-review  { background:var(--rev-bg); color:var(--rev-fg); border-color:var(--rev-bd); }
.check-tag.is-not-checked   { background:var(--neu-bg); color:var(--neu-fg); border-color:var(--neu-bd); }

/* Type tag — from TypeTag */
.type-tag { display:inline-flex; align-items:center; gap:6px; font-size: var(--fs-xs); font-weight:600;
  padding: 3px 8px; border-radius: var(--radius-md); border:1px solid transparent; white-space:nowrap; }
.type-tag.is-scope          { background:var(--scope-bg); color:var(--scope-fg); border-color:var(--scope-bd); }
.type-tag.is-disqualification { background:var(--bad-bg); color:var(--bad-fg); border-color:var(--bad-bd); }

/* Provenance chip (soft orange — AI Extract / AI Analysis) — from ProvenanceChip */
.provenance-chip { display:inline-flex; align-items:center; gap:5px; font-size: var(--fs-xs); font-weight:600;
  padding: 2px 7px; border-radius: var(--radius-md); background: var(--nov-orange-tint); color: var(--nov-orange-dark); }

/* Completion bar — from CompletionBar */
.completion-bar { display:inline-flex; align-items:center; gap:8px; }
.completion-bar .bar { width:112px; height:8px; border-radius: var(--radius-pill); background:#e3e6ea; overflow:hidden; }
.completion-bar .fill { height:100%; background: var(--nov-orange); border-radius: var(--radius-pill); }
.completion-bar .count { font-size: var(--fs-xs); color: var(--fg3); font-variant-numeric: tabular-nums; }

/* ============================================================================
   9. WIDGET BOX (the core NRMS panel) + CARDS
   ========================================================================== */
.widget-box { background:#fff; border:1px solid var(--widget-line); border-radius: var(--radius-md);
  overflow:hidden; margin-bottom: var(--sp-5); }
.widget-header { display:flex; align-items:center; justify-content:space-between;
  padding: 9px 12px; background: linear-gradient(#fbfcfd,#f3f6f9); border-bottom: 1px solid var(--widget-header-line); }
.widget-title { font-size:15px; font-weight:400; color: var(--blue); display:flex; align-items:center; gap:8px; margin:0; }
.widget-title .fa { color: var(--blue-bright); }
.widget-toolbar { display:flex; align-items:center; gap:10px; color: var(--fg3); }
.widget-toolbar .fa { cursor:pointer; }
.widget-body { padding: 0; }
.widget-main { padding: 14px; }           /* use when the panel holds free content, not a flush table */

/* Dashboard cards */
.card-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
@media (max-width: 980px){ .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .card-grid { grid-template-columns: 1fr; } }
.card { background:#fff; border:1px solid var(--widget-line); border-radius: var(--radius-md);
  padding: var(--sp-4); box-shadow: var(--shadow-card); transition: box-shadow .15s ease, border-color .15s ease; }
.card:hover { border-color: rgba(233,96,26,.5); box-shadow: var(--shadow-raised); }
.card .card-title { font-size: 14px; font-weight:600; color: var(--fg1); margin: 6px 0; }
.card .card-meta { display:flex; align-items:center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--fg3); }
.card.card-new { border-style:dashed; border-color: var(--line-strong); display:flex;
  align-items:center; justify-content:center; color: var(--fg3); min-height: 120px; cursor:pointer; text-align:center; }
.card.card-new:hover { border-color: rgba(233,96,26,.5); color: var(--nov-orange); }

/* ============================================================================
   10. TABLES  (table.nrms — the results grid)
   ========================================================================== */
table.nrms { width:100%; border-collapse:collapse; font-size:13px; background:#fff; }
table.nrms thead th { text-align:left; font-weight:600; color: var(--fg2); font-size:12px;
  background: var(--bg-thead-soft); padding: 9px 12px; border-bottom:1px solid var(--line-strong); white-space:nowrap; }
table.nrms tbody td { padding: 9px 12px; border-bottom:1px solid var(--line); color: var(--fg1); vertical-align: top; }
table.nrms tbody tr:hover { background: var(--nov-orange-tint); }
table.nrms tbody tr:hover .row-menu { visibility: visible; }
table.nrms.striped tbody tr:nth-child(even) { background: var(--row-stripe); }
table.nrms.striped tbody tr:nth-child(even):hover { background: var(--nov-orange-tint); }
table.nrms tbody tr.is-selected { background: #fff7ef; }

/* sortable headers */
table.nrms thead th.sortable { cursor:pointer; user-select:none; }
table.nrms thead th.sortable .sort-caret { color: var(--fg3); margin-left:5px; font-size:11px; }
table.nrms thead th.sortable.asc  .sort-caret::before { content:"\f0de"; font-family:'FontAwesome'; color: var(--blue-strong); }
table.nrms thead th.sortable.desc .sort-caret::before { content:"\f0dd"; font-family:'FontAwesome'; color: var(--blue-strong); }
table.nrms thead th.sortable:not(.asc):not(.desc) .sort-caret::before { content:"\f0dc"; font-family:'FontAwesome'; }

/* sticky header for long results */
table.nrms.sticky thead th { position: sticky; top: 0; z-index: 1; }

/* row actions */
.row-actions { display:inline-flex; gap:4px; white-space:nowrap; }
.row-menu { visibility:hidden; color: var(--fg3); cursor:pointer; border:1px solid var(--line);
  width:26px; height:22px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--radius-sm); background:#fff; }
.row-menu:hover { color: var(--fg1); border-color: var(--line-strong); }

/* toolbar above a results table: count + bulk actions + page-size */
.table-toolbar { display:flex; align-items:center; gap: var(--sp-3); padding: 9px 12px;
  background:#fff; border-bottom:1px solid var(--line); font-size: var(--fs-sm); color: var(--fg2); }
.table-toolbar .result-count { font-weight:600; }
.table-toolbar .spacer { margin-left:auto; }

/* bulk-action bar (shown when rows are selected) */
.bulk-bar { display:flex; align-items:center; gap: var(--sp-3); padding: 8px 12px;
  background: var(--scope-bg); border-bottom:1px solid var(--scope-bd); color: var(--scope-fg); font-size: var(--fs-sm); }
.bulk-bar .count { font-weight:700; }

/* ============================================================================
   11. PAGINATION
   ========================================================================== */
.pager { display:flex; align-items:center; gap: var(--sp-3); padding: 10px 12px;
  background:#fff; border-top:1px solid var(--line); font-size: var(--fs-sm); color: var(--fg2); }
.pager .pager-info { color: var(--fg3); }
.pager .pager-pages { display:inline-flex; gap:4px; }
.pager .spacer { margin-left:auto; }
.page-btn { display:inline-flex; align-items:center; justify-content:center; min-width:28px; height:28px;
  padding:0 8px; border:1px solid var(--line-strong); background:#fff; color: var(--fg2);
  border-radius: var(--radius-sm); cursor:pointer; font-size: var(--fs-sm); }
.page-btn:hover { background:#f6f7f8; text-decoration:none; }
.page-btn.active { background: var(--blue-strong); border-color: var(--blue-border); color:#fff; }
.page-btn.disabled { opacity:.5; cursor:not-allowed; }
.page-size { display:inline-flex; align-items:center; gap:6px; }
.page-size select { padding:3px 6px; }

/* ============================================================================
   12. FILTER BAR  (the "search filters" pattern)
   ========================================================================== */
.filter-bar { display:flex; flex-wrap:wrap; align-items:flex-end; gap: var(--sp-3); }
.filter-field { display:flex; flex-direction:column; gap:4px; flex: 1 1 180px; min-width: 150px; }
.filter-field.grow { flex: 2 1 260px; }
.filter-field label { font-size:12px; font-weight:600; color: var(--fg2); }
.filter-field .form-control { width:100%; }
.filter-checkbox { display:flex; align-items:center; gap:6px; align-self:center; padding-bottom:7px;
  font-size: var(--fs-sm); color: var(--fg2); flex: 0 0 auto; }
.filter-actions { display:flex; gap: var(--sp-2); flex: 0 0 auto; padding-bottom:0; }

/* applied-filter chips (below the bar) */
.filter-chips { display:flex; flex-wrap:wrap; align-items:center; gap: var(--sp-2); margin-top: var(--sp-3); }
.filter-chips .label { font-size: var(--fs-sm); color: var(--fg3); }
.filter-chip { display:inline-flex; align-items:center; gap:6px; font-size: var(--fs-xs); font-weight:600;
  padding: 3px 6px 3px 9px; border-radius: var(--radius-pill); background: var(--neu-bg); color: var(--fg2); }
.filter-chip .remove { cursor:pointer; color: var(--fg3); border:0; background:none; padding:0; font-size:12px; }
.filter-chip .remove:hover { color: var(--bad-fg); }
.filter-chip .clear-all { color: var(--blue-strong); }

/* ============================================================================
   13. TABS  (top tab bar — pairs with sidebar .nav-list below)
   ========================================================================== */
.nav-tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); margin: 0 0 var(--sp-4); padding:0; list-style:none; }
.nav-tabs a, .nav-tabs > li > a { display:inline-flex; align-items:center; gap:6px; padding: 8px 14px;
  font-size: var(--fs-base); color: var(--fg2); border:1px solid transparent; border-bottom:0;
  border-radius: var(--radius-md) var(--radius-md) 0 0; text-decoration:none; }
.nav-tabs a:hover { background:#f6f7f8; }
.nav-tabs a.active, .nav-tabs > li.active > a { background:#fff; color: var(--nov-orange); font-weight:600;
  border-color: var(--line); border-bottom: 1px solid #fff; margin-bottom:-1px; }
.nav-tabs .tab-count { font-size: var(--fs-xs); font-weight:700; color: var(--nov-orange-dark);
  background: var(--nov-orange-tint); border-radius: var(--radius-pill); padding: 0 6px; }

/* ============================================================================
   14. SIDEBAR NAV-LIST  (left rail; also used as record-detail tab rail)
   ========================================================================== */
.nav-list { list-style:none; margin:0; padding:0; background: var(--bg-sidebar);
  border:1px solid var(--line); border-radius: var(--radius-md); overflow:hidden; width:230px; }
.nav-list > li { border-bottom:1px solid var(--line); }
.nav-list > li:last-child { border-bottom:0; }
.nav-list > li > a { display:flex; align-items:center; gap:10px; padding:10px 12px; color: var(--fg2); text-decoration:none; font-size:13px; }
.nav-list > li > a .menu-icon { width:16px; text-align:center; color: var(--fg3); }
.nav-list > li > a .count { margin-left:auto; font-size: var(--fs-xs); font-weight:700;
  color: var(--nov-orange-dark); background: var(--nov-orange-tint); border-radius: var(--radius-pill); padding: 0 6px; }
.nav-list > li:hover > a { background:#eef0f3; color: var(--fg1); text-decoration:none; }
.nav-list > li.active > a { background:#fff; color: var(--nov-orange); font-weight:600; box-shadow: inset 3px 0 0 var(--nov-orange); }
.nav-list > li.active > a .menu-icon { color: var(--nov-orange); }

/* ============================================================================
   15. ALERTS / FEEDBACK
   ========================================================================== */
.alert { display:flex; gap:9px; align-items:flex-start; font-size:13px; padding:10px 12px;
  border:1px solid; border-radius: var(--radius-md); margin-bottom: var(--sp-4); }
.alert .fa { margin-top:2px; }
.alert-success{ background:var(--ok-bg); border-color:var(--ok-bd); color:var(--ok-fg); }
.alert-info{ background:var(--info-bg); border-color:#bce3ea; color:#0c5460; }
.alert-warning{ background:var(--warn-bg); border-color:#f5e9c6; color:#8a6d3b; }
.alert-danger{ background:var(--bad-bg); border-color:var(--bad-bd); color:var(--bad-fg); }

/* ============================================================================
   16. MODAL / DIALOG
   ========================================================================== */
.modal-backdrop { position:fixed; inset:0; background: rgba(0,0,0,.35); display:flex;
  align-items:flex-start; justify-content:center; padding: 60px 16px; z-index: 1000; }
.modal { background:#fff; border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  width:100%; max-width: 560px; overflow:hidden; }
.modal-header { display:flex; align-items:center; justify-content:space-between;
  padding: 12px 16px; border-bottom:1px solid var(--line); }
.modal-title { font-size: var(--fs-h4); font-weight:600; color: var(--fg1); margin:0; }
.modal-close { background:none; border:0; color: var(--fg3); font-size:18px; cursor:pointer; line-height:1; }
.modal-close:hover { color: var(--fg1); }
.modal-body { padding: 16px; }
.modal-footer { display:flex; justify-content:flex-end; gap: var(--sp-2);
  padding: 12px 16px; border-top:1px solid var(--line); background:#fafbfc; }

/* ============================================================================
   17. STATES  (empty / loading / no-results)
   ========================================================================== */
.empty-state { text-align:center; color: var(--fg3); padding: 48px 24px; }
.empty-state .fa { font-size: 32px; color: var(--line-strong); margin-bottom: 12px; display:block; }
.empty-state .title { font-size: var(--fs-h4); color: var(--fg2); font-weight:600; margin-bottom: 6px; }
.empty-state .sub { font-size: var(--fs-sm); margin-bottom: 16px; }
.no-results td { text-align:center; color: var(--fg3); padding: 36px 12px; }

.skeleton { background: linear-gradient(90deg,#eee 25%,#f5f5f5 37%,#eee 63%);
  background-size: 400% 100%; animation: nov-shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
.skeleton-line { height: 12px; margin: 6px 0; }
@keyframes nov-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ============================================================================
   18. RECORD HEADER  (persistent detail-page header)
   ========================================================================== */
.record-header { background:#fff; border:1px solid var(--widget-line); border-radius: var(--radius-md);
  padding: var(--sp-5); margin-bottom: var(--sp-5); }
.record-header .tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom: 8px; }
.record-header .record-title { font-size: 22px; font-weight: 300; letter-spacing:-.2px; color: var(--fg1); margin:0; }
.record-header .record-meta { font-size: var(--fs-base); color: var(--fg3); margin-top: 4px; }
.record-header .record-top { display:flex; align-items:flex-start; justify-content:space-between; gap: var(--sp-4); }
.record-header .record-aside { display:flex; flex-direction:column; align-items:flex-end; gap:8px; flex-shrink:0; }

/* ============================================================================
   19. SMALL UTILITIES
   ========================================================================== */
.pull-right { margin-left:auto; }
.text-right { text-align:right; }
.flex { display:flex; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.items-center { align-items:center; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.stack > * + * { margin-top: var(--sp-3); }
.space { height: var(--sp-5); }
.nowrap { white-space:nowrap; }
