/* ============================================================
   VP Gestão — App shell + module styles
   Built on top of colors_and_type.css design tokens.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--vp-gray-50); color: var(--fg1); font-family: var(--font-sans); font-size: 14px; }
body { overflow: hidden; height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ========== TOAST ============================================== */
.toast-viewport {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #000;
  color: #fff;
  padding: 12px 14px 12px 16px;
  border-left: 3px solid var(--vp-yellow);
  min-width: 320px;
  max-width: 560px;
  pointer-events: auto;
  animation: toast-in .25s var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.toast--success { border-left-color: var(--vp-success); }
.toast--warning { border-left-color: var(--vp-warning); }
.toast--danger  { border-left-color: var(--vp-danger); }
.toast__icon { color: var(--vp-yellow); display: inline-flex; }
.toast--success .toast__icon { color: var(--vp-success); }
.toast--warning .toast__icon { color: var(--vp-warning); }
.toast--danger  .toast__icon { color: var(--vp-danger); }
.toast__msg { flex: 1; font-size: 13px; line-height: 1.4; }
.toast__close {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
}
.toast__close:hover { color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== EMPTY STATE redirect ================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 96px 32px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--border-strong);
  max-width: 560px;
  margin: 64px auto;
}
.empty-state__icon {
  width: 64px; height: 64px;
  background: var(--vp-gray-100);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--fg3);
}
.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.empty-state p { color: var(--fg2); margin: 0 0 20px; max-width: 380px; }


/* density variable, set on <body> */
body[data-density="compact"] {
  --row-py: 6px; --pad-card: 12px; --gap-stack: 8px;
  --fs-table: 12px; --kpi-py: 12px; --kpi-fs: 28px;
  --page-py: 18px; --page-px: 22px;
  --nav-py: 7px; --grid-gap: 10px;
  --th-py: 9px;
}
body[data-density="cozy"] {
  --row-py: 12px; --pad-card: 18px; --gap-stack: 14px;
  --fs-table: 13.5px; --kpi-py: 18px; --kpi-fs: 36px;
  --page-py: 28px; --page-px: 32px;
  --nav-py: 9px; --grid-gap: 16px;
  --th-py: 11px;
}
body[data-density="airy"] {
  --row-py: 20px; --pad-card: 28px; --gap-stack: 22px;
  --fs-table: 14.5px; --kpi-py: 28px; --kpi-fs: 44px;
  --page-py: 40px; --page-px: 48px;
  --nav-py: 13px; --grid-gap: 24px;
  --th-py: 16px;
}

/* ========== APP LAYOUT ============================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w, 240px) 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  height: 100vh;
  background: var(--vp-gray-50);
  transition: grid-template-columns var(--dur-base) var(--ease-out);
}
.app[data-sidebar="collapsed"] { --sidebar-w: 64px; }

/* ========== SIDEBAR =============================================== */
.sidebar {
  grid-area: sidebar;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 0;
  position: relative;
  overflow: hidden;
}
.sidebar::after {
  /* yellow rail signature */
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--vp-yellow);
}
.sidebar__brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--vp-gray-900);
}
.sidebar__brand img { height: 26px; display: block; }
.sidebar__brand-mark { width: 28px; height: 28px; }
.sidebar__brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 18px;
  color: #6E6E6E;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.sidebar__brand-text b { color: var(--vp-yellow); font-weight: 800; }
.sidebar__brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--vp-gray-500);
  text-transform: uppercase;
  margin-left: auto;
}
.app[data-sidebar="collapsed"] .sidebar__brand-text,
.app[data-sidebar="collapsed"] .sidebar__brand-sub { display: none; }
.app[data-sidebar="collapsed"] .sidebar__brand { justify-content: center; padding: 0; }

.sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--vp-gray-700) transparent;
}
.sidebar__scroll::-webkit-scrollbar { width: 6px; }
.sidebar__scroll::-webkit-scrollbar-thumb { background: var(--vp-gray-700); border-radius: 3px; }

.sidebar__group { margin-top: 14px; }
.sidebar__group:first-child { margin-top: 0; }
.sidebar__group-label {
  padding: 8px 12px 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--vp-gray-500);
}
.app[data-sidebar="collapsed"] .sidebar__group-label {
  padding: 8px 0;
  text-align: center;
  font-size: 8px;
  letter-spacing: .1em;
}
.app[data-sidebar="collapsed"] .sidebar__group-label::before {
  content: "—";
  display: block;
  color: var(--vp-gray-700);
}
.app[data-sidebar="collapsed"] .sidebar__group-label > span { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--nav-py, 9px) 12px;
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-left: 2px solid transparent;
  margin-bottom: 1px;
  position: relative;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-item.is-active {
  color: var(--vp-yellow);
  background: rgba(245,196,0,.08);
  border-left-color: var(--vp-yellow);
  font-weight: 600;
}
.nav-item__icon { flex-shrink: 0; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; }
.nav-item__icon svg { width: 18px; height: 18px; stroke-width: 1.6; }
.nav-item__label { flex: 1; }
.nav-item__badge {
  background: var(--vp-yellow);
  color: #000;
  font-weight: 800;
  font-size: 10px;
  padding: 1px 6px;
  letter-spacing: .04em;
  font-family: var(--font-mono);
}
.app[data-sidebar="collapsed"] .nav-item { justify-content: center; padding: 11px 0; }
.app[data-sidebar="collapsed"] .nav-item__label,
.app[data-sidebar="collapsed"] .nav-item__badge { display: none; }

/* sidebar tooltip when collapsed */
.app[data-sidebar="collapsed"] .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #000;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 8px 12px;
  white-space: nowrap;
  border-left: 2px solid var(--vp-yellow);
  z-index: 200;
  margin-left: 8px;
  pointer-events: none;
}

.sidebar__foot {
  border-top: 1px solid var(--vp-gray-900);
  padding: 10px 8px;
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--vp-gray-900);
  background: var(--vp-gray-900);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.sidebar__user:hover { border-color: var(--vp-yellow); }
.avatar {
  width: 30px; height: 30px;
  background: var(--vp-yellow);
  color: #000;
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.2; }
.sidebar__user-role { font-size: 10px; color: var(--vp-gray-500); font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.app[data-sidebar="collapsed"] .sidebar__user-info,
.app[data-sidebar="collapsed"] .sidebar__user .chev { display: none; }
.app[data-sidebar="collapsed"] .sidebar__user { justify-content: center; padding: 4px; }

.sidebar__collapse {
  position: absolute;
  top: 22px;
  right: -12px;
  width: 22px; height: 22px;
  background: #000;
  border: 1px solid var(--vp-gray-700);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: all var(--dur-fast) var(--ease-out);
}
.sidebar__collapse:hover { background: var(--vp-yellow); color: #000; border-color: var(--vp-yellow); }

/* ========== HEADER ================================================= */
.header {
  grid-area: header;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: relative;
  z-index: 10;
}
.header::after {
  /* tiny yellow underline */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--vp-yellow);
  opacity: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg3);
}
.breadcrumb .sep { color: var(--vp-yellow); font-weight: 700; }
.breadcrumb .cur { color: var(--fg1); font-weight: 600; }

.header__search {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: var(--vp-gray-50);
  border: 1px solid var(--border);
  width: 320px;
  height: 36px;
  padding: 0 12px;
  gap: 8px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.header__search:focus-within { border-color: var(--vp-yellow); background: #fff; }
.header__search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--fg1); }
.header__search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 1px 6px;
  color: var(--fg3);
}

.header__btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg2);
  position: relative;
  transition: all var(--dur-fast) var(--ease-out);
}
.header__btn:hover { color: var(--vp-yellow-press); border-color: var(--fg1); }
.header__btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--vp-danger);
  border: 1.5px solid #fff;
}

.role-switch {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  background: #fff;
  height: 36px;
}
.role-switch button {
  border: 0;
  background: transparent;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg2);
  padding: 0 10px;
  height: 100%;
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.role-switch button:last-child { border-right: 0; }
.role-switch button.is-active { background: var(--vp-yellow); color: #000; }
.role-switch button:hover:not(.is-active) { color: var(--fg1); background: var(--vp-gray-50); }

/* ========== MAIN AREA =============================================== */
.main {
  grid-area: main;
  overflow-y: auto;
  background: var(--vp-gray-50);
}
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: var(--vp-gray-300); }
.page {
  padding: var(--page-py, 28px) var(--page-px, 32px) 64px;
  max-width: 1600px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.page-head__l { display: flex; flex-direction: column; gap: 8px; }
.page-head__eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-press);
}
.page-head__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 36px; text-transform: uppercase; letter-spacing: -.005em; line-height: 1; }
.page-head__sub { color: var(--fg2); font-size: 14px; max-width: 640px; margin: 0; }
.page-head__r { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ========== BUTTONS ================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: all var(--dur-fast) var(--ease-out);
  line-height: 1;
  height: 36px;
}
.btn--primary { background: var(--vp-yellow); color: #000; }
.btn--primary:hover { background: var(--vp-yellow-bright); transform: translateY(-1px); box-shadow: 0 3px 0 0 #000; }
.btn--secondary { background: #000; color: #fff; }
.btn--secondary:hover { background: var(--vp-gray-900); }
.btn--outline { background: #fff; color: #000; border: 1px solid var(--border-strong); }
.btn--outline:hover { border-color: #000; }
.btn--ghost { background: transparent; color: var(--fg2); padding: 8px 10px; }
.btn--ghost:hover { color: var(--fg1); background: var(--vp-gray-100); }
.btn--danger { background: #fff; color: var(--vp-danger); border: 1px solid var(--vp-danger); }
.btn--danger:hover { background: var(--vp-danger); color: #fff; }
.btn--sm { height: 28px; padding: 6px 10px; font-size: 10px; }
.btn--lg { height: 44px; padding: 14px 22px; font-size: 12px; }
.btn--icon { padding: 0; width: 36px; justify-content: center; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ========== CARDS ================================================== */
.card {
  background: #fff;
  border: 1px solid var(--border);
  padding: var(--pad-card, 18px);
  position: relative;
}
.card.sharp::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 3px;
  background: var(--vp-yellow);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin: -2px 0 14px;
  gap: 12px;
}
.card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.card__sub { font-size: 11px; color: var(--fg3); font-family: var(--font-mono); letter-spacing: .04em; }
.card__act { display: flex; gap: 6px; }

/* KPI Card */
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  padding: var(--kpi-py, 18px) var(--kpi-py, 18px) calc(var(--kpi-py, 18px) - 2px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.kpi:hover { border-color: var(--vp-yellow); }
.kpi__stripe { position: absolute; top: 0; left: 0; width: 24px; height: 3px; background: var(--vp-yellow); }
.kpi__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg3);
  display: flex; align-items: center; gap: 8px;
}
.kpi__label svg { width: 12px; height: 12px; stroke-width: 1.8; color: var(--fg2); }
.kpi__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--kpi-fs, 36px);
  line-height: 1;
  color: var(--fg1);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.kpi__value .unit { font-size: 14px; color: var(--fg3); margin-left: 4px; font-weight: 600; }
.kpi__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--fg2);
  font-family: var(--font-mono);
}
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-family: var(--font-sans); font-size: 11px; }
.delta.up { color: var(--vp-success); }
.delta.down { color: var(--vp-danger); }
.delta.flat { color: var(--fg3); }

/* ========== BADGES ================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.4;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--neutral { background: var(--vp-gray-100); color: var(--fg2); }
.badge--success { background: var(--vp-success-tint); color: var(--vp-success-ink); }
.badge--info    { background: var(--vp-info-tint); color: var(--vp-info); }
.badge--warning { background: var(--vp-warning-tint); color: var(--vp-warning-ink); }
.badge--danger  { background: var(--vp-danger-tint); color: var(--vp-danger-ink); }
.badge--ink     { background: #000; color: #fff; }
.badge--yellow  { background: var(--vp-yellow); color: #000; }
.badge--outline { background: transparent; border-color: var(--border-strong); color: var(--fg2); }

/* sku pill */
.sku {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--vp-gray-100);
  color: var(--fg2);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0;
}

/* ========== TABLE ================================================== */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}
table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-table, 13.5px);
}
table.t thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg3);
  padding: var(--th-py, 11px) 14px;
  border-bottom: 1px solid var(--border);
  background: var(--vp-gray-50);
  white-space: nowrap;
}
table.t tbody td {
  padding: var(--row-py, 12px) 14px;
  border-bottom: 1px solid var(--border);
  color: var(--fg1);
  vertical-align: middle;
}
table.t tbody tr { cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
table.t tbody tr:hover { background: var(--vp-gray-50); }
table.t tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 0 var(--vp-yellow); }
table.t tbody tr:last-child td { border-bottom: 0; }

.cell-main { font-weight: 600; color: var(--fg1); }
.cell-sub { font-size: 11px; color: var(--fg3); margin-top: 2px; font-family: var(--font-mono); }
.cell-money { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.cell-num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12.5px; }

/* table toolbar */
.tbar {
  background: #fff;
  border: 1px solid var(--border);
  border-bottom: 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tbar .filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg2);
  cursor: pointer;
  height: 28px;
}
.tbar .filter-pill.is-active { background: #000; color: #fff; border-color: #000; }
.tbar .filter-pill .x { color: var(--fg3); font-size: 14px; margin-left: 2px; }
.tbar .spacer { flex: 1; }
.tbar .search {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong);
  height: 28px; padding: 0 10px; flex: 0 1 240px;
}
.tbar .search input { border: 0; outline: 0; font-size: 12px; flex: 1; background: transparent; }

/* ========== STATUS DOT + TIMELINE ================================= */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--vp-gray-400);
}
.status-dot.success { background: var(--vp-success); }
.status-dot.info { background: var(--vp-info); }
.status-dot.warning { background: var(--vp-warning); }
.status-dot.danger { background: var(--vp-danger); }
.status-dot.yellow { background: var(--vp-yellow); }

/* ========== ALERTS / banners ====================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-left: 3px solid var(--vp-warning);
  background: var(--vp-warning-tint);
  font-size: 13px;
  color: var(--vp-warning-ink);
}
.alert.danger { border-left-color: var(--vp-danger); background: var(--vp-danger-tint); color: var(--vp-danger-ink); }
.alert.info { border-left-color: var(--vp-info); background: var(--vp-info-tint); color: var(--vp-info); }
.alert.success { border-left-color: var(--vp-success); background: var(--vp-success-tint); color: var(--vp-success-ink); }
.alert__title { font-weight: 700; }
.alert__sub { font-size: 12px; opacity: .85; }
.alert svg { stroke-width: 2; width: 18px; height: 18px; flex-shrink: 0; }

/* ========== INPUTS ================================================= */
.input {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13px;
  color: var(--fg1);
  outline: none;
  transition: all var(--dur-fast) var(--ease-out);
  border-radius: 0;
}
.input:focus { border-color: var(--vp-yellow); box-shadow: 0 0 0 3px rgba(245,196,0,.22); }
.input[type="number"] { font-variant-numeric: tabular-nums; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg2) 50%), linear-gradient(135deg, var(--fg2) 50%, transparent 50%); background-position: calc(100% - 14px) 16px, calc(100% - 9px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label, .label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg2);
}
.field .help { font-size: 11px; color: var(--fg3); margin-top: -2px; }

/* ========== TWO-COL PAGE / detail =============================== */
.split { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.split--wide { grid-template-columns: 1fr 440px; }
.stack { display: flex; flex-direction: column; gap: var(--gap-stack, 14px); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--grid-gap, 16px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap, 16px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gap, 16px); }
.row { display: flex; gap: 12px; align-items: center; }
.row.sb { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

/* ========== TIMELINE (vertical) =================================== */
.timeline {
  display: flex; flex-direction: column;
  position: relative;
}
.timeline__row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 0;
  position: relative;
}
.timeline__rail {
  width: 2px;
  background: var(--vp-gray-200);
  position: absolute;
  left: 11px;
  top: 26px;
  bottom: -10px;
}
.timeline__row:last-child .timeline__rail { display: none; }
.timeline__node {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--vp-gray-300);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2;
  flex-shrink: 0;
}
.timeline__row.done .timeline__node { border-color: var(--vp-success); background: var(--vp-success); }
.timeline__row.done .timeline__node::after { content: ""; width: 8px; height: 8px; background: #fff; clip-path: polygon(14% 50%, 0 60%, 35% 95%, 100% 25%, 88% 12%, 35% 70%); }
.timeline__row.current .timeline__node { border-color: var(--vp-yellow); background: var(--vp-yellow); }
.timeline__row.current .timeline__node::after { content: ""; width: 8px; height: 8px; background: #000; border-radius: 50%; }
.timeline__row.warn .timeline__node { border-color: var(--vp-warning); background: var(--vp-warning); }
.timeline__row.warn .timeline__node::after { content: "!"; color: #fff; font-weight: 900; font-size: 12px; line-height: 1; }
.timeline__title { font-weight: 600; color: var(--fg1); font-size: 13px; }
.timeline__sub { color: var(--fg3); font-size: 11px; font-family: var(--font-mono); margin-top: 2px; }
.timeline__meta { font-size: 11px; color: var(--fg3); font-family: var(--font-mono); text-align: right; }

/* ========== Modal / dialog ======================================== */
.modal-shroud {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  animation: fadeIn .2s var(--ease-out);
}
.modal {
  background: #fff;
  width: 720px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--vp-yellow);
  box-shadow: var(--shadow-xl);
}
.modal__head {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; text-transform: uppercase; }
.modal__body { padding: 22px 24px; overflow-y: auto; }
.modal__foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--vp-gray-50); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Misc: tabs, segmented, toggles ======================== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
}
.tab {
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  border-top: 0; border-left: 0; border-right: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--fg1); }
.tab.is-active { color: var(--fg1); border-bottom-color: var(--vp-yellow); }
.tab .count { background: var(--vp-gray-100); color: var(--fg2); font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; border-radius: 999px; letter-spacing: 0; }
.tab.is-active .count { background: #000; color: #fff; }

.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  background: #fff;
  height: 32px;
}
.seg button {
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg2);
  padding: 0 12px;
  cursor: pointer;
  border-right: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button:last-child { border-right: 0; }
.seg button.is-active { background: #000; color: #fff; }

/* progress bar */
.progress { width: 100%; height: 4px; background: var(--vp-gray-200); position: relative; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--vp-yellow); }
.progress.thin { height: 2px; }
.progress.tall { height: 8px; }

/* link */
.link {
  color: var(--fg1);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.link:hover { border-bottom-color: var(--vp-yellow); color: var(--accent-press); }

/* tooltips for SVG icon-only buttons */
.icon-btn-row .btn--icon[title] { position: relative; }

/* divider */
.hr { height: 1px; background: var(--border); margin: 12px 0; }
.divider-v { width: 1px; background: var(--border); align-self: stretch; }

/* helpful color text */
.muted { color: var(--fg3); }
.semi { color: var(--fg2); }
.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }
.up-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-press);
}
.up-eyebrow.muted { color: var(--fg3); }

.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--vp-yellow); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* tooltips */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 4px 8px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

/* ========== EMPTY ============================================ */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--fg3);
  background: #fff;
  border: 1px dashed var(--border-strong);
}
.empty h4 { font-family: var(--font-display); font-size: 20px; text-transform: uppercase; color: var(--fg2); margin: 8px 0; }

/* ========== gantt + map specific =================================== */
/* Defined in module files for clarity */

/* utility */
.scrollable { overflow: auto; }
.no-shrink { flex-shrink: 0; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.fade-in { animation: fadeIn .2s var(--ease-out); }
.slide-up { animation: slideUp .25s var(--ease-out); }
