/* ============================================================
   TransferLeadger — Dashboard styles
   Layered on top of the sign-in page's CSS variables.
   ============================================================ */

/* ---------- Screen routing ---------- */
.screen { display: none; }
body[data-screen="signin"]    .screen.signin    { display: block; }
body[data-screen="dashboard"] .screen.dashboard { display: block; }

/* The auth overlay is on top of either, controlled by data-auth */
.auth-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: none;
  background: rgba(10, 11, 13, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center; justify-content: center;
}
body[data-auth="active"] .auth-overlay { display: flex; }

.auth-card {
  width: min(520px, calc(100vw - 48px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 36px 36px 28px;
  position: relative;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7);
}
.auth-card .auth-corner {
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--accent);
}
.auth-card .auth-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.auth-card .auth-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.auth-card .auth-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.auth-card .auth-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.auth-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.auth-eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--accent);
}
.auth-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 26px;
  letter-spacing: 0.04em;
}
.auth-sub .url { color: var(--accent-bright); }

.auth-steps {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 26px;
}
.auth-step {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 0;
  border-bottom: 1px dashed transparent;
  transition: color 200ms ease, border-color 300ms ease;
}
.auth-step .ix {
  font-size: 10.5px;
  color: var(--text-dim);
}
.auth-step .label { letter-spacing: 0.02em; }
.auth-step .state {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.auth-step.done {
  color: var(--text);
  border-bottom-color: var(--border);
}
.auth-step.done .ix { color: var(--ok); }
.auth-step.done .state { color: var(--ok); }
.auth-step.active {
  color: var(--text);
  border-bottom-color: var(--border);
}
.auth-step.active .ix { color: var(--accent-bright); }
.auth-step.active .state {
  color: var(--accent-bright);
  display: inline-flex; align-items: center; gap: 6px;
}
.auth-step.active .state::after {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 8px var(--accent-bright);
  animation: pulse 1s ease-in-out infinite;
}
.auth-progress {
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 10px;
}
.auth-progress .bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transition: width 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.auth-foot {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: flex; justify-content: space-between;
}

/* ============================================================
   Dashboard
   ============================================================ */

.dash {
  min-height: 100vh;
  display: block;
}

/* ---------- Top horizontal nav ---------- */
.logo-sm {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 16px; color: var(--accent-bright);
  border: 1px solid var(--border-strong); border-radius: 3px;
  background: var(--surface);
}
.top-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1;
}
.top-nav .rail-item {
  width: auto; height: 36px;
  padding: 0 14px;
  border-radius: 2px;
  border: none;
  background: transparent;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 120ms ease;
}
.top-nav .rail-item:hover { color: #ffffff; background: rgba(245,158,11,0.35); }
.top-nav .rail-item.active {
  color: #ffffff;
  background: #f59e0b;
}
.top-nav .rail-item.active::before { display: none; }
.top-nav .rail-item .tip { display: none; }
.top-nav .rail-item svg { width: 16px; height: 16px; }

.dash-subbar {
  padding: 10px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dash-subbar .crumbs { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); display: flex; gap: 10px; align-items: center; }
.dash-subbar .crumbs .here { color: var(--text); }
.dash-subbar .crumbs .arr { color: var(--text-dim); }

.search.under-tabs {
  flex: none; max-width: none;
  width: 100%;
  margin: 12px 0 4px;
  position: relative;
}

/* Inline search in top nav (after Settings tab) */
.top-search {
  margin-left: 10px;
  position: relative;
  display: flex; align-items: center;
  width: 220px;
}
.top-search input {
  width: 100%;
  height: 32px;
  padding: 0 44px 0 32px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.top-search input::placeholder { color: var(--text-dim); }
.top-search input:focus { border-color: #f59e0b; background: var(--surface-2); }
.top-search .icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.top-search .kbd {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
  background: var(--surface-2);
}

/* Light / Dark toggle (replaces ? icon) */
.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
}
.theme-toggle .th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  background: transparent;
  border: none;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 120ms ease;
}
.theme-toggle .th + .th { border-left: 1px solid var(--border); }
.theme-toggle .th:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle .th.active {
  color: #ffffff;
  background: #f59e0b;
}

/* Light theme */
body[data-theme="light"] {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #ece8df;
  --text: #1c1a14;
  --text-2: #4a463c;
  --text-dim: #8a8478;
  --border: #d8d2c4;
  --border-strong: #b8b1a0;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --bg-grid: transparent;
}
body[data-theme="light"] { background-image: none !important; color-scheme: light; }
body[data-theme="light"]::-webkit-scrollbar { background: #1c1a14; width: 12px; }
body[data-theme="light"]::-webkit-scrollbar-track { background: #1c1a14; }
body[data-theme="light"]::-webkit-scrollbar-thumb { background: #4a4538; border-radius: 6px; }
body[data-theme="light"]::-webkit-scrollbar-thumb:hover { background: #6b6450; }
html[data-theme="light"], html:has(body[data-theme="light"]) {
  background: #1c1a14 !important;
  color-scheme: light;
}
html:has(body[data-theme="light"])::-webkit-scrollbar { background: #1c1a14; width: 12px; }
html:has(body[data-theme="light"])::-webkit-scrollbar-track { background: #1c1a14; }
html:has(body[data-theme="light"])::-webkit-scrollbar-thumb { background: #4a4538; border-radius: 6px; }
html:has(body[data-theme="light"])::-webkit-scrollbar-thumb:hover { background: #6b6450; }
body[data-theme="light"] { scrollbar-color: #4a4538 #1c1a14; }
body[data-theme="light"]::before { display: none; }
body[data-theme="light"] .auth-overlay { background: rgba(246,244,239,0.92); }
body[data-theme="light"] .drawer-scrim { background: rgba(20,18,12,0.45); }
body[data-theme="light"] .otp-box { color: var(--text); }

/* Light theme · dashboard header keeps a dark band so brand reads white */
body[data-theme="light"] .dash-top {
  background: #1c1a14;
  border-bottom-color: #2a261d;
}
body[data-theme="light"] .dash-top .brand .mark { color: #ffffff; }
body[data-theme="light"] .dash-top .logo-sm {
  background: #2a261d; border-color: rgba(255,255,255,0.2);
}
body[data-theme="light"] .top-nav .rail-item {
  color: #ffffff;
}
body[data-theme="light"] .top-nav .rail-item:hover {
  background: rgba(245,158,11,0.35); color: #ffffff;
}
body[data-theme="light"] .env-pill {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}
body[data-theme="light"] .icon-btn {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
}
body[data-theme="light"] .theme-toggle {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
}
body[data-theme="light"] .theme-toggle .th { color: rgba(255,255,255,0.85); }
body[data-theme="light"] .theme-toggle .th:hover { color: #ffffff; background: rgba(255,255,255,0.08); }
body[data-theme="light"] .theme-toggle .th.active { color: #ffffff; background: #f59e0b; }
body[data-theme="light"] .theme-toggle .th + .th { border-left-color: rgba(255,255,255,0.2); }
body[data-theme="light"] .top-search input {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: #ffffff;
}
body[data-theme="light"] .top-search input::placeholder { color: rgba(255,255,255,0.55); }
body[data-theme="light"] .top-search .icon { color: rgba(255,255,255,0.6); }
body[data-theme="light"] .top-search .kbd {
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
}
body[data-theme="light"] .user-chip {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* User menu (profile setup) */
.user-menu-wrap { position: relative; }
.user-menu-wrap .user-chip { cursor: pointer; }
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.user-menu[data-open="true"] {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
body[data-theme="light"] .user-menu {
  background: #ffffff;
  border-color: var(--border);
  box-shadow: 0 30px 60px -20px rgba(28,26,20,0.25);
}

.um-head {
  padding: 18px 18px 16px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.um-avatar {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.05em;
  font-weight: 700;
}
.um-name { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--text); line-height: 1.1; }
.um-role { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }
.um-email { font-family: var(--mono); font-size: 11px; color: var(--accent-bright); margin-top: 4px; }
.um-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ok);
}
.um-status .um-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.um-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.um-section:last-of-type { border-bottom: none; }
.um-section-title {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.um-row { display: grid; grid-template-columns: 100px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; }
.um-row:last-child { margin-bottom: 0; }
.um-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-dim); }
.um-v {
  font-family: var(--mono); font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 8px;
  outline: none;
  width: 100%;
}
.um-v:focus { border-color: var(--accent); background: var(--surface-2); }

.um-status-row { display: flex; gap: 6px; }
.um-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 5px 8px;
  cursor: pointer;
  color: var(--text-2);
  transition: all 120ms ease;
}
.um-pill:hover { border-color: var(--border-strong); color: var(--text); }
.um-pill.active {
  background: #f59e0b !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
}
.um-pill.active .d { background: #ffffff; box-shadow: none; }
.um-pill .d { width: 6px; height: 6px; border-radius: 50%; }
.um-pill .d.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.um-pill .d.busy { background: var(--err); box-shadow: 0 0 6px var(--err); }
.um-pill .d.off { background: var(--text-dim); }

.um-link {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--text);
  padding: 8px 0;
  cursor: pointer;
  border-top: 1px dashed var(--border);
}
.um-link:first-of-type { border-top: none; }
.um-link:hover { color: var(--accent-bright); }
.um-link .um-meta { font-size: 10.5px; letter-spacing: 0.04em; color: var(--text-dim); }

.um-toggle {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  font-family: var(--mono); font-size: 11.5px; color: var(--text);
  cursor: pointer;
  user-select: none;
}
.um-toggle input { display: none; }
.um-sw {
  width: 30px; height: 16px;
  background: var(--border-strong);
  border-radius: 8px;
  position: relative;
  transition: background 160ms ease;
}
.um-sw::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 160ms ease;
}
.um-toggle input:checked + .um-sw { background: #f59e0b; }
.um-toggle input:checked + .um-sw::after { transform: translateX(14px); }

.um-foot {
  padding: 14px 18px;
  display: flex; gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.um-btn { flex: 1; }
.um-btn.ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.um-btn:not(.ghost) {
  background: #f59e0b; color: #ffffff; border-color: #d97706;
}
.um-btn:not(.ghost):hover { background: #d97706; }

/* ---------- Left rail ---------- */
.rail {
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 18px 0;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail .logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  color: var(--accent-bright);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  margin-bottom: 16px;
  background: var(--surface);
}
.rail-divider {
  width: 24px; height: 1px;
  background: var(--border);
  margin: 8px 0;
}
.rail-item {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
}
.rail-item:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}
.rail-item.active {
  color: var(--accent-bright);
  border-color: rgba(245, 158, 11, 0.35);
  background: var(--accent-soft);
}
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 20px;
  background: var(--accent-bright);
  border-radius: 1px;
}
.rail-item svg { width: 18px; height: 18px; }
.rail-item .tip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 5;
}
.rail-item:hover .tip { opacity: 1; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.user-chip {
  width: 40px; height: 40px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}
.user-chip:hover { border-color: var(--accent); }

/* ---------- Top bar (dashboard) ---------- */
.dash-main {
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.dash-top {
  display: flex; align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10,11,13,0.95), rgba(10,11,13,0.85));
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.crumbs .here { color: var(--text); }
.crumbs .arr { color: var(--text-dim); }

.search {
  flex: 1;
  max-width: 480px;
  margin-left: auto;
  position: relative;
}
.search input {
  width: 100%;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 14px 0 38px;
  font-family: var(--mono);
  font-size: 12px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus { border-color: var(--accent); background: var(--surface-2); }
.search .icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  display: grid; place-items: center;
}
.search .kbd {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.1em;
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: all 120ms ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 6px var(--accent-bright);
}

.env-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
  padding: 6px 10px;
  border-radius: 2px;
}
.env-pill .dot {
  width: 5px; height: 5px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--ok);
}

/* ---------- Page header ---------- */
.dash-content {
  padding: 28px 28px 80px;
  max-width: 1600px;
  width: 100%;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.page-head .left {
  /* override existing .left in signin context only via cascade reset */
  padding: 0; border: none; min-height: 0;
}
.page-head .eye {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.page-head .eye::before {
  content: ""; width: 22px; height: 1px; background: var(--accent);
}
.page-head h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--text);
}
.page-head h1 em { font-style: italic; color: var(--accent-bright); font-weight: 300; }
.page-head .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 10px;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px;
  padding: 0 16px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-radius: 3px;
  cursor: pointer;
  transition: all 120ms ease;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}
.btn:hover { border-color: var(--text-dim); }
.btn.primary {
  background: var(--accent);
  color: #1a0f04;
  border-color: var(--accent);
  box-shadow: 0 8px 24px -10px rgba(217,119,6,0.5);
}
.btn.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn .arr { font-family: var(--mono); }

/* ---------- KPI strip ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 28px;
  overflow: hidden;
}
@media (max-width: 880px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  background: var(--surface);
  padding: 18px 20px;
  display: flex; flex-direction: column;
  gap: 10px;
  position: relative;
  transition: background 150ms ease;
}
.kpi:hover { background: var(--surface-2); }
.kpi .k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.kpi .v {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
}
.kpi .v .unit {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  margin-left: 6px;
}
.kpi .delta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.kpi .delta .up   { color: var(--ok); }
.kpi .delta .down { color: var(--warn); }
.kpi .spark {
  position: absolute;
  right: 14px; bottom: 14px;
  width: 84px; height: 28px;
  opacity: 0.7;
}

/* ---------- Filters bar ---------- */
.filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface);
}
.tab {
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: all 120ms ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:last-child { border-right: none; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active,
.tab.active * {
  color: #ffffff !important;
  background: #f59e0b !important;
}
.tab.active .count {
  color: #ffffff !important;
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.35) !important;
}
.tab .count {
  font-size: 10px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 2px;
}
.tab.active .count {
  color: var(--accent-bright);
  border-color: rgba(245, 158, 11, 0.35);
}
.tab.active .count, .tab.active .count * { color: #ffffff !important; }

.filter-actions { display: flex; gap: 8px; align-items: center; }
.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 120ms ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { color: var(--accent-bright); border-color: rgba(245,158,11,0.4); background: var(--accent-soft); }
.chip .x { color: var(--text-dim); }

/* Commodity dropdown chip */
.chip-select { position: relative; display: inline-block; z-index: 1; }
.chip-select[data-open="true"] { z-index: 9999; }
.chip-select .chip {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.chip-select .chip .lbl { color: var(--text-dim); }
.chip-select .chip .val { color: var(--accent-bright); font-weight: 600; }
.chip-select .chip .caret { opacity: 0.7; transition: transform 160ms ease; }
.chip-select[data-open="true"] .chip .caret { transform: rotate(180deg); }
.chip-select[data-open="true"] .chip {
  border-color: rgba(245,158,11,0.6);
  background: rgba(245,158,11,0.18);
}
.chip-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 280px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  z-index: 99999;
  box-shadow: 0 24px 48px -16px rgba(0,0,0,0.55);
  padding: 6px 0;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
.chip-select[data-open="true"] .chip-menu { display: block; }
.cm-section {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 14px 4px;
}
.cm-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--text);
  padding: 7px 14px;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.cm-opt:hover { background: rgba(245,158,11,0.18); color: #ffffff; }
.cm-opt.active { background: #f59e0b; color: #ffffff; }
.cm-opt.active .cm-code { color: rgba(255,255,255,0.85); }
.cm-code { font-size: 10px; letter-spacing: 0.08em; color: var(--text-dim); }
/* Settings · members table */
.members-table { border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.mt-head, .mt-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 110px;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
}
.mt-head {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mt-row { border-bottom: 1px dashed var(--border); }
.mt-row:last-child { border-bottom: none; }
.mt-row.pending { opacity: 0.78; }
.mt-who { display: flex; gap: 12px; align-items: center; }
.mt-who .av {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.mt-who .av.pending {
  background: var(--surface-2); color: var(--text-dim);
  border: 1px dashed var(--border-strong);
}
.mt-name { font-family: var(--serif); font-style: italic; color: var(--text); font-size: 14px; }
.mt-mail { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.mt-when { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.role-pill {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-2);
}
.role-pill.admin { color: var(--accent-bright); border-color: rgba(245,158,11,0.45); background: var(--accent-soft); }

/* Settings · billing summary */
.billing-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 20px;
}
.bs-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 14px 16px;
  background: var(--surface);
}
.bs-k {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.bs-v {
  font-family: var(--serif); font-style: italic;
  font-size: 22px; line-height: 1.1;
  color: var(--text);
}
.bs-meta {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-dim);
  margin-top: 6px;
}
@media (max-width: 900px) {
  .billing-summary { grid-template-columns: repeat(2, 1fr); }
  .mt-head, .mt-row { grid-template-columns: 2fr 1fr 90px; }
  .mt-head > div:nth-child(3), .mt-row > .mt-when { display: none; }
}
body[data-theme="light"] .chip-menu { background: #ffffff; box-shadow: 0 24px 48px -16px rgba(28,26,20,0.25); }

/* ---------- Workflow table ---------- */
.wf-table {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}
.wf-head, .wf-row {
  display: grid;
  grid-template-columns: 130px minmax(220px, 1.6fr) minmax(200px, 1.4fr) minmax(260px, 2fr) minmax(120px, 0.9fr) 96px;
  gap: 18px;
  align-items: center;
  padding: 14px 20px;
}
.wf-head {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.wf-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 120ms ease;
  font-size: 13px;
}
.wf-row:last-child { border-bottom: none; }
.wf-row:hover { background: var(--surface-2); }
.wf-row.selected { background: var(--surface-2); }
.wf-row.selected::before {
  content: ""; position: absolute;
}

.wf-id {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text);
}
.wf-id .pre { color: var(--text-dim); }

.wf-com {
  display: flex; flex-direction: column; gap: 3px;
}
.wf-com .name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.wf-com .qty {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.wf-cp {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}
.wf-cp .arr { color: var(--text-dim); }
.wf-cp .vessel {
  display: block;
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 4px;
  width: 100%;
}

/* Stage progress: 17 segments */
.wf-stage {
  display: flex; flex-direction: column; gap: 6px;
}
.wf-stage .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  display: flex; justify-content: space-between;
}
.wf-stage .label .step { color: var(--text); }
.wf-stage .label .step .total { color: var(--text-dim); }
.wf-stage .label .name { color: var(--text-dim); }
.wf-stage .bar {
  display: grid;
  grid-template-columns: repeat(17, 1fr);
  gap: 2px;
  height: 8px;
}
.wf-stage .seg {
  background: var(--border);
  border-radius: 1px;
}
.wf-stage .seg.done   { background: var(--accent); }
.wf-stage .seg.active { background: var(--accent-bright); box-shadow: 0 0 6px var(--accent-bright); }
.wf-stage .seg.held   { background: var(--warn); }

.wf-notional {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  text-align: right;
  letter-spacing: 0.02em;
}
.wf-notional .ccy { color: var(--text-dim); font-size: 10.5px; margin-right: 4px; }

.wf-status {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  text-align: center;
  color: var(--text-2);
}
.wf-status.live   { color: var(--ok);          border-color: rgba(132,204,22,0.4);  background: rgba(132,204,22,0.06); }
.wf-status.held   { color: var(--warn);        border-color: rgba(251,191,36,0.4);  background: rgba(251,191,36,0.06); }
.wf-status.draft  { color: var(--text-dim);    border-color: var(--border); }
.wf-status.settl  { color: var(--accent-bright); border-color: rgba(245,158,11,0.4); background: var(--accent-soft); }

/* ---------- Detail drawer ---------- */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(10, 11, 13, 0.6);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
body[data-drawer="open"] .drawer-scrim { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(640px, calc(100vw - 64px));
  background: var(--bg);
  border-left: 1px solid var(--border-strong);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: -40px 0 80px -20px rgba(0,0,0,0.6);
}
body[data-drawer="open"] .drawer { transform: translateX(0); }

.drawer-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid #d97706;
  background: #f59e0b;
  display: flex; flex-direction: column; gap: 10px;
}
.drawer-head .top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.drawer-head .id {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}
.drawer-head .id .v { color: #ffffff; }
.drawer-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.45);
  background: transparent;
  color: #ffffff;
  border-radius: 2px;
  cursor: pointer;
}
.drawer-close:hover { color: #ffffff; border-color: #ffffff; background: rgba(255,255,255,0.12); }

.drawer-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: #ffffff;
  line-height: 1.1;
}
.drawer-head h2 em { font-style: italic; color: #ffffff; font-weight: 500; }
.drawer-head .sub,
.drawer-head .sub * {
  color: #ffffff !important;
}
.drawer-head h2 em { font-style: italic; color: #ffffff; }
.drawer-head .sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  gap: 0;
}
.drawer-tabs .dt {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 120ms ease;
}
.drawer-tabs .dt:hover { color: var(--text); }
.drawer-tabs .dt.active,
.drawer-tabs .dt.active * {
  color: #ffffff !important;
  background: #f59e0b !important;
  border-bottom-color: #f59e0b !important;
}
.drawer-tabs .dt.active {
  box-shadow: inset 0 -2px 0 #d97706;
}
.drawer-tabs .dt.active:hover,
.drawer-tabs .dt.active:hover * { color: #ffffff !important; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 36px;
}
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-track { background: var(--bg); }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* Lifecycle list (17 steps) */
.lifecycle-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}
.lifecycle-meta .cell {
  background: var(--surface);
  padding: 12px 14px;
}
.lifecycle-meta .k {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.lifecycle-meta .v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-head .h {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.section-head .a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  cursor: pointer;
}
.section-head .a:hover { color: var(--accent-bright); }

.lc-list {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 28px;
}
.lc-step {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.lc-step:last-child { border-bottom: none; }
.lc-head {
  display: grid;
  grid-template-columns: 32px 1fr auto 16px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 120ms ease;
}
.lc-head:hover { background: var(--surface-2); }
.lc-step .ix {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.lc-step .label {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 10px;
}
.lc-step .who {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.lc-step .ts {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.lc-step .caret {
  font-size: 10px;
  color: var(--text-dim);
  transition: transform 200ms ease;
  display: inline-block;
}
.lc-step.open .caret { transform: rotate(-180deg); color: var(--text-2); }

.lc-subs {
  list-style: none;
  margin: 0;
  padding: 0 16px 14px 50px;
  display: none;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.lc-step.open .lc-subs { display: block; }
.lc-subs li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  padding: 4px 0;
  letter-spacing: 0.02em;
}
.lc-subs li .bullet {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: inline-block;
}
.lc-subs li.ok .bullet {
  background: var(--ok);
  border-color: var(--ok);
}
.lc-subs li.ok .t { color: var(--text); }
.lc-subs li.completion .t {
  color: var(--text-dim);
  font-style: italic;
}
.lc-subs li.ok.completion .t { color: var(--accent-bright); font-style: normal; }

.lc-step.done .ix { color: var(--ok); }
.lc-step.done .label::before {
  content: ""; width: 8px; height: 8px;
  background: var(--ok); border-radius: 50%;
  display: inline-block;
}
.lc-step.active .lc-head {
  background: var(--accent-soft);
}
.lc-step.active .ix { color: var(--accent-bright); }
.lc-step.active .label { color: var(--text); }
.lc-step.active .label::before {
  content: ""; width: 8px; height: 8px;
  background: var(--accent-bright); border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-bright);
  animation: pulse 1.6s ease-in-out infinite;
}
.lc-step.held .lc-head {
  background: rgba(251,191,36,0.06);
}
.lc-step.held .ix { color: var(--warn); }
.lc-step.held .label::before {
  content: ""; width: 8px; height: 8px;
  background: var(--warn); border-radius: 50%;
  display: inline-block;
}
.lc-step.pending .label::before {
  content: ""; width: 8px; height: 8px;
  border: 1px solid var(--border-strong); border-radius: 50%;
  display: inline-block;
}

/* Document state colors */
.doc.state-sealed .top .state { color: var(--ok); }
.doc.state-open   .top .state { color: var(--accent-bright); }
.doc.state-held   .top .state { color: var(--warn); }
.doc.state-queued { opacity: 0.55; }
.doc.state-queued .top .state { color: var(--text-dim); }

/* Audit log */
.audit-list {
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 11.5px;
}
.audit-row {
  display: grid;
  grid-template-columns: 110px 1fr 70px;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.audit-row:last-child { border-bottom: none; }
.audit-row .ts { color: var(--text-dim); letter-spacing: 0.02em; }
.audit-row .msg { color: var(--text); }
.audit-row .msg .actor { color: var(--accent-bright); }
.audit-row .msg .obj { color: var(--text-2); }
.audit-row .hash {
  color: var(--text-dim);
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* Documents grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.doc {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 14px;
  border-radius: 3px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: all 120ms ease;
}
.doc:hover { border-color: var(--border-strong); background: var(--surface-2); }
.doc .top {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.doc .top .ok { color: var(--ok); }
.doc .name {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.doc .info {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Drawer footer */
.drawer-foot {
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: space-between;
  background: var(--bg);
}
.drawer-foot .left { display: flex; gap: 8px; }
.drawer-foot .right-grp { display: flex; gap: 8px; }

/* ---------- Activity column (right side of dashboard) ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1280px) { .dash-grid { grid-template-columns: 1fr; } }

.activity {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  position: sticky;
  top: 80px;
}
.activity-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  display: flex; justify-content: space-between; align-items: center;
}
.activity-head .live {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ok);
  font-size: 10px;
  letter-spacing: 0.16em;
}
.activity-head .live .dot {
  width: 5px; height: 5px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--ok);
  animation: pulse 1.6s ease-in-out infinite;
}
.act-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
.act-row:last-child { border-bottom: none; }
.act-row .t {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  min-width: 44px;
}
.act-row .b { color: var(--text-2); line-height: 1.4; }
.act-row .b .actor { color: var(--text); }
.act-row .b .wf { color: var(--accent-bright); font-family: var(--mono); font-size: 11px; }
.act-row.alert .b .actor { color: var(--warn); }

/* Subtle entrance animation for dashboard sections */
.fade-in {
  opacity: 0;
  transform: translateY(6px);
  animation: rise 600ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.fade-in[data-d="1"] { animation-delay: 80ms; }
.fade-in[data-d="2"] { animation-delay: 160ms; }
.fade-in[data-d="3"] { animation-delay: 240ms; }
.fade-in[data-d="4"] { animation-delay: 320ms; }
.fade-in[data-d="5"] { animation-delay: 400ms; }

/* ============================================================
   Multi-page nav
   ============================================================ */
body[data-page] .page { display: none; }
body[data-page="workflows"]      .page-workflows      { display: block; }
body[data-page="counterparties"] .page-counterparties { display: block; }
body[data-page="vessels"]        .page-vessels        { display: block; }
body[data-page="documents"]      .page-documents      { display: block; }
body[data-page="audit"]          .page-audit          { display: block; }
body[data-page="settings"]       .page-settings       { display: block; }

/* Generic page header reuse — already styled via .page-head .fade-in */

/* ---------- Counterparties ---------- */
.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.cp-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
}
.cp-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cp-card .cp-top {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.cp-card .cp-name {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}
.cp-card .cp-meta {
  display: flex; gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.cp-card .cp-meta b { color: var(--text); font-weight: 500; }
.cp-card .cp-status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: var(--text-2);
}
.cp-card .cp-status.cleared { color: var(--ok); border-color: rgba(132,204,22,0.4); background: rgba(132,204,22,0.06); }
.cp-card .cp-status.review  { color: var(--warn); border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.06); }
.cp-card .cp-tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 2px;
  letter-spacing: 0.14em;
  color: var(--text-2);
  text-transform: uppercase;
}

/* ---------- Vessels ---------- */
.ves-table, .doc-table, .audit-table {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  overflow: hidden;
}
.ves-head, .ves-row,
.doc-head, .doc-row {
  display: grid;
  grid-template-columns: 220px 110px 1fr 130px 130px 110px;
  gap: 14px;
  padding: 14px 20px;
  align-items: center;
  font-size: 13px;
}
.ves-head, .doc-head {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.ves-row, .doc-row {
  border-bottom: 1px solid var(--border);
  transition: background 120ms ease;
  cursor: pointer;
}
.ves-row:last-child, .doc-row:last-child { border-bottom: none; }
.ves-row:hover, .doc-row:hover { background: var(--surface-2); }
.ves-row .vname {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.ves-row .imo {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  display: block;
  margin-top: 2px;
}
.ves-row .route {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.ves-row .route .arr { color: var(--accent-bright); }
.ves-row .mono { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* ---------- Documents ---------- */
.doc-head, .doc-row {
  grid-template-columns: 1.6fr 130px 110px 1fr 110px 110px;
}
.doc-row .dname {
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.doc-row .dtype {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}
.doc-row .step-pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  border: 1px solid rgba(245,158,11,0.4);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 2px;
  display: inline-block;
  width: fit-content;
}
.doc-row .hash {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ---------- Audit page ---------- */
.audit-table {
  font-family: var(--mono);
}
.audit-head, .audit-line {
  display: grid;
  grid-template-columns: 70px 140px 1fr 1fr 130px;
  gap: 14px;
  padding: 12px 18px;
  align-items: center;
  font-size: 12px;
}
.audit-head {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.audit-line {
  border-bottom: 1px solid var(--border);
  transition: background 120ms ease;
}
.audit-line:hover { background: var(--surface-2); }
.audit-line:last-child { border-bottom: none; }
.audit-line .blk {
  color: var(--accent-bright);
  letter-spacing: 0.04em;
}
.audit-line .actor { color: var(--text); letter-spacing: 0.02em; }
.audit-line .what  { color: var(--text-2); }
.audit-line .what .obj { color: var(--text); }
.audit-line .ts    { color: var(--text-dim); letter-spacing: 0.04em; }
.audit-line .hash {
  color: var(--text-dim);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.audit-line .hash .ok { color: var(--ok); margin-right: 6px; }

/* ---------- Settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 980px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-nav {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  padding: 8px;
  position: sticky;
  top: 80px;
}
.settings-nav .item {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border-radius: 2px;
  cursor: pointer;
  transition: all 120ms ease;
  display: flex; justify-content: space-between; align-items: center;
}
.settings-nav .item:hover { background: var(--surface-2); color: var(--text); }
.settings-nav .item.active { background: var(--accent-soft); color: var(--accent-bright); }
.settings-section {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.settings-section h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 6px;
}
.settings-section p.desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 22px;
  line-height: 1.5;
  max-width: 60ch;
}
.field-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.field-row:first-of-type { border-top: none; }
.field-row .fk {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.field-row .fk .desc {
  display: block;
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}
.field-row .fv {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}
.toggle {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 150ms ease;
}
.toggle::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text);
  top: 3px; left: 3px;
  transition: transform 150ms ease;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); background: #fff; }

/* ---------- OTP entry ---------- */
.otp-row {
  display: flex;
  gap: 10px;
  margin: 22px 0 18px;
  justify-content: center;
}
.otp-box {
  width: 44px; height: 56px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: 3px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 26px;
  color: var(--text);
  font-weight: 500;
  transition: all 180ms ease;
}
.otp-box.filled {
  border-color: #f59e0b;
  background: rgba(245,158,11,0.08);
  color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b inset, 0 0 12px -2px rgba(245,158,11,0.4);
}
.otp-box.verified {
  border-color: #84cc16;
  background: rgba(132,204,22,0.08);
  color: #84cc16;
  box-shadow: 0 0 0 1px #84cc16 inset;
}

/* Tweaks panel button (bottom right floating) */
.tweaks-fab {
  position: fixed;
  bottom: 18px; right: 18px;
  width: 44px; height: 44px;
  display: none;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text-2);
  cursor: pointer;
  z-index: 70;
}
body[data-screen="dashboard"] .tweaks-fab { display: grid; }
.tweaks-fab:hover { color: var(--accent-bright); border-color: var(--accent); }

/* Responsive collapses */
@media (max-width: 1100px) {
  .wf-head, .wf-row {
    grid-template-columns: 110px 1fr 1fr 1.4fr 100px 88px;
    gap: 12px;
    padding: 12px 14px;
  }
  .dash-content { padding: 22px 18px 60px; }
}
@media (max-width: 820px) {
  .wf-head { display: none; }
  .wf-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px;
  }
  .wf-row .wf-stage { grid-column: 1 / -1; }
  .wf-row .wf-notional { text-align: left; }
  .crumbs { display: none; }
}
