/* =================================================================
   RANE DMS Portal — shared chrome + component CSS
   Layered on top of tokens.css. Used by all 8 mock HTML files.
   ================================================================= */

/* ---------- App shell ---------- */
.app {
  display: flex;
  height: 100vh;
  width: 100%;
  background: var(--sd-bg-app);
  overflow: hidden;
}

.app__main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.app__content {
  flex: 1;
  overflow: auto;
  padding: 22px 32px 80px;
}

.app__content--wide { padding: 22px 28px 80px; }

/* ---------- Sidebar (vertical icon rail) ---------- */
.rail {
  width: 96px;
  background: #fff;
  border-right: 1px solid var(--sd-line-300);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.rail__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-bottom: 1px solid var(--sd-line-300);
  padding: 0 12px;
}

.rail__brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--sd-blue-600) 0%, var(--sd-teal-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.rail__nav {
  flex: 1;
  overflow: auto;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  text-decoration: none;
  color: var(--sd-ink-400);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  border-left: 3px solid transparent;
  transition: background 120ms ease, color 120ms ease;
}

.rail__item:hover { background: var(--sd-line-100); }

.rail__item--active {
  color: var(--sd-navy-900);
  font-weight: 600;
  background: #fff;
  border-left-color: var(--sd-blue-600);
}

.rail__item--active .rail__icon { color: var(--sd-blue-600); }

.rail__icon {
  width: 22px;
  height: 22px;
  color: var(--sd-ink-400);
  flex-shrink: 0;
}

.rail__version {
  text-align: center;
  font-family: var(--sd-mono);
  font-weight: 500;
  font-size: 10px;
  color: var(--sd-ink-400);
  padding: 10px 0 14px;
  border-top: 1px solid var(--sd-line-100);
}

/* ---------- Header ---------- */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--sd-line-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  gap: 16px;
}

.topbar__left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: 12px; }

.topbar__crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sd-ink-400);
  font-size: 13px;
}
.topbar__crumb a {
  color: var(--sd-ink-400);
  text-decoration: none;
}
.topbar__crumb a:hover { color: var(--sd-blue-600); }
.topbar__crumb-sep { color: var(--sd-ink-200); }
.topbar__crumb-current { color: var(--sd-ink-800); font-weight: 500; }

.topbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  width: 320px;
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  color: var(--sd-ink-400);
  font-size: 13px;
}
.topbar__search-kbd {
  margin-left: auto;
  font-family: var(--sd-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  color: var(--sd-ink-400);
}

.topbar__icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--sd-line-300);
  background: #fff;
  border-radius: var(--sd-radius-sm);
  color: var(--sd-ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: color 150ms ease, border-color 150ms ease;
}
.topbar__icon-btn:hover {
  color: var(--sd-blue-600);
  border-color: var(--sd-blue-600);
}
.topbar__icon-btn .dot {
  position: absolute;
  top: 6px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sd-red-600);
  border: 2px solid #fff;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--sd-line-300);
  border-radius: 999px;
  background: #fff;
}
.topbar__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sd-blue-600);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px;
}
.topbar__user-name { font-size: 12px; font-weight: 500; color: var(--sd-ink-800); white-space: nowrap; }
.topbar__user-role { font-size: 10px; color: var(--sd-ink-400); white-space: nowrap; }

/* ---------- Page header (kicker / title / meta / actions) ---------- */
.page-head { margin-bottom: 22px; }
.page-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-head__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sd-ink-900);
  margin: 4px 0 0;
}
.page-head__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
  color: var(--sd-ink-500);
  font-size: 13px;
}
.page-head__meta .sep { color: var(--sd-ink-200); }
.page-head__actions { display: flex; gap: 8px; align-items: center; }

/* Caps eyebrow (uppercase 11/.08em/500) */
.caps {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sd-ink-400);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  font-family: var(--sd-font);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--sd-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 44px; padding: 0 18px; font-size: 14px; }

.btn--primary {
  background: var(--sd-blue-600);
  color: #fff;
}
.btn--primary:hover { background: var(--sd-blue-700); }

.btn--pill { border-radius: 999px; font-weight: 600; padding: 0 18px; }

.btn--ghost {
  background: #fff;
  border-color: var(--sd-line-300);
  color: var(--sd-ink-700);
}
.btn--ghost:hover { border-color: var(--sd-blue-600); color: var(--sd-blue-600); background: var(--sd-blue-050); }

.btn--soft {
  background: var(--sd-blue-100);
  color: var(--sd-blue-700);
}
.btn--soft:hover { background: #d4e1ee; }

.btn--danger {
  background: var(--sd-red-600);
  color: #fff;
}
.btn--danger:hover { filter: brightness(0.93); }

.btn--icon {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.btn svg { width: 16px; height: 16px; }

/* ---------- Form controls ---------- */
.input, .select {
  height: 38px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  font-family: var(--sd-font);
  font-size: 13px;
  color: var(--sd-ink-800);
  width: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input::placeholder { color: var(--sd-ink-300); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--sd-teal-600);
  box-shadow: 0 0 0 3px rgba(23,162,184,.18);
}
.input--filter { height: 44px; }

.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-ink-700);
}
.field__hint {
  font-size: 11px;
  color: var(--sd-ink-400);
}
.field__req { color: var(--sd-red-600); margin-left: 2px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237D7D7D' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.textarea {
  min-height: 80px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  font-family: var(--sd-font);
  font-size: 13px;
  color: var(--sd-ink-800);
  resize: vertical;
  width: 100%;
}

/* Filter row at 44px height */
.filter-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-row .input, .filter-row .select { height: 44px; }
.filter-row .btn { height: 44px; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.badge--blue   { background: var(--sd-blue-100);  color: var(--sd-blue-700); }
.badge--teal   { background: var(--sd-teal-100);  color: #0E7385; }
.badge--green  { background: var(--sd-green-100); color: #1F6A3F; }
.badge--amber  { background: var(--sd-amber-100); color: var(--sd-amber-text); }
.badge--red    { background: var(--sd-red-100);   color: #A8273F; }
.badge--grey   { background: var(--sd-line-100);  color: var(--sd-ink-500); }
.badge--navy   { background: #E3E8F0;             color: var(--sd-navy-900); }

.badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}

/* Status pill — used on entity lists */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--sd-line-100);
  color: var(--sd-ink-700);
  white-space: nowrap;
}

/* ---------- Code chip ---------- */
.chip-code {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--sd-radius-sm);
  font-family: var(--sd-mono);
  font-size: 12px;
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-300);
  color: var(--sd-ink-700);
}

.mono { font-family: var(--sd-mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-md);
}
.card--flat { box-shadow: none; }
.card__head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--sd-line-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--sd-ink-900);
  margin: 0;
}
.card__subtitle {
  font-size: 12px;
  color: var(--sd-ink-500);
  margin-top: 2px;
}
.card__body { padding: 16px 20px 18px; }
.card__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--sd-line-100);
  background: var(--sd-bg-soft);
  border-radius: 0 0 var(--sd-radius-lg) var(--sd-radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sd-ink-500);
}

/* ---------- KPI cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-md);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--sd-ink-400);
}
.kpi__value {
  font-size: 26px;
  font-weight: 600;
  color: var(--sd-ink-900);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kpi__value .unit { font-size: 13px; font-weight: 500; color: var(--sd-ink-500); }
.kpi__delta {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--sd-ink-500);
}
.kpi__delta--up   { color: var(--sd-green-600); }
.kpi__delta--down { color: var(--sd-red-600); }
.kpi__foot {
  margin-top: 4px;
  font-size: 11px;
  color: var(--sd-ink-400);
}

/* ---------- Table (AG-grid styled) ---------- */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  color: var(--sd-ink-800);
}
.tbl thead th {
  position: sticky; top: 0;
  background: var(--sd-bg-soft);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sd-ink-500);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sd-line-300);
  white-space: nowrap;
}
.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--sd-line-100);
  vertical-align: middle;
  background: #fff;
}
.tbl tbody tr:hover td { background: var(--sd-teal-050); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl td .chip-code { font-size: 11px; }

.tbl--compact thead th { padding: 8px 12px; }
.tbl--compact tbody td { padding: 9px 12px; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* Table container card */
.table-card {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  overflow: hidden;
  box-shadow: var(--sd-shadow-md);
}
.table-card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--sd-line-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.table-card__title {
  font-size: 14px; font-weight: 600; color: var(--sd-ink-800);
}
.table-card__body { max-height: none; overflow: auto; }
.table-card__foot {
  padding: 10px 18px;
  border-top: 1px solid var(--sd-line-100);
  background: var(--sd-bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sd-ink-500);
}

/* ---------- Tab strip ---------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--sd-line-300);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tabs__item {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sd-ink-500);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}
.tabs__item:hover { color: var(--sd-ink-800); }
.tabs__item--active {
  color: var(--sd-navy-900);
  font-weight: 600;
  border-bottom-color: var(--sd-blue-600);
}
.tabs__item .count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sd-line-100);
  color: var(--sd-ink-500);
  font-weight: 500;
}
.tabs__item--active .count {
  background: var(--sd-blue-100); color: var(--sd-blue-700);
}

/* Segmented control */
.seg {
  display: inline-flex;
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-sm);
  padding: 3px;
  gap: 2px;
}
.seg__item {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-ink-500);
  border-radius: 3px;
  cursor: pointer;
  background: transparent;
  border: none;
}
.seg__item--active {
  background: #fff;
  color: var(--sd-ink-900);
  box-shadow: var(--sd-shadow-sm);
}

/* ---------- Inbox / list rows ---------- */
.inbox {
  display: flex;
  flex-direction: column;
}
.inbox__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--sd-line-100);
  cursor: pointer;
  transition: background 120ms ease;
  text-decoration: none;
  color: inherit;
}
.inbox__item:hover { background: var(--sd-blue-050); }
.inbox__item:last-child { border-bottom: none; }
.inbox__item--unread { background: rgba(7,98,173,0.02); }
.inbox__item--unread .inbox__title { font-weight: 600; }
.inbox__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--sd-blue-600);
  flex-shrink: 0; opacity: 0;
}
.inbox__item--unread .inbox__dot { opacity: 1; }
.inbox__icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--sd-blue-100);
  color: var(--sd-blue-700);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.inbox__icon--amber { background: var(--sd-amber-100); color: var(--sd-amber-text); }
.inbox__icon--red   { background: var(--sd-red-100);   color: #A8273F; }
.inbox__icon--green { background: var(--sd-green-100); color: #1F6A3F; }
.inbox__icon--teal  { background: var(--sd-teal-100);  color: #0E7385; }
.inbox__icon--grey  { background: var(--sd-line-100);  color: var(--sd-ink-500); }

.inbox__main { flex: 1; min-width: 0; }
.inbox__title {
  font-size: 13px;
  color: var(--sd-ink-900);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox__sub {
  font-size: 12px;
  color: var(--sd-ink-500);
  margin-top: 2px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.inbox__sub .sep { color: var(--sd-ink-200); }
.inbox__meta {
  font-size: 11px;
  color: var(--sd-ink-400);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Module launcher (grid of cards) ---------- */
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.launcher {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.launcher:hover {
  border-color: var(--sd-blue-600);
  box-shadow: var(--sd-shadow-md);
}
.launcher__icon {
  width: 36px; height: 36px;
  color: var(--sd-blue-600);
}
.launcher__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--sd-ink-900);
}
.launcher__desc {
  font-size: 12px;
  color: var(--sd-ink-500);
  line-height: 1.5;
}
.launcher__foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--sd-ink-500);
}

/* ---------- Misc ---------- */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.stack { display: flex; flex-direction: column; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-3 { display: flex; flex-direction: column; gap: 12px; }
.stack-4 { display: flex; flex-direction: column; gap: 16px; }
.stack-6 { display: flex; flex-direction: column; gap: 24px; }

.row { display: flex; align-items: center; gap: 8px; }
.row-3 { display: flex; align-items: center; gap: 12px; }
.row-4 { display: flex; align-items: center; gap: 16px; }
.spacer { flex: 1; }

.divider { height: 1px; background: var(--sd-line-200); }

.muted { color: var(--sd-ink-500); }
.faint { color: var(--sd-ink-400); }
.ink   { color: var(--sd-ink-900); }

a.link { color: var(--sd-blue-600); text-decoration: none; }
a.link:hover { text-decoration: underline; }

/* Empty state */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--sd-ink-500);
}
.empty__icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sd-bg-soft);
  color: var(--sd-ink-300);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.empty__title {
  font-size: 15px; font-weight: 600; color: var(--sd-ink-800);
  margin-bottom: 6px;
}
.empty__sub {
  font-size: 13px; color: var(--sd-ink-500);
  max-width: 360px; margin: 0 auto 14px;
}

/* Banners */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--sd-radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.banner--info  { background: var(--sd-blue-100);  color: var(--sd-blue-700); border: 1px solid #c5d9ec; }
.banner--warn  { background: var(--sd-amber-100); color: var(--sd-amber-text); border: 1px solid #f3d99a; }
.banner--error { background: var(--sd-red-100);   color: #8a2238; border: 1px solid #f1becb; }
.banner--success { background: var(--sd-green-100); color: #1F6A3F; border: 1px solid #c4dfcf; }
.banner svg { flex-shrink: 0; }

/* Timeline (used on PO detail / discrepancy detail / warranty detail) */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--sd-line-200);
}
.timeline__item {
  position: relative;
  padding-bottom: 18px;
}
.timeline__dot {
  position: absolute;
  left: -23px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--sd-blue-600);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--sd-blue-600);
}
.timeline__dot--green { background: var(--sd-green-600); box-shadow: 0 0 0 1px var(--sd-green-600); }
.timeline__dot--amber { background: var(--sd-amber-500); box-shadow: 0 0 0 1px var(--sd-amber-500); }
.timeline__dot--red   { background: var(--sd-red-600);   box-shadow: 0 0 0 1px var(--sd-red-600); }
.timeline__dot--idle  { background: #fff; box-shadow: 0 0 0 1px var(--sd-line-300); }
.timeline__title {
  font-size: 13px; font-weight: 500; color: var(--sd-ink-900);
}
.timeline__meta {
  font-size: 11px; color: var(--sd-ink-400);
  margin-top: 2px;
  display: flex; align-items: center; gap: 8px;
}
.timeline__body {
  font-size: 12px; color: var(--sd-ink-500);
  margin-top: 4px;
}

/* Sub-nav (anchor link strip inside a module page) */
.subnav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--sd-bg-app);
  margin: 0 -32px 22px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--sd-line-300);
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
}
.subnav a {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sd-ink-500);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
}
.subnav a:hover { background: #fff; color: var(--sd-ink-900); }
.subnav a.active { background: var(--sd-navy-900); color: #fff; }

/* Section anchor */
.section {
  scroll-margin-top: 70px;
}
.section + .section { margin-top: 36px; }
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--sd-ink-900);
  margin: 0;
}
.section__sub {
  font-size: 13px;
  color: var(--sd-ink-500);
  margin-top: 4px;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 20px;
}
.stepper__step {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.stepper__num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--sd-line-300);
  color: var(--sd-ink-400);
  flex-shrink: 0;
}
.stepper__step--active .stepper__num {
  background: var(--sd-blue-600); border-color: var(--sd-blue-600); color: #fff;
}
.stepper__step--done .stepper__num {
  background: var(--sd-green-600); border-color: var(--sd-green-600); color: #fff;
}
.stepper__label {
  font-size: 12px;
  color: var(--sd-ink-500);
  font-weight: 500;
}
.stepper__step--active .stepper__label { color: var(--sd-ink-900); font-weight: 600; }
.stepper__step--done .stepper__label { color: var(--sd-ink-800); }
.stepper__bar {
  height: 2px;
  background: var(--sd-line-200);
  flex: 1;
  margin: 0 8px;
}
.stepper__step--done + .stepper__step .stepper__bar,
.stepper__bar--done { background: var(--sd-green-600); }

/* Progress / slab bar */
.slab {
  position: relative;
  height: 10px;
  background: var(--sd-line-100);
  border-radius: 999px;
  overflow: hidden;
}
.slab__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sd-blue-600), var(--sd-teal-600));
  border-radius: 999px;
}

/* Save bar */
.savebar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--sd-line-300);
  box-shadow: var(--sd-shadow-savebar);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -32px -80px;
  z-index: 4;
}
.savebar__dirty {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--sd-ink-700);
}
.savebar__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sd-blue-600);
  box-shadow: 0 0 0 4px rgba(7,98,173,.16);
}

/* Avatar */
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sd-blue-600);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--teal { background: var(--sd-teal-600); }
.avatar--navy { background: var(--sd-navy-900); }
.avatar--grey { background: var(--sd-ink-400); }

/* Detail header (used on PO detail, discrepancy detail) */
.det-hd {
  background: #fff;
  border: 1px solid var(--sd-line-300);
  border-radius: var(--sd-radius-lg);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.det-hd__row { display: flex; gap: 24px; flex-wrap: wrap; }
.det-hd__field { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.det-hd__field-label { font-size: 11px; color: var(--sd-ink-400); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.det-hd__field-value { font-size: 13px; color: var(--sd-ink-900); font-weight: 500; }

/* Approval matrix mini */
.matrix {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 16px;
  row-gap: 10px;
  align-items: center;
}
.matrix__step {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--sd-line-100);
  border: 1px solid var(--sd-line-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  color: var(--sd-ink-500);
}
.matrix__step--done { background: var(--sd-green-100); border-color: var(--sd-green-600); color: #1F6A3F; }
.matrix__step--active { background: var(--sd-blue-100); border-color: var(--sd-blue-600); color: var(--sd-blue-700); }

/* Two-column detail (header / lines) */
.lines-tbl td { font-size: 12.5px; }
.lines-tbl .num { font-variant-numeric: tabular-nums; }

/* Evidence gallery */
.evidence {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.evidence__item {
  width: 96px; height: 96px;
  border-radius: var(--sd-radius-sm);
  background: var(--sd-bg-soft);
  border: 1px solid var(--sd-line-300);
  display: flex; align-items: center; justify-content: center;
  color: var(--sd-ink-400);
  font-size: 11px;
  position: relative;
  overflow: hidden;
}
.evidence__type {
  position: absolute;
  bottom: 4px; left: 4px;
  font-family: var(--sd-mono);
  font-size: 9px;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .04em;
}

/* Hide scrollbar nicely */
.app__content::-webkit-scrollbar { width: 10px; height: 10px; }
.app__content::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 999px; border: 2px solid var(--sd-bg-app); }
.app__content::-webkit-scrollbar-track { background: transparent; }
