/* ============================================================================
   AdminPulse — Professional Enterprise Design System
   Modern, crisp, high-contrast, beautiful typography & components
   ========================================================================== */

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

/* ----------------------------------------------------------------- tokens */
:root {
  /* brand — deep executive navy */
  --brand-950: #07131e;
  --brand-900: #0c1d2e;
  --brand-850: #10263c;
  --brand-800: #16324f;
  --brand-700: #1c4266;
  --brand-600: #255784;
  --brand-500: #2e6ea5;
  --brand-400: #4a8cc5;
  --brand-200: #b9d5ee;
  --brand-100: #e2edf7;
  --brand-50:  #f0f6fb;

  /* accent — emerald energy */
  --accent-700: #096b4f;
  --accent-600: #0d825f;
  --accent-500: #109f74;
  --accent-400: #16be8c;
  --accent-100: #d4f3e6;
  --accent-50:  #edfbf5;

  /* semantic states */
  --ok-700:   #0a633f;  --ok-600: #0e7a4f;  --ok-100: #d6f4e3;  --ok-50: #effcf4;
  --warn-700: #855005;  --warn-600:#a16207; --warn-100:#fef0c7; --warn-50:#fffdf5;
  --bad-700:  #912018;  --bad-600: #b42318; --bad-100: #fee4e2; --bad-50: #fef3f2;
  --info-700: #154fb0;  --info-600:#175cd3; --info-100:#dbeafe; --info-50:#eff6ff;
  --muted-600:#475467;  --muted-100:#eaecf0; --muted-50:#f8fafc;

  /* slate neutrals */
  --ink-950:#090d14;
  --ink-900:#0f172a;
  --ink-800:#1e293b;
  --ink-700:#334155;
  --ink-600:#475569;
  --ink-500:#64748b;
  --ink-400:#94a3b8;
  --ink-300:#cbd5e1;
  --ink-200:#e2e8f0;
  --ink-100:#f1f5f9;
  --ink-50: #f8fafc;
  --white:  #ffffff;

  --radius-xs:4px;
  --radius-sm:8px;
  --radius:   12px;
  --radius-lg:16px;
  --radius-xl:22px;

  --shadow-xs:0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm:0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:   0 3px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-md:0 6px 12px -2px rgba(15, 23, 42, 0.08), 0 3px 6px -3px rgba(15, 23, 42, 0.04);
  --shadow-lg:0 14px 24px -4px rgba(15, 23, 42, 0.09), 0 6px 10px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl:0 24px 36px -6px rgba(15, 23, 42, 0.12), 0 10px 14px -6px rgba(15, 23, 42, 0.05);

  --sidebar-w:254px;
  --topbar-h:64px;

  --font: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, monospace;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-800);
  background: #f4f6fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,h2,h3,h4,h5 {
  margin: 0 0 .4em;
  font-family: var(--font);
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
h1 { font-size: 1.55rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 1em; }
a  { color: var(--brand-600); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-700); text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--ink-100);
  color: var(--ink-800);
  padding: .15em .45em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--ink-200);
}
code.pw {
  background: var(--warn-100);
  color: var(--warn-700);
  font-weight: 600;
  padding: .2em .55em;
  border-color: rgba(161,98,7,.25);
}
hr { border: 0; border-top: 1px solid var(--ink-200); margin: 20px 0; }
img { max-width: 100%; height: auto; }
small, .small { font-size: .8rem; }
.muted { color: var(--ink-500); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.ml-1{margin-left:6px}.ml-2{margin-left:12px}
.flex{display:flex}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}
.items-center{align-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}
.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}
.gap-1{gap:6px}.gap-2{gap:12px}.gap-3{gap:18px}.gap-4{gap:24px}
.grow{flex:1 1 auto}.w-100{width:100%}
.hidden{display:none !important}

/* ---------------------------------------------------------------- layout */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.page-plain { background: #f0f4f9; display: flex; align-items: center; justify-content: center; padding: 36px 16px; }

/* sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--brand-950) 0%, var(--brand-900) 50%, #0a1b2b 100%);
  color: #c9d8e7;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 50;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky; top: 0;
  background: var(--brand-950);
  z-index: 5;
}
.sidebar__logo {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #109f74 0%, #08694d 100%);
  color: #fff; font-weight: 800; font-size: .88rem;
  display: grid; place-items: center; letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(16, 159, 116, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.sidebar__name { font-weight: 700; color: #ffffff; font-size: 1rem; letter-spacing: -0.02em; line-height: 1.15; }
.sidebar__tag { font-size: .65rem; color: #8ba2b8; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
.sidebar__nav { padding: 12px 10px 24px; flex: 1; }
.nav-group__label {
  font-size: .64rem; text-transform: uppercase; letter-spacing: .12em;
  color: #637b92; padding: 14px 12px 6px; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 3px;
  border-radius: var(--radius-sm);
  color: #b5c7d8; font-size: .855rem; font-weight: 500;
  transition: all .16s ease;
  position: relative;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transform: translateX(2px);
}
.nav-link.is-active {
  background: linear-gradient(90deg, rgba(37, 87, 132, 0.65) 0%, rgba(16, 159, 116, 0.2) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #16be8c, 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link.is-active svg { opacity: 1; color: #16be8c; }
.nav-link__badge {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent-600), var(--accent-700));
  color: #fff;
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  min-width: 20px; text-align: center;
  box-shadow: 0 2px 6px rgba(13, 130, 95, 0.35);
}
.nav-link__badge--muted { background: rgba(255,255,255,.14); color: #cbd7e4; box-shadow: none; }
.sidebar__foot { padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: .72rem; color: #647d94; font-weight: 500; }

/* topbar */
.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-xs);
}
.topbar__title { font-size: 1.05rem; font-weight: 700; color: var(--ink-900); letter-spacing: -0.015em; }
.topbar__crumb { font-size: .76rem; color: var(--ink-500); font-weight: 500; }
.topbar__spacer { flex: 1; }
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-200));
  color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; font-size: .78rem;
  box-shadow: 0 0 0 2px rgba(46, 110, 165, 0.2);
}
.topbar__name { font-size: .84rem; font-weight: 650; color: var(--ink-900); line-height: 1.15; }
.topbar__role { font-size: .7rem; color: var(--ink-500); font-weight: 500; text-transform: capitalize; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--ink-200); background: var(--white);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-600);
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--ink-100); color: var(--ink-900); border-color: var(--ink-300); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.sidebar-toggle { display: none; }

/* main content */
.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 18px 20px; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head__sub { color: var(--ink-500); font-size: .86rem; margin: 0; }
.page-head h1 { font-size: 1.35rem; margin-bottom: 2px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card__head {
  padding: 12px 16px;
  background: linear-gradient(180deg, #fcfdfe 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--ink-200);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card__title { font-size: .94rem; font-weight: 700; color: var(--ink-900); margin: 0; }
.card__sub { font-size: .76rem; color: var(--ink-500); margin: 1px 0 0; }
.card__body { padding: 15px 16px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 10px 16px;
  border-top: 1px solid var(--ink-200);
  background: var(--ink-50);
  border-radius: 0 0 var(--radius) var(--radius);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* stat tiles */
.stat {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat:hover {
  text-decoration: none;
  border-color: var(--ink-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat__label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-500); font-weight: 700; }
.stat__value {
  font-size: 1.6rem; font-weight: 800; color: var(--ink-900);
  line-height: 1.15; margin-top: 3px; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat__meta { font-size: .75rem; color: var(--ink-500); margin-top: 2px; font-weight: 500; }
.stat__accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-500); }
.stat--accent .stat__accent { background: var(--accent-500); }
.stat--warn .stat__accent { background: var(--warn-600); }
.stat--bad .stat__accent { background: var(--bad-600); }
.stat--ok .stat__accent { background: var(--ok-600); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--ink-300); background: var(--white); color: var(--ink-700);
  font: inherit; font-size: .835rem; font-weight: 600; cursor: pointer;
  transition: all .14s ease;
  text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--ink-50); color: var(--ink-900); text-decoration: none; border-color: var(--ink-400); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn--primary {
  background: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-700) 100%);
  border-color: var(--brand-700);
  color: #fff;
  box-shadow: 0 1px 3px rgba(28, 66, 102, 0.35);
}
.btn--primary:hover {
  background: linear-gradient(180deg, var(--brand-700) 0%, var(--brand-800) 100%);
  border-color: var(--brand-800);
  color: #fff;
}
.btn--accent {
  background: linear-gradient(180deg, var(--accent-500) 0%, var(--accent-600) 100%);
  border-color: var(--accent-600);
  color: #fff;
  box-shadow: 0 1px 3px rgba(13, 130, 95, 0.35);
}
.btn--accent:hover {
  background: linear-gradient(180deg, var(--accent-600) 0%, var(--accent-700) 100%);
  border-color: var(--accent-700);
  color: #fff;
}
.btn--danger {
  background: linear-gradient(180deg, var(--bad-600) 0%, #991b1b 100%);
  border-color: #991b1b;
  color: #fff;
  box-shadow: 0 1px 3px rgba(180, 35, 24, 0.35);
}
.btn--danger:hover { background: #7f1d1d; border-color: #7f1d1d; color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-600); box-shadow: none; }
.btn--ghost:hover { background: var(--ink-100); color: var(--ink-900); }

/* Enhanced danger ghost for table delete actions */
.btn--danger-ghost {
  border: 1px solid transparent;
  background: transparent;
  color: var(--bad-600);
  padding: 4px 8px;
  font-size: .78rem;
  border-radius: var(--radius-xs);
  box-shadow: none;
  transition: all .14s ease;
}
.btn--danger-ghost:hover {
  background: var(--bad-100);
  border-color: rgba(180,35,24,.2);
  color: #912018;
}
.btn--danger-ghost svg { color: var(--bad-600); }

.btn--sm { padding: 5px 10px; font-size: .78rem; border-radius: 6px; }
.btn--sm svg { width: 13px; height: 13px; }
.btn--block { width: 100%; }
.btn-group { display: inline-flex; gap: 7px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .73rem; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.25;
}
.pill--ok    { background: var(--ok-100);   color: var(--ok-700);   border-color: rgba(14,122,79,.22); }
.pill--warn  { background: var(--warn-100); color: var(--warn-700); border-color: rgba(161,98,7,.25); }
.pill--bad   { background: var(--bad-100);  color: var(--bad-700);  border-color: rgba(180,35,24,.22); }
.pill--info  { background: var(--info-100); color: var(--info-700); border-color: rgba(23,92,211,.22); }
.pill--muted { background: var(--muted-100);color: var(--ink-600);  border-color: var(--ink-200); }
.pill--brand { background: var(--brand-100);color: var(--brand-700);border-color: rgba(36,86,130,.22); }

/* ----------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .845rem; }
table.data th {
  text-align: left; font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-600); background: #f8fafc; padding: 8px 14px;
  border-bottom: 1px solid var(--ink-200); white-space: nowrap;
}
table.data td {
  padding: 8px 14px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
  transition: background .12s ease;
}
table.data tbody tr:hover td { background: #f0f7ff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.cell-strong { font-weight: 650; color: var(--ink-900); }
.cell-sub { font-size: .75rem; color: var(--ink-500); }
.ref { font-family: var(--mono); font-size: .79rem; color: var(--brand-700); font-weight: 600; }

/* empty state */
.empty { padding: 32px 20px; text-align: center; color: var(--ink-500); }
.empty__icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--ink-300); }
.empty__icon svg { width: 100%; height: 100%; }
.empty h3 { color: var(--ink-800); margin-bottom: 4px; font-size: 1rem; }
.empty p { font-size: .84rem; margin: 0; }

/* ----------------------------------------------------------------- forms */
.field { margin-bottom: 11px; }
.field > label, .label {
  display: block; font-size: .78rem; font-weight: 700; color: var(--ink-800); margin-bottom: 4px;
}
.label .req { color: var(--bad-600); }
.input, .select, .textarea {
  width: 100%; padding: 7px 11px;
  border: 1px solid var(--ink-300); border-radius: var(--radius-sm);
  font: inherit; font-size: .865rem; color: var(--ink-800); background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(46, 110, 165, 0.16);
}
.textarea { min-height: 74px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.field__hint { font-size: .74rem; color: var(--ink-500); margin-top: 3px; }
.field__error { font-size: .75rem; color: var(--bad-600); margin-top: 3px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.form-grid--3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.form-section { border-top: 1px solid var(--ink-200); padding-top: 12px; margin-top: 6px; }
.form-section__title { font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-600); margin-bottom: 9px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: .855rem; font-weight: 500; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--brand-600); flex: none; }
.fieldset { border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.fieldset legend { font-size: .76rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-600); padding: 0 8px; }

/* repeatable asset lines (requisition form) */
.item-row {
  grid-template-columns: minmax(150px, 2fr) minmax(130px, 1fr) 84px auto;
  gap: 0 12px; align-items: end;
}
.item-row .field { margin-bottom: 11px; }

/* toolbar / filters */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; }
.search-box { position: relative; flex: 1 1 250px; max-width: 400px; }
.search-box .input { width: 100%; padding-left: 34px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-400); pointer-events: none; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ink-200); margin-bottom: 14px; overflow-x: auto; }
.tab {
  padding: 8px 14px; border: 0; background: none; font: inherit; font-size: .855rem; font-weight: 600;
  color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: all .15s ease;
}
.tab:hover { color: var(--ink-900); }
.tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand-700); font-weight: 700; }
.tab__count {
  font-size: .7rem; color: var(--ink-500); margin-left: 6px;
  background: var(--ink-100); padding: 1px 6px; border-radius: 10px;
}
.tab.is-active .tab__count { background: var(--brand-100); color: var(--brand-700); }

/* ----------------------------------------------------------------- alerts */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: .855rem; border: 1px solid;
  margin-bottom: 13px; display: flex; gap: 11px; align-items: flex-start;
  box-shadow: var(--shadow-xs);
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert--ok   { background: var(--ok-50);   border-color: rgba(14,122,79,.25); color: var(--ok-700); }
.alert--bad  { background: var(--bad-50);  border-color: rgba(180,35,24,.25); color: var(--bad-700); }
.alert--warn { background: var(--warn-50); border-color: rgba(161,98,7,.25); color: var(--warn-700); }
.alert--info { background: var(--info-50); border-color: rgba(23,92,211,.22); color: var(--info-700); }

/* ---------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; z-index: 100; overflow-y: auto;
  backdrop-filter: blur(5px);
}
.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 640px; animation: modalIn .18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Centre in the viewport and keep the dialog on screen when it is tall. */
  margin: auto; max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
}
.modal--wide { max-width: 900px; }
.modal--narrow { max-width: 460px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__head {
  padding: 14px 18px; border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(180deg, #fcfdfe 0%, #f8fafc 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex: 0 0 auto;
}
.modal__title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--ink-900); }
.modal__body { padding: 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal__foot {
  padding: 12px 18px; border-top: 1px solid var(--ink-200);
  display: flex; justify-content: flex-end; gap: 10px; background: var(--ink-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex: 0 0 auto;
}
/* Most modals wrap their body and footer in a <form> — keep the scroll
   behaviour working through that wrapper. */
.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal > form > .modal__body { flex: 1 1 auto; min-height: 0; }
.modal > form > .modal__foot { flex: 0 0 auto; }

/* toast */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink-950); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl); font-size: .865rem; max-width: 360px; font-weight: 500;
  display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast--ok  { background: #075e3c; }
.toast--bad { background: #881c1c; }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- kanban */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.kanban__col { background: #f8fafc; border: 1px solid var(--ink-200); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 200px; }
.kanban__head { padding: 10px 14px; border-bottom: 1px solid var(--ink-200); display: flex; align-items: center; justify-content: space-between; }
.kanban__title { font-size: .79rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-700); display: flex; align-items: center; gap: 8px; }
.kanban__dot { width: 9px; height: 9px; border-radius: 50%; }
.kanban__count { background: var(--ink-200); color: var(--ink-800); font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.kanban__list { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban__col--signoff .kanban__dot { background: var(--warn-600); }
.kanban__col--progress .kanban__dot { background: var(--info-600); }
.kanban__col--done .kanban__dot { background: var(--ok-600); }
.task-card {
  background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
  padding: 13px 14px; box-shadow: var(--shadow-sm); cursor: grab; position: relative;
  transition: transform .14s ease, box-shadow .14s ease;
}
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.task-card:active { cursor: grabbing; }
.task-card.is-dragging { opacity: .45; }
.task-card__title { font-size: .875rem; font-weight: 650; color: var(--ink-900); margin-bottom: 7px; line-height: 1.35; }
.task-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .75rem; color: var(--ink-500); }
.task-card__prio { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; }
.task-card__prio--high { background: var(--bad-600); }
.task-card__prio--medium { background: var(--warn-600); }
.task-card__prio--routine { background: var(--ink-300); }
.task-card--signoff { border-left: 4px solid var(--warn-600); }
.task-card--progress { border-left: 4px solid var(--info-600); }
.task-card--done { border-left: 4px solid var(--ok-600); }
.kanban__col.is-over { background: var(--brand-50); border-color: var(--brand-500); }

/* --------------------------------------------------------------- timeline */
.timeline { position: relative; }
.tl-row { display: grid; grid-template-columns: 88px 1fr; gap: 16px; border-bottom: 1px solid var(--ink-100); }
.tl-row:last-child { border-bottom: 0; }
.tl-time { padding: 14px 0; font-size: .78rem; color: var(--ink-500); text-align: right; font-variant-numeric: tabular-nums; }
.tl-time strong { display: block; color: var(--ink-900); font-size: .86rem; font-weight: 700; }
.tl-event {
  margin: 9px 0; padding: 12px 16px; border-radius: var(--radius-sm);
  background: #f0f7ff; border-left: 4px solid var(--brand-500);
  box-shadow: var(--shadow-xs);
}
.tl-event--vip { background: #edfbf5; border-left-color: var(--accent-600); }
.tl-event--conflict { background: #fef2f2; border-left-color: var(--bad-600); }
.tl-event__title { font-weight: 700; font-size: .9rem; color: var(--ink-900); }
.tl-event__meta { font-size: .78rem; color: var(--ink-500); margin-top: 4px; display: flex; gap: 11px; flex-wrap: wrap; }
.tl-buffer { font-size: .74rem; color: var(--warn-700); background: var(--warn-50); border: 1px dashed var(--warn-600); border-radius: 4px; padding: 2px 8px; display: inline-block; margin: 4px 0; font-weight: 600; }
.tl-hours { display: grid; grid-template-columns: 88px 1fr; gap: 16px; }
.tl-hour-label { font-size: .72rem; color: var(--ink-400); text-align: right; padding-top: 4px; }
.tl-hour-track { position: relative; height: 46px; border-bottom: 1px solid var(--ink-100); }
.tl-bar { position: absolute; top: 6px; height: 32px; border-radius: 6px; background: var(--brand-500); color: #fff; font-size: .74rem; font-weight: 650; padding: 0 10px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; box-shadow: var(--shadow-xs); }
.tl-bar--vip { background: var(--accent-600); }
.tl-bar--conflict { background: var(--bad-600); }

/* --------------------------------------------------------------- tz grid */
.tz-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tz-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-600); padding: 10px 14px; border-bottom: 1px solid var(--ink-200); background: #f8fafc; font-weight: 700; }
.tz-table td { padding: 11px 14px; border-bottom: 1px solid var(--ink-100); font-variant-numeric: tabular-nums; }
.tz-table tr:last-child td { border-bottom: 0; }
.tz-table .tz-local { font-weight: 700; color: var(--brand-700); }
.tz-table .tz-dim { color: var(--ink-400); }

/* ----------------------------------------------------------- misc blocks */
.kv { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 8px 18px; font-size: .865rem; }
.kv dt { color: var(--ink-500); font-weight: 650; }
.kv dd { margin: 0; color: var(--ink-900); }
.progress { height: 8px; background: var(--ink-200); border-radius: 20px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--accent-500); border-radius: 20px; transition: width .3s; }
.progress__bar--warn { background: var(--warn-600); }
.progress__bar--bad  { background: var(--bad-600); }
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-row__top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 4px; }
.bar-row__label { font-weight: 650; color: var(--ink-800); }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 700; background: var(--brand-100); color: var(--brand-700); flex: none; border: 1px solid var(--brand-200); }
.avatar--sm { width: 26px; height: 26px; font-size: .65rem; }
.avatar--lg { width: 50px; height: 50px; font-size: 1.05rem; background: var(--accent-100); color: var(--accent-700); }

.attachment-list { display: flex; flex-direction: column; gap: 9px; }
.attachment {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm); background: var(--white);
  box-shadow: var(--shadow-xs); transition: border-color .15s ease;
}
.attachment:hover { border-color: var(--brand-300); }
.attachment__icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: #f0f7ff; color: var(--brand-600); flex: none; }
.attachment__icon svg { width: 18px; height: 18px; }
.attachment__name { font-size: .86rem; font-weight: 650; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment__meta { font-size: .75rem; color: var(--ink-500); margin-top: 2px; }

.timeline-vertical { position: relative; padding-left: 24px; }
.timeline-vertical::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--ink-200); }
.tv-item { position: relative; padding-bottom: 18px; }
.tv-item::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-500); border: 2px solid var(--white); }
.tv-item__time { font-size: .73rem; color: var(--ink-400); font-weight: 500; }
.tv-item__text { font-size: .855rem; color: var(--ink-800); }
.tv-item__text strong { color: var(--ink-950); }

/* ------------------------------------------------------------------ auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-visual {
  background: linear-gradient(150deg, var(--brand-950), var(--brand-700) 55%, var(--accent-700));
  color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center;
}
.auth-visual h1 { font-size: 2.2rem; color: #fff; letter-spacing: -.03em; }
.auth-visual p { color: rgba(255,255,255,.82); max-width: 440px; font-size: 1rem; }
.auth-visual__feats { margin-top: 28px; display: flex; flex-direction: column; gap: 12px; }
.auth-visual__feat { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: rgba(255,255,255,.94); }
.auth-visual__feat svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: #16be8c; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 44px 26px; background: var(--white); }
.auth-form__inner { width: 100%; max-width: 400px; }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.demo-creds { background: #f0f7ff; border: 1px dashed var(--brand-500); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .82rem; }
.demo-creds code { cursor: pointer; }
.demo-creds table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.demo-creds td { padding: 3px 0; }

/* ---------------------------------------------------------- kiosk / forms */
.kiosk { max-width: 580px; margin: 0 auto; }
.kiosk__step { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.kiosk__step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-700); color: #fff; display: grid; place-items: center; font-size: .74rem; font-weight: 750; }
.kiosk__step-label { font-size: .84rem; font-weight: 700; color: var(--ink-700); }

/* -------------------------------------------------------------- installer */
.install-shell { width: 100%; max-width: 740px; }
.install-head { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.install-logo { width: 50px; height: 50px; border-radius: 13px; background: linear-gradient(135deg, var(--accent-500), var(--accent-700)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; box-shadow: 0 4px 16px rgba(16,159,116,.35); }
.install-head h1 { margin: 0; }
.install-head p { margin: 0; color: var(--ink-500); font-size: .9rem; }
.install-card { background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 28px; }
.install-card--ok { border-color: rgba(14,122,79,.3); }
.install-table { width: 100%; border-collapse: collapse; font-size: .875rem; margin: 16px 0; }
.install-table th, .install-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--ink-100); }
.install-table th { color: var(--ink-600); font-weight: 650; width: 190px; }
.install-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.install-foot { text-align: center; margin-top: 20px; font-size: .78rem; color: var(--ink-400); }

/* ------------------------------------------------------------------ misc */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--ink-200);
  font-size: .82rem; color: var(--ink-700); background: var(--white); min-width: 32px; text-align: center;
  font-weight: 600;
}
.pagination a:hover { background: var(--ink-100); text-decoration: none; border-color: var(--ink-300); }
.pagination .is-current { background: var(--brand-700); border-color: var(--brand-700); color: #fff; font-weight: 700; }
.pagination .is-disabled { opacity: .4; }
.divider { height: 1px; background: var(--ink-200); margin: 20px 0; }
.scroll-x { overflow-x: auto; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 5px; background: var(--ink-100); color: var(--ink-700); border: 1px solid var(--ink-200); }
.calendar-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-day { border: 1px solid var(--ink-200); border-radius: var(--radius-sm); padding: 10px; text-align: center; background: var(--white); cursor: pointer; transition: all .15s ease; }
.cal-day:hover { border-color: var(--brand-500); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.cal-day.is-active { background: linear-gradient(180deg, var(--brand-600) 0%, var(--brand-700) 100%); color: #fff; border-color: var(--brand-700); box-shadow: var(--shadow-sm); }
.cal-day.is-today { border-color: var(--accent-500); }
.cal-day__name { font-size: .68rem; text-transform: uppercase; color: var(--ink-400); letter-spacing: .05em; font-weight: 700; }
.cal-day.is-active .cal-day__name { color: rgba(255,255,255,.8); }
.cal-day__num { font-weight: 800; font-size: 1.05rem; }
.cal-day__dots { display: flex; gap: 3px; justify-content: center; margin-top: 4px; min-height: 6px; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-500); }

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .topbar, .toolbar, .row-actions, .no-print, .btn, .tabs { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
  .print-header { display: block !important; }
  table.data th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pill { border: 1px solid #999 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
}
.print-header { display: none; margin-bottom: 16px; border-bottom: 2px solid #333; padding-bottom: 10px; }
.print-header h1 { font-size: 1.2rem; margin: 0 0 3px; }
.print-header p { margin: 0; font-size: .8rem; color: #555; }
.sign-block { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; font-size: .8rem; }
.sign-block div { border-top: 1px solid #333; padding-top: 6px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .kanban { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 90; width: 270px; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-xl); }
  .sidebar-toggle { display: grid; }
  .content { padding: 14px; }
  .topbar { padding: 0 16px; }
  .card-grid, .card-grid--2 { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr; }
  .tl-row, .tl-hours { grid-template-columns: 66px 1fr; gap: 10px; }
  table.data.responsive thead { display: none; }
  table.data.responsive tbody tr { display: block; border-bottom: 1px solid var(--ink-200); padding: 10px 0; }
  table.data.responsive tbody td { display: flex; justify-content: space-between; gap: 14px; border: 0; padding: 5px 16px; text-align: right; }
  table.data.responsive tbody td::before {
    content: attr(data-label); font-weight: 700; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--ink-500); text-align: left; flex: none;
  }
  table.data.responsive tbody td:empty { display: none; }
  .row-actions { justify-content: flex-end; }
}
@media (max-width: 520px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .btn-group { width: 100%; }
  .page-head .btn { flex: 1; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .stat__value { font-size: 1.4rem; }
}