/* =====================================================================
   JT Group Operations Platform
   Interface styles.

   The colour of the interface is not fixed. --brand and --brand-accent are
   written into the page by includes/header.php from the company you are
   currently working in, and everything below reads from those two values.
   Switch company and the whole interface follows.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  /* Brand values are overridden inline per company. These are the fallbacks. */
  --brand: #007B69;
  --brand-deep: #00614F;
  --brand-rgb: 0, 123, 105;
  --brand-accent: #0F1D24;
  /* A lifted version of the brand, so dark brand colours stay visible
     against the dark sidebar. Written in by includes/header.php. */
  --brand-on-dark: #007B69;
  --brand-on-dark-rgb: 0, 123, 105;

  --ink: #0F1D24;
  --ink-2: #3D5057;
  --ink-3: #6E8087;
  --page: #F1F5F5;
  --surface: #FFFFFF;
  --line: #DCE6E7;
  --line-soft: #EAF0F1;

  --good: #17795E;
  --warn: #A8620B;
  --danger: #B3352A;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 29, 36, .06);
  --shadow: 0 1px 2px rgba(15, 29, 36, .05), 0 10px 28px -16px rgba(15, 29, 36, .35);

  --sidebar-w: 244px;
  --topbar-h: 62px;

  --font-display: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .98rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Identifiers, quantities and money read as machine values, not prose. */
.mono, .ref, td.num, .stat-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------------
   App shell
   --------------------------------------------------------------------- */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  z-index: 60;
  transition: transform .22s ease;
}

/* The signature: a spine of the active company's colour down the sidebar.
   In Group View it carries every brand in the group instead of one. */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand-on-dark);
}

.sidebar.is-group::before {
  background: linear-gradient(
    180deg,
    #007B69 0%, #007E6C 14%, #027977 28%, #01817F 42%,
    #437773 56%, #00A8B8 70%, #007E7F 85%, #849927 100%
  );
}

.sidebar-head {
  padding: 18px 18px 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.wordmark span { color: var(--brand-on-dark); }

.sidebar.is-group .wordmark span {
  color: #fff;
  opacity: .55;
}

.wordmark-sub {
  display: block;
  margin-top: 2px;
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
  font-family: var(--font-body);
  font-weight: 500;
}

.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }

.nav-group-label {
  padding: 14px 10px 6px;
  font-size: .66rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .34);
  font-weight: 600;
}

.nav a, .nav .nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .74);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background .14s ease, color .14s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  text-decoration: none;
}

.nav a.is-active {
  background: rgba(var(--brand-on-dark-rgb), .2);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--brand-on-dark);
}

.nav .nav-item.is-locked {
  color: rgba(255, 255, 255, .3);
  cursor: default;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phase-tag {
  margin-left: auto;
  font-size: .6rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .45);
  font-family: var(--font-mono);
}

.sidebar-foot {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
}

.user-chip:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }

.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-on-dark);
  color: #fff;
  font-size: .76rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: .02em;
}

.user-chip-name { font-size: .84rem; font-weight: 500; line-height: 1.25; }
.user-chip-role { font-size: .7rem; color: rgba(255, 255, 255, .48); }

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
}

.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

.page-title { font-size: 1.02rem; font-weight: 600; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* The company switcher. Always visible, always naming the company you are
   working in, so nothing is ever captured under the wrong brand. */
.switcher { position: relative; }

.switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .86rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color .14s ease;
}

.switcher-btn:hover { border-color: var(--brand); }

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: 0 0 22px;
  background: var(--brand);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-dot img { width: 100%; height: 100%; object-fit: cover; }

.brand-dot.group {
  background: conic-gradient(
    #007B69 0deg 45deg, #007E6C 45deg 90deg, #027977 90deg 135deg, #01817F 135deg 180deg,
    #437773 180deg 225deg, #00A8B8 225deg 270deg, #007E7F 270deg 315deg, #849927 315deg 360deg
  );
}

.switcher-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.switcher-label small { font-size: .64rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.switcher-label strong { font-weight: 600; font-size: .87rem; }

.switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 286px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  display: none;
  max-height: 74vh;
  overflow-y: auto;
}

.switcher-menu.is-open { display: block; }

.switcher-menu-label {
  padding: 8px 10px 4px;
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.switcher-item:hover { background: var(--page); text-decoration: none; }
.switcher-item.is-current { background: rgba(var(--brand-rgb), .09); font-weight: 600; }

.switcher-item .swatch {
  width: 10px;
  height: 26px;
  border-radius: 3px;
  flex: 0 0 10px;
}

.switcher-item small { display: block; font-size: .7rem; color: var(--ink-3); font-weight: 400; }

.switcher-divider { height: 1px; background: var(--line-soft); margin: 6px 4px; }

/* ---------------------------------------------------------------------
   Content
   --------------------------------------------------------------------- */
.content { padding: 24px 22px 48px; flex: 1; width: 100%; max-width: 1240px; }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; max-width: 62ch; }
.page-head .spacer { margin-left: auto; }

.eyebrow {
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 4px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Stat tiles */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
  opacity: .85;
}

.stat-label {
  font-size: .72rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.15;
  margin-top: 6px;
  color: var(--ink);
}

.stat-note { font-size: .78rem; color: var(--ink-3); margin-top: 3px; }

/* Module tiles for phases not yet built */
.module {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .15s ease;
}

.module:hover { text-decoration: none; }
a.module:hover { border-color: var(--brand); transform: translateY(-1px); }

.module.is-locked { opacity: .74; border-style: dashed; box-shadow: none; background: transparent; }

.module-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.module h3 { font-size: .96rem; }
.module p { margin: 0; font-size: .82rem; color: var(--ink-2); line-height: 1.5; }

.module-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-rgb), .1);
  color: var(--brand);
  flex: 0 0 34px;
}

.module.is-locked .module-icon { background: var(--line-soft); color: var(--ink-3); }
.module-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

table.data th {
  text-align: left;
  padding: 10px 14px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}

table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(var(--brand-rgb), .035); }
table.data td.num { text-align: right; }

.cell-strong { font-weight: 600; }
.cell-sub { display: block; font-size: .76rem; color: var(--ink-3); }

/* Company name cell with its colour, so brands are readable at a glance */
.co-cell { display: flex; align-items: center; gap: 9px; }
.co-swatch { width: 8px; height: 22px; border-radius: 3px; flex: 0 0 8px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge.good { background: rgba(23, 121, 94, .1); color: var(--good); border-color: rgba(23, 121, 94, .18); }
.badge.warn { background: rgba(168, 98, 11, .1); color: var(--warn); border-color: rgba(168, 98, 11, .18); }
.badge.bad { background: rgba(179, 53, 42, .09); color: var(--danger); border-color: rgba(179, 53, 42, .18); }
.badge.neutral { background: var(--page); color: var(--ink-2); border-color: var(--line); }
.badge.brand { background: rgba(var(--brand-rgb), .1); color: var(--brand-deep); border-color: rgba(var(--brand-rgb), .2); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }

.btn-danger { background: var(--surface); border-color: rgba(179, 53, 42, .35); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { padding: 6px 11px; font-size: .8rem; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Forms */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .76rem; color: var(--ink-3); }

.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=number],
.field input[type=tel],
.field input[type=date],
.field input[type=file],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--ink);
  transition: border-color .14s ease, box-shadow .14s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .13);
}

.field input[disabled], .field select[disabled] { background: var(--page); color: var(--ink-3); }

.colour-field { display: flex; gap: 8px; align-items: center; }
.colour-field input[type=color] {
  width: 46px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.colour-field input[type=text] { font-family: var(--font-mono); text-transform: uppercase; }

.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: .88rem; }
.checkbox input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }

fieldset.group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 18px;
}

fieldset.group legend {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: 0 7px;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

/* Flash and inline messages */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  border: 1px solid;
}

.msg.success { background: rgba(23, 121, 94, .07); border-color: rgba(23, 121, 94, .22); color: #10604A; }
.msg.error { background: rgba(179, 53, 42, .06); border-color: rgba(179, 53, 42, .24); color: #8E2A21; }
.msg.info { background: rgba(var(--brand-rgb), .07); border-color: rgba(var(--brand-rgb), .2); color: var(--brand-deep); }
.msg.warn { background: rgba(168, 98, 11, .07); border-color: rgba(168, 98, 11, .24); color: #85500A; }

/* Empty states invite an action rather than apologising for having no data */
.empty { padding: 44px 24px; text-align: center; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-2); font-size: .9rem; margin: 0 auto 16px; max-width: 44ch; }

.empty-mark {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(var(--brand-rgb), .1);
  color: var(--brand);
}

.empty-mark svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Audit timeline */
.log-list { list-style: none; margin: 0; padding: 0; }

.log-item {
  display: flex;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .87rem;
}

.log-item:last-child { border-bottom: 0; }

.log-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  flex: 0 0 8px;
  background: var(--ink-3);
}

.log-mark.good { background: var(--good); }
.log-mark.warn { background: var(--warn); }

.log-body { flex: 1; min-width: 0; }
.log-meta { font-size: .76rem; color: var(--ink-3); margin-top: 1px; }

/* Login and setup screens */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
}

.auth-brand {
  background: var(--ink);
  color: #fff;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(
    180deg,
    #007B69 0%, #007E6C 14%, #027977 28%, #01817F 42%,
    #437773 56%, #00A8B8 70%, #007E7F 85%, #849927 100%
  );
}

.auth-brand .wordmark { font-size: 1.3rem; }

.auth-lede {
  margin-top: auto;
  max-width: 30ch;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.auth-lede em { font-style: normal; color: rgba(255, 255, 255, .5); }

.auth-brands {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.auth-brands span {
  font-size: .72rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .72);
}

.auth-brands span i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: baseline;
}

.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 372px; }
.auth-form h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-form .sub { color: var(--ink-2); font-size: .9rem; margin: 0 0 24px; }
.auth-form .field { margin-bottom: 15px; }
.auth-form .btn { width: 100%; padding: 11px; }

.auth-foot { margin-top: 22px; font-size: .78rem; color: var(--ink-3); text-align: center; }

/* Employee portal keeps the same shell but a calmer, single column body */
.portal-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  margin-bottom: 20px;
}

.portal-hero h1 { color: #fff; font-size: 1.5rem; }
.portal-hero p { margin: 6px 0 0; opacity: .88; font-size: .92rem; max-width: 52ch; }

/* Utilities */
.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 29, 36, .45);
  z-index: 50;
  display: none;
}

.scrim.is-open { display: block; }

/* ---------------------------------------------------------------------
   Responsive. Technicians and employees are mostly on phones, so the
   layout collapses to a drawer and everything stays reachable one handed.
   --------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 30px 26px; }
  .auth-lede { font-size: 1.4rem; margin-top: 22px; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 18px 15px 44px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .page-title { font-size: .95rem; }
  .switcher-label small { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .switcher-menu { width: min(300px, calc(100vw - 28px)); }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .stat-value { font-size: 1.5rem; }
  .page-head .spacer { margin-left: 0; width: 100%; }
  .page-head .btn { width: 100%; }
  .form-actions .btn { flex: 1 1 auto; }
  table.data th, table.data td { padding: 9px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .sidebar, .topbar, .form-actions, .btn { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
  .card { border-color: #ccc; box-shadow: none; }
}

/* Dashboard build-progress list */
.build-check, .build-next, .build-soon {
  flex: 0 0 auto;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 1px;
}
.build-check { background: #e6f4ee; color: #17795e; }
.build-next  { background: rgba(var(--brand-rgb), .14); color: var(--brand-deep); }
.build-soon  { background: var(--page); color: var(--ink-3); border: 1px solid var(--line); }

/* Sidebar pending-count badge (e.g. leave approvals) */
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  background: var(--bad, #d64545);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1;
}
