/* =========================================================================
   Noosa Kitchen — "Lagoon & Pass" design layer
   Loaded last. Cool tile-white pages, a deep lagoon rail, teal for actions,
   and one amber "pass light" that marks where you are.
   Type: Bricolage Grotesque (headings, figures) + IBM Plex Sans (everything else).
   ========================================================================= */

:root, [data-theme="swiss"] {
  --bg: #EEF2F1;
  --panel: #FFFFFF;
  --panel-border: #D5DEDC;
  --panel-border-subtle: #E8EEEC;
  --input-bg: #FFFFFF;
  --header-bg: #0E2A31;

  --text: #0E2A31;
  --text-dim: #4D6B70;
  --text-muted: #7F9599;

  --accent: #0B766F;
  --accent-hover: #095E58;
  --accent-surface: #E3F1EF;
  --accent-border: #A9D3CE;

  --pass: #F2A31B;           /* the single spot colour: current location, focus */
  --ok: #2B7A4B;
  --ok-surface: #E1F0E6;
  --warn: #9A5B00;
  --warn-surface: #FCEFD3;
  --err: #B5302A;
  --err-surface: #FBE6E3;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 9999px;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: 0 18px 48px -12px rgba(14, 42, 49, .35);

  --font-display: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Sans', system-ui, sans-serif;

  --max-width: 1240px;
  --container-max-width: 1240px;

  --sidebar-bg: #0E2A31;
  --sidebar-w: 244px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

/* ---- type ---------------------------------------------------------------- */
h1, .h1, h2, .h2, [data-theme="swiss"] h1, [data-theme="swiss"] h2 {
  font-family: var(--font-display);
  color: var(--text);
  text-transform: none;
}
h1, .h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variation-settings: 'wdth' 90;
  margin: 0 0 8px;
}
h2, .h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.subtitle { max-width: 62ch; color: var(--text-dim); font-size: 14.5px; margin: 0 0 28px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--pass); outline-offset: 2px; }

.wrap, [data-theme="swiss"] .wrap { max-width: var(--max-width); padding: 36px 36px 96px; margin: 0 auto; }

/* ---- sections: flat sheets, no shadows ------------------------------------ */
.panel, .stat-card, [data-theme="swiss"] .panel, [data-theme="swiss"] .stat-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: none;
}
.panel { padding: 24px 26px; margin-bottom: 20px; }
.panel-header { margin-bottom: 18px; }

/* ---- controls ------------------------------------------------------------- */
label { font-size: 13px; font-weight: 600; color: var(--text); }
input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="search"], input[type="email"], input[type="time"], select, textarea {
  background: var(--input-bg);
  border: 1px solid #B9C7C5;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 14px;
  color: var(--text);
}
input:hover, select:hover, textarea:hover { border-color: #8CA3A1; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-surface), 0 0 0 4px var(--accent);
  outline: none;
}
.field-hint { color: var(--text-dim); }

.btn, [data-theme="swiss"] .btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  transform: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover, [data-theme="swiss"] .btn:hover {
  background: var(--accent-hover); border-color: var(--accent-hover); color: #fff;
  transform: none; box-shadow: none; text-decoration: none;
}
.btn.secondary, [data-theme="swiss"] .btn.secondary {
  background: var(--panel); color: var(--text); border: 1px solid #B9C7C5;
}
.btn.secondary:hover, [data-theme="swiss"] .btn.secondary:hover {
  background: var(--accent-surface); border-color: var(--accent); color: var(--accent-hover);
}
.btn:disabled { opacity: .45; }

/* ---- tables --------------------------------------------------------------- */
table { font-size: 14px; }
th, [data-theme="swiss"] table th {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  background: transparent;
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--text);
}
td, [data-theme="swiss"] table td {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--panel-border-subtle);
}
tr:hover td { background: #F6F9F8; }
td.num, th.num, .mono-cell { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
a.row-link:hover, button.row-link:hover { color: var(--accent); }

/* ---- figures: one connected strip instead of loose cards ------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--panel-border);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}
.kpi-grid > .stat-card { border: 0; border-radius: 0; padding: 18px 22px 20px; }
.stat-card:hover { border-color: var(--panel-border); box-shadow: none; }
[data-theme="swiss"] .stat-card { border-left: 0; }
.stat-card .stat-label {
  font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--text-dim); margin-bottom: 6px;
}
.stat-card .stat-value, [data-theme="swiss"] .stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
  font-variation-settings: 'wdth' 90;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
}

/* ---- status --------------------------------------------------------------- */
.badge, .status { font-size: 12.5px; padding: 2px 9px; border-radius: var(--radius-sm); font-weight: 600; }
.status.success, .badge.in-stock { background: var(--ok-surface); color: var(--ok); }
.status.running, .badge.low-stock { background: var(--warn-surface); color: var(--warn); }
.status.failed, .badge.out-stock { background: var(--err-surface); color: var(--err); }
.flash { border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; border-left-width: 4px; }
.flash.error { border-color: var(--err); border-left-color: var(--err); }
.flash.success { border-color: var(--ok); border-left-color: var(--ok); }
.flash.info { background: var(--accent-surface); color: var(--accent-hover); border-color: var(--accent-border); border-left-color: var(--accent); }
.banner-warn { border-left: 4px solid var(--pass); color: #5C3A00; border-radius: var(--radius-sm); }
.empty { color: var(--text-dim); padding: 40px 16px; }

/* ---- tabs: underline, like a ledger index --------------------------------- */
.tabs, .tabs-modern { gap: 22px; border-bottom: 1px solid var(--panel-border); padding-bottom: 0; margin-bottom: 22px; }
.tab-btn, [data-theme="swiss"] .tab-btn {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0;
  padding: 10px 0; margin: 0; border-radius: 0; background: transparent; color: var(--text-dim);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { background: transparent; color: var(--text); }
.tab-btn.active, [data-theme="swiss"] .tab-btn.active {
  background: transparent; color: var(--text); border-bottom: 3px solid var(--pass);
}
.req-filter-chip { border-radius: var(--radius-sm); font-size: 13.5px; }
.req-filter-chip.active { color: var(--text); background: var(--accent-surface); border-color: var(--accent); }
.req-filter-chip.active .count { background: var(--text); }

/* ---- modal ---------------------------------------------------------------- */
.modal-backdrop { background: rgba(14, 42, 49, .6); backdrop-filter: none; }
.modal { border-radius: var(--radius-lg); border: 0; }
.modal-header h2 { font-size: 20px; }

/* ---- sign-in -------------------------------------------------------------- */
.login-wrap { max-width: 400px; margin: 12vh auto 0; }
.login-wrap h1 { font-size: 40px; }

/* ---- rail (sidebar) ------------------------------------------------------- */
.sidebar, [data-theme="swiss"] .sidebar {
  background: var(--sidebar-bg);
  border-right: 0;
  color: #CFE0DE;
}
.sidebar .brand, [data-theme="swiss"] .sidebar .brand {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 700; letter-spacing: -0.02em; text-transform: none; color: #fff;
  font-variation-settings: 'wdth' 90;
}
.brand-dot { width: 10px; height: 10px; background: var(--pass); box-shadow: none; border-radius: 2px; transform: rotate(45deg); }
.sidebar-icon-btn { color: #9DBBB8; }
.sidebar-icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group-toggle {
  font: 600 12.5px/1 var(--font-sans); text-transform: none; letter-spacing: 0;
  color: #7FA3A0; padding: 14px 10px 6px;
}
.nav-group-toggle:hover { color: #fff; }
.nav-item, [data-theme="swiss"] .nav-item {
  position: relative;
  color: #CFE0DE; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0;
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.nav-item:hover, [data-theme="swiss"] .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active, [data-theme="swiss"] .nav-item.active { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 4px;
  background: var(--pass); border-radius: 0 3px 3px 0;
}
[data-theme="swiss"] .nav-item.active .label { text-decoration: none; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); }
.nav-item .sub { color: #8FB0AD; opacity: 1; }
html.sidebar-collapsed .nav-group-toggle { background: rgba(255,255,255,.1); }
html.sidebar-collapsed .nav-item.active::before { left: -8px; }

.sidebar-lang-switch, .mobile-lang-switch { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); box-shadow: none; border-radius: var(--radius-sm); }
.lang-pill { color: #CFE0DE; border-radius: var(--radius-xs); }
.lang-pill:hover { color: #fff; background: rgba(255,255,255,.1); }
.lang-pill.active { color: var(--text) !important; background: var(--pass) !important; }
.lang-divider { color: rgba(255,255,255,.25); }
.login-wrap .sidebar-lang-switch, .mobile-bar .mobile-lang-switch { background: var(--panel); border-color: var(--panel-border); }
.login-wrap .lang-pill { color: var(--text-dim); }
.login-wrap .lang-pill.active { color: var(--text) !important; }

.mobile-bar { background: var(--sidebar-bg); border-bottom: 0; }
.mobile-bar .brand { color: #fff; font-size: 18px; font-weight: 700; }
.mobile-bar .sidebar-icon-btn { color: #fff; }
.mobile-bar .mobile-lang-switch { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); }
.mobile-bar .lang-pill { color: #CFE0DE; }
.mobile-bar .lang-pill.active { color: var(--text) !important; }

/* ---- employee pages share the same palette -------------------------------- */
.emp-scope {
  --nk-font-sans: var(--font-sans);
  --nk-bg-body: var(--bg);
  --nk-bg-surface: var(--panel);
  --nk-bg-subtle: #F3F7F6;
  --nk-border-color: var(--panel-border);
  --nk-border-strong: #B9C7C5;
  --nk-text-main: var(--text);
  --nk-text-muted: var(--text-dim);
  --nk-text-subtle: var(--text-muted);
  --nk-primary: var(--accent);
  --nk-primary-hover: var(--accent-hover);
  --nk-primary-surface: var(--accent-surface);
  --nk-ok: var(--ok); --nk-ok-surface: var(--ok-surface);
  --nk-warn: var(--warn); --nk-warn-surface: var(--warn-surface);
  --nk-err: var(--err); --nk-err-surface: var(--err-surface);
  --nk-radius-sm: 4px; --nk-radius-md: 6px; --nk-radius-lg: 6px; --nk-radius-xl: 10px;
  --nk-shadow-xs: none; --nk-shadow-sm: none; --nk-shadow-md: none; --nk-shadow-lg: 0 18px 48px -12px rgba(14,42,49,.35);
}

@media (max-width: 900px) { .wrap, [data-theme="swiss"] .wrap { padding: 24px 20px 72px; } }
@media (max-width: 640px) {
  h1, .h1 { font-size: 26px; }
  .wrap, [data-theme="swiss"] .wrap { padding: 18px 14px 64px; }
  .panel { padding: 18px 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .stat-card .stat-value { font-size: 24px; }
  .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* stat cards placed in a plain grid also read as one strip */
.grid-2:has(> .stat-card), .grid-3:has(> .stat-card), .grid-4:has(> .stat-card) {
  gap: 1px; background: var(--panel-border); border: 1px solid var(--panel-border);
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 20px;
}
.grid-2 > .stat-card, .grid-3 > .stat-card, .grid-4 > .stat-card { border: 0; border-radius: 0; padding: 18px 22px 20px; }
/* strips: draw the dividers on the cells so a short last row has no grey gap */
.kpi-grid, .grid-2:has(> .stat-card), .grid-3:has(> .stat-card), .grid-4:has(> .stat-card) {
  gap: 0; background: var(--panel); border: 0; border-top: 1px solid var(--panel-border); border-left: 1px solid var(--panel-border); border-radius: 0; overflow: visible;
}
.kpi-grid > .stat-card, .grid-2 > .stat-card, .grid-3 > .stat-card, .grid-4 > .stat-card { box-shadow: inset -1px -1px 0 var(--panel-border); }


/* ---- accessibility pass ---- */
:root, [data-theme="swiss"] { --ok: #256B40; --text-muted: #4F6D72; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"],
input[type="search"], input[type="email"], input[type="time"], select, textarea { border-color: #7B9391; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.sidebar :focus-visible, .mobile-bar :focus-visible, .exec-sidebar :focus-visible, .exec-mobile-bar :focus-visible { outline-color: var(--pass); }
.tab-btn.active, [data-theme="swiss"] .tab-btn.active { border-bottom-color: var(--text); }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 2000; background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; text-decoration: none; }
main.wrap:focus { outline: none; }
.btn { min-height: 40px; }

@media (max-width: 640px) {
  .shift-switcher .btn { min-width: 0; flex-wrap: wrap; gap: 4px 6px; padding: 12px 8px !important; font-size: 13px !important; }
}
