:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #687286;
  --line: #e7e9ef;
  --surface: #ffffff;
  --canvas: #f6f7fb;
  --navy: #17152f;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eeedff;
  --green: #168668;
  --green-soft: #e8f7f1;
  --amber: #b76a12;
  --amber-soft: #fff3df;
  --red: #ca3e52;
  --red-soft: #fff0f2;
  --shadow: 0 12px 34px rgba(38, 35, 92, .08);
  --shadow-hover: 0 18px 44px rgba(38, 35, 92, .13);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { cursor: pointer; }
.app-shell { display: none; }
.app-shell.authenticated { display: block; }
.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 520px) 1fr;
  background: #fff;
}
.login-screen.hidden { display: none; }
.login-panel {
  display: flex;
  max-width: 420px;
  flex-direction: column;
  justify-content: center;
  margin: auto;
  padding: 42px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { margin-top: 3px; color: var(--muted); }
.login-panel h1 { margin: 11px 0 8px; font-size: 38px; letter-spacing: -.04em; }
.login-copy { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.login-panel form { display: grid; gap: 18px; }
.login-panel form[hidden] { display: none; }
.login-switch { margin-top: 12px; }
.login-panel label { color: #4e5769; font-size: 12px; font-weight: 700; }
.login-panel input, .login-panel select {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  outline: none;
}
.login-panel input:focus, .login-panel select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.primary-button, .secondary-button {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  font-weight: 750;
}
.primary-button { background: var(--brand); color: #fff; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.form-error {
  padding: 13px 15px;
  border: 2px solid var(--red);
  border-radius: 12px;
  background: var(--red-soft);
  color: #8f1725;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}
.local-note { margin-top: 20px; color: #939aaa; }
.login-visual { position: relative; overflow: hidden; margin: 18px; border-radius: 28px; background: linear-gradient(145deg, #141a2a, #252050 60%, #5f51d4); }
.visual-orb { position: absolute; top: 17%; left: 20%; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9d91ff, #5d4fd8 40%, transparent 68%); filter: blur(4px); }
.visual-card { position: absolute; min-width: 190px; padding: 20px; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(16px); }
.visual-card span, .visual-card strong { display: block; }
.visual-card span { color: #cbc7f7; font-size: 11px; }
.visual-card strong { margin-top: 9px; font-size: 21px; }
.visual-card-a { top: 24%; right: 12%; }
.visual-card-b { bottom: 22%; left: 14%; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 28px 20px;
  background: var(--navy);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #7a6af1, #5546cb);
  font-size: 13px;
  font-weight: 800;
}

.brand strong, .brand small, .sidebar-foot strong, .sidebar-foot small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: #8f98aa; font-size: 11px; }
.sidebar-workspace {
  display: grid;
  gap: 2px;
  margin-top: 24px;
  padding: 12px 13px;
  border: 1px solid #34304f;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
}
.sidebar-workspace span { color: #8f98aa; font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-workspace strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-workspace small { color: #aaa5c5; font-size: 10px; text-transform: capitalize; }
.nav-list { display: grid; gap: 14px; margin-top: 24px; }
.nav-group { display: grid; gap: 5px; }
.nav-group-label {
  padding: 0 12px 3px;
  color: #706b8c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-radius: 12px;
  color: #aab1c1;
  text-decoration: none;
  border: 0;
  width: 100%;
  background: transparent;
  transition: background .2s, color .2s;
}
.nav-item:hover, .nav-item.active { background: #20283a; color: #fff; }
.nav-item b {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #30394d;
  color: #cbd1dc;
  font-size: 11px;
  text-align: center;
}
.nav-item b.danger { background: #592f3a; color: #ffb9c3; }
.nav-item b.warning { background: #5b451d; color: #ffd889; }
.credential-fields { display: grid; gap: 14px; }
.provider-app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.provider-app-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbff;
}
.platform-jump-nav {
  position: sticky;
  top: 76px;
  z-index: 8;
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 4px 16px rgba(16,24,40,.06);
}
.platform-jump-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.platform-jump-nav a:hover { background: #f0efff; color: #4038b4; }
.platform-control-grid .platform-companies-section { order: 1; }
.platform-control-grid .platform-support-section { order: 2; }
.platform-control-grid .platform-mailbox-section { order: 3; }
.platform-control-grid .platform-health-section { order: 4; }
.platform-control-grid .platform-app-section { order: 5; }
.platform-control-grid .platform-catalog-section { order: 6; }
.platform-control-grid > :not(.platform-section) { order: 7; }
.platform-action-group { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.platform-action-group button { min-height: 36px; padding: 7px 10px; }
.compact-date-label { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 6px; font-size: 10px; }
.tenant-danger-menu { position: relative; }
.tenant-danger-menu summary {
  min-height: 36px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.tenant-danger-menu[open] {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid #fecdca;
  border-radius: 9px;
  background: #fff;
}
.danger-text { color: #b42318 !important; }
.confirm-dialog {
  width: min(92vw, 520px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(16,24,40,.28);
}
.confirm-dialog::backdrop { background: rgba(16,24,40,.58); backdrop-filter: blur(3px); }
.confirm-dialog form { display: grid; gap: 16px; padding: 24px; }
.danger-callout {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #fecdca;
  border-left: 4px solid #d92d20;
  border-radius: 10px;
  background: #fff5f5;
  color: #912018;
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid #2c3548;
  border-radius: 14px;
}
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { margin-top: 3px; color: #8790a1; font-size: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #4cd7aa; box-shadow: 0 0 0 4px #24493f; }
main { min-height: 100vh; margin-left: 248px; }
.topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
}
.topbar h1 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.02em; }
.eyebrow {
  margin: 0;
  color: #8b93a3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .avatar, .menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}
.avatar { border: 0; background: var(--navy); color: #fff; }
.notification-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}
.notification-button b { min-width: 22px; padding: 3px 6px; border-radius: 99px; background: var(--red); color: #fff; }
.account-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 4px 11px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.account-button .avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; }
.account-copy strong, .account-copy small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11px; }
.account-copy small { margin-top: 2px; color: var(--red); font-size: 10px; font-weight: 750; }
.menu-button { display: none; }
.content { padding: 32px 34px 54px; }
.app-view { display: none; }
.app-view.active { display: block; }
.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h2 { margin: 13px 0 5px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.hero p { margin: 0; color: var(--muted); font-size: 14px; }
.overview-exception-banner {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #f0c4cb;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7f8, #fff);
  color: var(--ink);
  text-align: left;
}
.exception-banner-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 900; }
.overview-exception-banner strong, .overview-exception-banner small { display: block; }
.overview-exception-banner strong { font-size: 13px; }
.overview-exception-banner small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.overview-exception-banner b { color: var(--red); font-size: 12px; }
.freshness { text-align: right; }
.freshness span, .freshness strong { display: block; }
.freshness span { color: var(--muted); font-size: 11px; }
.freshness strong { margin-top: 5px; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  border: 1px solid rgba(225, 228, 235, .85);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metric-card { min-height: 148px; padding: 21px; }
.metric-card .label { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-card .value { margin: 13px 0 10px; font-size: 29px; font-weight: 750; letter-spacing: -.04em; }
.metric-card .value, .flow-item strong, .responsive-table td, .cost-row strong, .compact-row strong {
  font-variant-numeric: tabular-nums;
}
.metric-card .delta { font-size: 11px; font-weight: 700; }
.delta.positive { color: var(--green); }
.delta.warning { color: var(--amber); }
.delta.neutral { color: var(--muted); }
.skeleton { min-height: 148px; background: linear-gradient(90deg, #fff 25%, #f2f3f6 50%, #fff 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 16px;
  margin-top: 16px;
}
.dashboard-grid > .card { padding: 22px; }
.supplier-card { grid-column: 1 / -1; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.card-heading h3 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; }
.text-button { min-height: 44px; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 700; }
.flow-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 24px; }
.flow-item { padding: 18px 14px; border-radius: 14px; background: #f7f7fa; }
.flow-item span, .flow-item strong { display: block; }
.flow-item span { color: var(--muted); font-size: 11px; }
.flow-item strong { margin-top: 9px; font-size: 24px; }
.flow-line { height: 4px; margin-top: 13px; border-radius: 99px; background: var(--brand); opacity: .75; }
.exception-list, .supplier-list { display: grid; gap: 2px; margin-top: 13px; }
.exception-row, .supplier-row {
  display: grid;
  min-height: 64px;
  align-items: center;
  border-top: 1px solid var(--line);
}
.exception-row { grid-template-columns: 1fr auto; }
.exception-row:first-child, .supplier-row:first-child { border-top: 0; }
.exception-row strong, .supplier-row strong { font-size: 12px; }
.exception-row small, .supplier-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.severity { padding: 5px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 800; }
.severity.high { background: var(--red-soft); color: var(--red); }
.supplier-row { grid-template-columns: minmax(130px, 1fr) 2fr auto; gap: 18px; }
.progress { height: 7px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #8c7df6); }
.mobile-nav { display: none; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: min(520px, calc(100vw - 40px)); padding: 16px 20px; border: 2px solid transparent; border-radius: 12px; background: var(--red); color: #fff; font-size: 14px; font-weight: 800; line-height: 1.45; box-shadow: 0 14px 38px rgba(143, 23, 37, .34); }
.toast-error { border-color: #ffb8c1; background: #9f1239; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.04em; }
.table-card { overflow: hidden; margin-top: 16px; padding: 12px 20px 20px; }
.responsive-table { width: 100%; overflow-x: auto; }
.responsive-table table { width: 100%; border-collapse: collapse; min-width: 680px; }
.responsive-table th { padding: 14px 10px; color: var(--muted); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .08em; }
.responsive-table td { padding: 15px 10px; border-top: 1px solid var(--line); font-size: 12px; }
.status-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800; }
.empty-state { padding: 38px 18px; color: var(--muted); text-align: center; }
.exception-board, .supplier-board, .action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.exception-tile, .supplier-tile, .action-card { padding: 20px; }
.exception-tile { border-width: 2px; border-color: #f4c36a; background: linear-gradient(145deg, #fff, #fffaf0); }
.exception-tile.severity-high { border-color: #ef6a78; background: linear-gradient(145deg, #fff, #fff1f3); box-shadow: 0 12px 30px rgba(159, 18, 57, .12); }
.exception-tile h3, .supplier-tile h3, .action-card h3 { margin: 13px 0 7px; font-size: 16px; }
.exception-tile p { min-height: 34px; margin: 0; color: #303849; font-size: 13px; font-weight: 700; line-height: 1.55; }
.supplier-tile p, .action-card p { min-height: 34px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.exception-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.action-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 900; }
.action-card .primary-button { width: 100%; margin-top: 20px; }
.toast-success { background: var(--green); }
button.is-loading, button:disabled.is-loading {
  border-color: #d29a2e !important;
  background: #fff1cf !important;
  color: #8b5b00 !important;
  cursor: wait;
  opacity: 1;
}
button.is-loading::after {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  display: inline-block;
  vertical-align: -2px;
  animation: button-spin .7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }
.summary-total-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0 0 16px;
  border: 1px solid #cfc8ff;
  border-radius: 14px;
  background: #cfc8ff;
  box-shadow: 0 8px 24px rgba(92, 72, 190, .09);
}
.summary-total-item {
  min-height: 76px;
  padding: 15px 18px;
  background: linear-gradient(135deg, #f1efff, #faf9ff);
}
.summary-total-item span, .summary-total-item strong { display: block; }
.summary-total-item span { color: #665ba8; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.summary-total-item strong { margin-top: 7px; color: #30236f; font-size: 20px; }
.summary-total-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.gmail-candidate-list { display: grid; gap: 12px; margin-top: 16px; }
.gmail-candidate {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(140px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fafbfc;
}
.gmail-candidate label { color: var(--muted); font-size: 10px; font-weight: 750; }
.gmail-candidate input, .gmail-candidate select {
  width: 100%;
  min-height: 40px;
  margin-top: 5px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.gmail-candidate-meta strong, .gmail-candidate-meta small { display: block; }
.gmail-candidate-meta small { margin-top: 5px; color: var(--muted); line-height: 1.4; }
.gmail-candidate-actions { display: flex; gap: 6px; }
.period-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.period-controls select, .period-controls input {
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}
.period-label { margin: -10px 0 18px; color: var(--muted); font-size: 12px; }
.finance-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.finance-card { padding: 22px; }
.trend-card { grid-column: 1 / -1; }
.cost-breakdown { display: grid; gap: 13px; margin-top: 20px; }
.cost-row { display: grid; grid-template-columns: minmax(130px, 1fr) 2fr auto; align-items: center; gap: 14px; }
.cost-row span { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.cost-row strong { min-width: 90px; font-size: 12px; text-align: right; }
.cost-bar { height: 8px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.cost-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #9184f6); }
.trend-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(48px, 1fr); align-items: end; gap: 8px; min-height: 230px; margin-top: 22px; overflow-x: auto; padding: 8px 2px; }
.trend-point { display: grid; min-height: 210px; grid-template-rows: 1fr auto; align-items: end; gap: 8px; text-align: center; }
.trend-bars { display: flex; height: 170px; align-items: end; justify-content: center; gap: 4px; }
.trend-bars i { width: 12px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--brand); }
.trend-bars i.profit { background: var(--green); }
.trend-bars i.loss { background: var(--red); }
.trend-point small { color: var(--muted); font-size: 9px; }
.ledger-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.entry-stack { display: grid; gap: 16px; }
.ledger-table { margin-top: 0; }
.ledger-subheading { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-form { display: grid; gap: 16px; padding: 22px; }
.settings-form h3 { margin: 5px 0 0; font-size: 18px; }
.settings-form label { color: #555f72; font-size: 11px; font-weight: 700; }
.settings-form input, .settings-form select, .settings-form textarea {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  padding: 0 12px;
  border: 1px solid #dfe3ea;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
}
.settings-form input:focus, .settings-form select:focus, .settings-form textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-label { display: flex; min-height: 44px; align-items: center; gap: 9px; }
.check-label input { width: 18px; min-height: 18px; margin: 0; }
.compact-list { display: grid; gap: 8px; margin-top: 4px; }
.compact-row { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 10px; background: #f6f7fa; font-size: 11px; }
.integration-ready { color: var(--green); font-weight: 800; }
.integration-pending { color: var(--amber); font-weight: 800; }
.control-summary { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.readiness-card, .health-summary-card { display: flex; min-height: 170px; align-items: center; gap: 22px; padding: 24px; }
.health-summary-card { display: block; }
.readiness-card h3, .health-summary-card h3 { margin: 6px 0 8px; font-size: 22px; }
.readiness-card p, .health-summary-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.readiness-ring { display: grid; width: 104px; height: 104px; flex: 0 0 104px; place-items: center; border: 10px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; }
.readiness-ring strong { font-size: 22px; }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.control-card { padding: 22px; }
.control-wide { grid-column: 1 / -1; }
.task-list, .health-list { display: grid; gap: 9px; margin-top: 18px; }
.task-row, .health-row { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border-radius: 12px; background: #f7f8fa; }
.task-row strong, .task-row small, .health-row strong, .health-row small { display: block; }
.task-row strong, .health-row strong { font-size: 12px; text-transform: capitalize; }
.task-row small, .health-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.task-state { min-height: 36px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 800; text-transform: capitalize; }
.task-state.completed, .task-state.skipped { background: var(--green-soft); color: var(--green); }
.health-row { justify-content: flex-start; }
.health-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--amber); }
.health-dot.healthy { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.health-title.healthy { color: var(--green); }
.health-title.warning { color: var(--amber); }
.control-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; font-weight: 400; }
.section-copy { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.role-summary { padding: 13px 14px; border: 1px solid #dcd8ff; border-radius: 12px; background: #f7f5ff; }
.role-summary strong, .role-summary span { display: block; }
.role-summary strong { color: var(--brand); font-size: 12px; }
.role-summary span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.advanced-access { padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.advanced-access summary { cursor: pointer; color: var(--ink); font-size: 11px; font-weight: 750; }
.advanced-access[open] summary { margin-bottom: 10px; }
.permission-fieldset { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.permission-fieldset legend { padding: 0 6px; font-weight: 700; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.permission-grid .check-label { margin: 0; font-size: 12px; }
.secondary-link { display: grid; min-height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--brand); font-size: 12px; font-weight: 750; text-decoration: none; }
.pii-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding: 20px; border-color: #d8d3ff; background: #f8f7ff; }
.pii-panel[hidden] { display: none; }
.pii-panel h3 { margin: 5px 0 0; }
.pii-fields { display: flex; flex: 1; flex-wrap: wrap; gap: 12px; }
.pii-fields span { min-width: 150px; padding: 10px 12px; border-radius: 10px; background: #fff; font-size: 12px; }
.pii-fields small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.responsive-table td small { display: block; margin-top: 4px; color: var(--muted); }
.table-toolbar, .table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.table-toolbar label { color: var(--muted); font-size: 10px; font-weight: 750; }
.table-toolbar select {
  display: block;
  min-width: 130px;
  min-height: 38px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.table-page-summary { margin-left: auto; align-self: center; color: var(--muted); font-size: 11px; }
.table-pagination { justify-content: center; border-top: 1px solid var(--line); border-bottom: 0; }
.table-pagination span { min-width: 90px; text-align: center; color: var(--muted); font-size: 11px; font-weight: 750; }
.platform-date { display: block; width: 150px; min-height: 34px; margin: 3px 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.advanced-config { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.advanced-config summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 750; }
.advanced-config[open] summary { margin-bottom: 14px; color: var(--ink); }
.rto-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.connection-checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 18px; }
.connection-check { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.connection-check b { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: #fef3c7; color: #92400e; }
.connection-check.ready b { background: #dcfce7; color: #166534; }
.connection-check span { display: grid; gap: 3px; }
.connection-check small { color: var(--muted); line-height: 1.4; }
.feature-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.feature-toggle input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.feature-toggle strong, .feature-toggle small { display: block; }
.feature-toggle small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.risk-score { display: inline-grid; min-width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.risk-score.high, .risk-score.very_high { background: #fff0f1; color: var(--red); }
.risk-score.medium { background: #fff7df; color: #a45b00; }
.setup-callout { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; padding: 18px 20px; border-color: #d8d5ff; background: linear-gradient(135deg, #fff, #f3f1ff); }
@media (max-width: 720px) {
  .rto-feature-grid { grid-template-columns: 1fr; }
  .connection-checklist { grid-template-columns: 1fr; }
  .setup-callout { align-items: flex-start; flex-direction: column; }
}
.settings-form input[readonly] { background: #f3f5f8; color: #4d5668; cursor: not-allowed; }

@media (max-width: 640px) {
  .summary-total-row { grid-template-columns: 1fr; }
  .gmail-candidate { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .sidebar { width: 210px; }
  main { margin-left: 210px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .supplier-card { grid-column: auto; }
  .exception-board, .supplier-board, .action-grid { grid-template-columns: repeat(2, 1fr); }
  .finance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .ledger-grid { grid-template-columns: 1fr; }
  .control-summary, .control-grid { grid-template-columns: 1fr; }
  .control-wide { grid-column: auto; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  body.mobile-menu-open .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    display: flex;
    width: min(84vw, 290px);
    box-shadow: 18px 0 50px rgb(11 12 24 / 35%);
  }
  main { margin-left: 0; padding-bottom: 76px; }
  .topbar { min-height: 76px; padding: 14px 18px; }
  .topbar > div:nth-child(2) { flex: 1; padding-left: 11px; }
  .topbar h1 { font-size: 15px; }
  .topbar .eyebrow { display: none; }
  .menu-button { display: block; }
  .icon-button, .notification-button span, .account-copy strong { display: none; }
  .notification-button { width: 42px; justify-content: center; padding: 0; }
  .account-button { padding-right: 5px; }
  .account-copy small { font-size: 9px; }
  .content { padding: 24px 16px 30px; }
  .login-panel { width: 100%; padding: 28px 22px; }
  .login-brand { margin-bottom: 42px; }
  .hero { align-items: start; }
  .freshness { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card, .skeleton { min-height: 128px; padding: 16px; }
  .metric-card .value { font-size: 22px; }
  .dashboard-grid { gap: 12px; margin-top: 12px; }
  .dashboard-grid > .card { padding: 18px 16px; }
  .flow-list { grid-template-columns: repeat(2, 1fr); }
  .supplier-row { grid-template-columns: 1fr auto; gap: 10px; }
  .supplier-row .progress { grid-column: 1 / -1; grid-row: 2; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 68px;
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
  }
  .mobile-nav button {
    position: relative;
    display: grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
    border-radius: 12px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    background: transparent;
  }
  .mobile-nav button.active { background: var(--brand-soft); color: var(--brand); }
  .mobile-nav b { position: absolute; top: 4px; right: 16%; color: var(--red); font-size: 9px; }
  .exception-board, .supplier-board, .action-grid { grid-template-columns: 1fr; }
  .finance-heading { align-items: start; flex-direction: column; }
  .period-controls { width: 100%; justify-content: stretch; }
  .period-controls select, .period-controls input, .period-controls button { flex: 1 1 120px; }
  .finance-grid { grid-template-columns: 1fr; }
  .trend-card { grid-column: auto; }
  .cost-row { grid-template-columns: minmax(100px, 1fr) auto; }
  .cost-row .cost-bar { grid-column: 1 / -1; grid-row: 2; }
  .form-row { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .pii-panel { align-items: stretch; flex-direction: column; }
  .settings-form { padding: 18px 16px; }
  .responsive-table { overflow: visible; }
  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; min-width: 0; }
  .responsive-table thead { display: none; }
  .responsive-table tr { padding: 13px 0; border-top: 1px solid var(--line); }
  .responsive-table tr:first-child { border-top: 0; }
  .responsive-table td { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border: 0; text-align: right; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card, .skeleton { min-height: 112px; }
  .hero h2 { font-size: 27px; }
}

@media (max-width: 900px) {
  .provider-app-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

html, body { height: 100%; }
body {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
  font-family: "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
}

.login-screen {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
.login-panel {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  margin: 0 auto;
  overflow-y: auto;
  padding-block: 54px;
  scrollbar-gutter: stable;
}
.login-screen.registration-mode .login-panel { justify-content: flex-start; }
.login-panel h1 { font-size: clamp(36px, 4vw, 48px); font-weight: 760; }
.login-panel label, .settings-form label { color: #344054; font-size: 13px; font-weight: 700; }
.login-panel input, .login-panel select, .settings-form input, .settings-form select, .settings-form textarea {
  min-height: 50px;
  border-color: #d7dce6;
  border-radius: 12px;
  font-size: 15px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.settings-form textarea { min-height: 96px; padding-block: 12px; resize: vertical; }
.form-section {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.form-section legend { padding: 0 7px; color: var(--ink); font-size: 13px; font-weight: 800; }
.form-disclosure {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}
.form-disclosure summary { cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 800; }
.form-disclosure[open] { display: grid; gap: 14px; background: #fff; }
.form-disclosure[open] summary { margin-bottom: 2px; color: var(--brand-strong); }
.empty-state-action { display: grid; justify-items: start; gap: 8px; text-align: left; }
.empty-state-action strong { color: var(--ink); font-size: 15px; }
.empty-state-action span { color: var(--muted); }
.empty-state-action button { margin-top: 4px; }
.primary-button, .secondary-button {
  min-height: 46px;
  border-radius: 11px;
  font-size: 14px;
  transition: transform .18s, box-shadow .18s, background .18s;
}
.primary-button { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); box-shadow: 0 7px 18px rgba(79, 70, 229, .2); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79, 70, 229, .28); }
.secondary-button:hover { border-color: #b8b2ff; background: #f8f7ff; color: var(--brand-strong); }

.app-shell.authenticated { height: 100vh; overflow: hidden; }
.sidebar { overflow: hidden; padding-bottom: 22px; background: linear-gradient(180deg, #17152f, #201d42); }
.nav-list {
  min-height: 0;
  overflow-y: auto;
  margin: 22px -8px 18px 0;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #4e496e transparent;
}
.nav-item { min-height: 46px; font-size: 14px; font-weight: 650; }
.nav-item:hover, .nav-item.active { background: rgba(255, 255, 255, .1); }
main { height: 100vh; overflow-y: auto; scroll-behavior: smooth; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 88px;
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(23, 32, 51, .04);
}
.topbar h1 { font-size: 21px; font-weight: 760; }
.workspace-user-line { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.content { width: min(100%, 1640px); margin: 0 auto; padding: 34px 38px 64px; }
.hero h2, .section-heading h2 { font-weight: 760; }
.card { border-color: rgba(219, 223, 233, .9); border-radius: 16px; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-hover); }
.settings-form { gap: 18px; padding: 26px; }
.settings-form h3 { font-size: 20px; }
.control-help, .section-copy, .role-summary span { font-size: 13px; line-height: 1.6; }
.responsive-table th { font-size: 11px; }
.responsive-table td { font-size: 13px; }

.field-heading {
  position: relative;
  display: flex;
  min-height: 24px;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.field-requirement {
  padding: 2px 7px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #667085;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.field-requirement.required { background: #fff0f2; color: #b4233b; }
.field-info-button {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 1px solid #cfd4df;
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
}
.field-info-button:hover, .field-info-button:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: 0; }
.field-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: min(300px, 76vw);
  padding: 11px 12px;
  border: 1px solid #dcd9ff;
  border-radius: 10px;
  background: #201d42;
  color: #f7f7ff;
  box-shadow: 0 14px 35px rgba(17, 24, 39, .22);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.settings-form input, .settings-form select, .settings-form textarea { margin-top: 0; }
.check-label .field-heading { margin: 0; }
.lookup-control {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(190px, 1.2fr);
  gap: 8px;
}
.lookup-control input[type="search"] {
  padding-left: 38px;
  background-image: radial-gradient(circle, transparent 5px, #7b8495 5px, #7b8495 7px, transparent 7px), linear-gradient(45deg, transparent 46%, #7b8495 47%, #7b8495 55%, transparent 56%);
  background-position: 13px 16px, 24px 28px;
  background-repeat: no-repeat;
  background-size: 15px 15px, 8px 8px;
}

.email-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  margin-top: 0;
  border: 1px solid #d7dce6;
  border-radius: 12px;
  background: #fff;
}
.email-composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.email-composer input { margin: 0; border: 0; border-radius: 0; box-shadow: none !important; }
.email-composer > span { padding: 0 14px; color: #475467; font-weight: 650; white-space: nowrap; }
.rto-settings-card { grid-column: 1 / -1; border-color: #d8d5ff; background: linear-gradient(145deg, #fff, #faf9ff); }
.rto-score-guide { display: grid; gap: 5px; padding: 14px; border-radius: 12px; background: var(--brand-soft); color: #3730a3; }
.rto-score-guide span { font-size: 12px; line-height: 1.55; }
.support-tenant-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 18px; }
.support-tenant-heading > span { display: flex; flex-wrap: wrap; gap: 7px; }
#support-summary h4 { margin: 24px 4px 8px; font-size: 15px; }

.guide-open { overflow: hidden; }
.setup-guide {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  justify-items: end;
}
.setup-guide-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(17, 15, 43, .5);
  backdrop-filter: blur(5px);
}
.setup-guide-panel {
  position: relative;
  width: min(720px, 94vw);
  height: 100%;
  overflow-y: auto;
  padding: 38px;
  background: #f8f8fc;
  box-shadow: -24px 0 70px rgba(17, 15, 43, .22);
}
.setup-guide-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.setup-guide-heading h2 { margin: 7px 0; font-size: 30px; letter-spacing: -.03em; }
.setup-guide-heading p:not(.eyebrow) { max-width: 570px; margin: 0; color: var(--muted); }
.setup-progress { height: 9px; overflow: hidden; margin-top: 28px; border-radius: 99px; background: #e5e7ef; }
.setup-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #8b5cf6); transition: width .3s; }
.setup-guide-tasks { display: grid; gap: 12px; margin-top: 24px; }
.setup-guide-task {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(38, 35, 92, .05);
}
.setup-guide-task.completed { border-color: #bde7d8; background: #f8fffc; }
.setup-step { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 850; }
.setup-guide-task.completed .setup-step { background: var(--green-soft); color: var(--green); }
.setup-guide-task p { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.setup-guide-task small { color: #7b8495; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.shopify-guide-panel { width: min(1040px, 94vw); }
.shopify-guide-hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(360px, 1.15fr);
  gap: 28px;
  align-items: center;
  margin-top: 26px;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f2fff8, #f4f7ff);
  border: 1px solid #d6eadf;
}
.shopify-guide-hero h3 { margin: 10px 0 8px; font-size: 26px; letter-spacing: -.03em; }
.shopify-guide-hero p { margin: 0; color: var(--muted); line-height: 1.65; }
.guide-status {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dff7e8;
  color: #147a45;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.shopify-screen {
  overflow: hidden;
  border: 1px solid #3d4252;
  border-radius: 16px;
  background: #171923;
  box-shadow: 0 22px 50px rgb(26 38 48 / 22%);
  color: #f3f6fa;
}
.shopify-screen-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: #232633;
  font-size: 10px;
}
.shopify-screen-bar span { width: 8px; height: 8px; border-radius: 50%; background: #697082; }
.shopify-screen-bar strong { margin-left: 7px; color: #b9c0cf; font-weight: 650; }
.shopify-screen-body { display: grid; gap: 12px; padding: 20px; }
.shopify-screen-body > small { color: #8e97aa; }
.shopify-screen-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid #343848;
  border-radius: 10px;
  background: #1d202b;
  font-size: 12px;
}
.shopify-screen-row span { color: #aab2c2; }
.shopify-screen-row code { overflow: hidden; color: #f6f7fb; text-overflow: ellipsis; }
.shopify-screen-body p { color: #9aa3b4; font-size: 10px; }
.shopify-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.guide-section {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.guide-section-wide { grid-column: 1 / -1; }
.guide-section h3, .guide-troubleshooting h3 { margin: 4px 0 8px; font-size: 16px; }
.guide-section p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.scope-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.scope-pills code { padding: 7px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 750; }
.code-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.code-copy pre {
  overflow-x: auto;
  margin: 0;
  padding: 17px;
  border-radius: 12px;
  background: #171923;
  color: #e8edf5;
  font-size: 11px;
  line-height: 1.65;
}
.guide-callout { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.5; }
.guide-callout.warning { background: #fff7df; color: #71550d; }
.field-map { display: grid; gap: 8px; margin: 0 0 16px; }
.field-map div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.field-map dt { color: #596174; font-size: 11px; font-weight: 800; }
.field-map dd { margin: 0; color: #252b38; font-size: 12px; }
.guide-troubleshooting { margin-top: 18px; padding: 22px; border-radius: 16px; background: #f8f9fc; }
.guide-troubleshooting > div { display: grid; grid-template-columns: 180px 1fr; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 12px; }
.guide-troubleshooting span { color: var(--muted); line-height: 1.55; }
.shopify-guide-footer { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
.danger-zone { border-color: #fecaca; background: #fff7f7; }
.danger-zone h3 { color: #991b1b; }
.danger-button { background: #b91c1c; }
.danger-button:hover { background: #991b1b; }

@media (max-width: 720px) {
  body { overflow: auto; }
  .app-shell.authenticated, main { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { position: sticky; }
  .workspace-user-line { display: none; }
  .content { padding: 24px 16px 96px; }
  .overview-exception-banner { grid-template-columns: auto minmax(0, 1fr); }
  .overview-exception-banner b { grid-column: 2; }
  .login-screen { height: auto; min-height: 100vh; overflow-y: auto; }
  .login-panel { height: auto; max-height: none; overflow: visible; }
  .card:hover { transform: none; }
  .email-composer { grid-template-columns: minmax(0, 1fr); }
  .email-composer > span { padding: 0 12px 11px; }
  .lookup-control { grid-template-columns: 1fr; }
  .setup-guide-panel { width: 100%; padding: 26px 18px 90px; }
  .setup-guide-heading h2 { font-size: 25px; }
  .setup-guide-task { grid-template-columns: 34px minmax(0, 1fr); }
  .setup-guide-task button { grid-column: 1 / -1; width: 100%; }
  .shopify-guide-hero { grid-template-columns: 1fr; padding: 20px; }
  .shopify-guide-hero h3 { font-size: 22px; }
  .shopify-guide-grid, .shopify-guide-footer { grid-template-columns: 1fr; }
  .guide-section-wide { grid-column: auto; }
  .code-copy { grid-template-columns: 1fr; }
  .field-map div, .guide-troubleshooting > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Unified phone layout. Keep this final so older responsive rules cannot
   reintroduce desktop widths on narrow screens. */
@media (max-width: 720px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell,
  .app-shell.authenticated,
  main,
  .content,
  .app-view,
  .card,
  .responsive-table,
  .finance-grid,
  .control-grid,
  .ledger-grid {
    min-width: 0;
    max-width: 100%;
  }

  main {
    width: 100%;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 10px 12px;
    gap: 10px;
  }

  .topbar > div:nth-child(2) {
    min-width: 0;
    padding-left: 0;
  }

  .topbar h1 {
    overflow: hidden;
    margin: 0;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .top-actions { gap: 6px; }
  .notification-button {
    width: auto;
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
  }
  .notification-button b { min-width: 25px; }
  .account-button {
    width: 44px;
    min-height: 44px;
    padding: 3px;
    border-radius: 12px;
  }
  .account-button .avatar {
    width: 36px;
    height: 36px;
  }
  .account-copy { display: none; }

  .content {
    width: 100%;
    padding: 18px 12px calc(94px + env(safe-area-inset-bottom));
  }

  .hero { margin-bottom: 18px; }
  .hero h2 { font-size: 27px; }
  .section-heading {
    align-items: flex-start;
    margin-bottom: 14px;
  }
  .section-heading h2 { font-size: 25px; }
  .section-copy { font-size: 12px; }

  .card {
    border-radius: 15px;
    box-shadow: 0 7px 22px rgba(38, 35, 92, .07);
  }

  .metric-grid,
  .finance-metrics,
  #partner-settlement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card,
  .skeleton {
    min-height: 110px;
    padding: 15px;
  }
  .metric-card .label { font-size: 10px; }
  .metric-card .value {
    margin: 10px 0 7px;
    font-size: clamp(18px, 5.5vw, 23px);
    overflow-wrap: anywhere;
  }

  .summary-total-row {
    grid-template-columns: 1fr;
    margin-bottom: 12px;
  }
  .summary-total-item {
    min-height: 66px;
    padding: 12px 14px;
  }
  .summary-total-item strong { font-size: 18px; }

  .finance-heading { gap: 14px; }
  .period-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .period-controls > * { min-width: 0; width: 100%; }
  .period-controls button { grid-column: 1 / -1; }
  .finance-card { padding: 17px 14px; }
  .trend-chart {
    width: 100%;
    min-height: 190px;
    grid-auto-columns: 42px;
    overscroll-behavior-x: contain;
  }
  .trend-point { min-height: 174px; }
  .trend-bars { height: 136px; }

  .table-card {
    margin-top: 12px;
    padding: 14px;
    overflow: visible;
  }
  .table-card .card-heading { padding: 2px 2px 10px; }
  .responsive-table { width: 100%; }
  .responsive-table table,
  .responsive-table tbody { width: 100%; }
  .responsive-table tr {
    width: 100%;
    margin: 0;
    padding: 16px 2px;
  }
  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(82px, 30%) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    width: 100%;
    padding: 7px 0;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .responsive-table td::before {
    line-height: 1.45;
    letter-spacing: .04em;
  }
  .responsive-table td > strong,
  .responsive-table td > span,
  .responsive-table td > small {
    min-width: 0;
  }
  .responsive-table td small {
    margin-top: 3px;
    overflow-wrap: anywhere;
  }
  .responsive-table td[data-label="Action"],
  .responsive-table td[data-label="Actions"] {
    align-items: center;
  }
  .responsive-table td[data-label="Action"] .text-button,
  .responsive-table td[data-label="Actions"] .text-button {
    min-height: 38px;
    margin: 0 12px 0 0;
    padding: 0;
  }

  .table-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    padding: 14px;
  }
  .table-toolbar label,
  .table-toolbar select { min-width: 0; width: 100%; }
  .table-page-summary {
    grid-column: 1 / -1;
    margin-left: 0;
  }
  .table-pagination {
    padding: 12px 4px;
    gap: 8px;
  }
  .table-pagination button { min-width: 88px; }

  .settings-form { padding: 18px 14px; }
  .settings-form h3 { font-size: 19px; }
  .control-card { padding: 18px 14px; }
  .card-heading { align-items: flex-start; }
  .compact-row { padding: 11px 12px; }

  .mobile-nav {
    min-height: 64px;
    padding: 5px 6px max(5px, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(23, 32, 51, .08);
    backdrop-filter: blur(16px);
  }
  .mobile-nav button {
    min-height: 48px;
    font-size: 11px;
  }
  .mobile-nav button.active { border-radius: 13px; }

  .toast {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 12px;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .metric-grid,
  .finance-metrics,
  #partner-settlement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Production interface layer */
:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --canvas: #f4f6f8;
  --navy: #101828;
  --brand: #5147d9;
  --brand-strong: #4038b4;
  --brand-soft: #f0efff;
  --green: #087a5b;
  --green-soft: #ecfdf3;
  --amber: #a15c07;
  --amber-soft: #fffaeb;
  --red: #b4233b;
  --red-soft: #fff1f3;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, .08);
}

body {
  background:
    radial-gradient(circle at 70% -20%, rgba(81, 71, 217, .055), transparent 32rem),
    var(--canvas);
  color: var(--ink);
  font-family: Inter, "SF Pro Text", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(81, 71, 217, .22);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; opacity: .58; }

.login-screen {
  grid-template-columns: minmax(390px, 46%) 1fr;
  background: var(--surface);
}
.login-panel {
  max-width: 480px;
  padding-inline: clamp(32px, 6vw, 76px);
}
.login-brand { margin-bottom: 72px; }
.login-panel h1 {
  margin: 12px 0 10px;
  color: #101828;
  font-size: clamp(38px, 4vw, 52px);
  letter-spacing: -.045em;
}
.login-copy { max-width: 410px; color: #667085; font-size: 15px; }
.login-panel form { gap: 20px; }
.login-panel input,
.login-panel select {
  min-height: 52px;
  border-color: var(--line-strong);
  border-radius: 10px;
}
.login-visual {
  margin: 12px;
  border-radius: 24px;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(145deg, #111827 0%, #24205a 56%, #5147d9 100%);
  background-size: 44px 44px, 44px 44px, auto;
}
.login-visual::before {
  position: absolute;
  inset: 12% 10%;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background: rgba(10, 14, 30, .3);
  box-shadow: 0 32px 80px rgba(7, 10, 25, .34);
  content: "";
}
.visual-orb { opacity: .62; }
.visual-card {
  min-width: 220px;
  padding: 22px;
  border-color: rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  box-shadow: 0 18px 44px rgba(5, 7, 20, .2);
}
.visual-card-a { top: 27%; right: 14%; }
.visual-card-b { bottom: 25%; left: 14%; }

.sidebar {
  width: 264px;
  padding: 24px 18px 20px;
  border-right: 1px solid rgba(255,255,255,.06);
  background: #111827;
}
main { margin-left: 264px; }
.brand { padding: 0 8px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #6258e8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand strong { font-size: 17px; }
.brand small { color: #98a2b3; }
.sidebar-workspace {
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(139,131,255,.32);
  border-radius: 14px;
  background: linear-gradient(145deg, #252b43, #1b2340);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 12px 26px rgba(0,0,0,.16);
}
.sidebar-workspace span { color: #a9b2c5; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-workspace strong { margin-top: 6px; color: #fff; font-size: 16px; line-height: 1.25; }
.sidebar-workspace small { margin-top: 5px; color: #c2c8d5; line-height: 1.35; }

.global-loading {
  position: fixed;
  z-index: 10000;
  top: 18px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 11px 16px;
  transform: translateX(-50%);
  border: 1px solid #d8d3ff;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 34px rgba(38,31,94,.2);
  color: #30236f;
  font-size: 12px;
}
.loading-orbit {
  width: 17px;
  height: 17px;
  border: 2px solid #d8d3ff;
  border-top-color: #5147d9;
  border-radius: 50%;
  animation: loading-spin .7s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.table-toolbar input { flex: 1; margin: 0; }
.table-toolbar select { width: 90px; margin: 0; }
.nav-list { gap: 16px; margin-top: 22px; }
.nav-group { gap: 3px; }
.nav-group-label {
  padding: 0 10px 5px;
  color: #667085;
  font-size: 10px;
  letter-spacing: .09em;
}
.nav-item {
  min-height: 42px;
  justify-content: flex-start;
  gap: 11px;
  padding: 0 11px;
  border-radius: 8px;
  color: #aeb4c2;
  font-size: 13px;
  font-weight: 600;
}
.nav-item:hover { background: #1d2939; color: #f2f4f7; }
.nav-item.active {
  background: #272d5f;
  color: #fff;
  box-shadow: inset 3px 0 #8b83ff;
}
.nav-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  color: #858ca0;
}
.nav-icon svg { width: 18px; height: 18px; fill: currentColor; }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { color: currentColor; }
.nav-item > span:not(.nav-icon) { min-width: 0; flex: 1; text-align: left; }
.nav-item b { margin-left: auto; }
.sidebar-foot {
  padding: 12px 13px;
  border-color: #344054;
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.topbar {
  min-height: 76px;
  padding: 12px clamp(24px, 3vw, 42px);
  border-color: rgba(208, 213, 221, .72);
  background: rgba(255,255,255,.92);
}
.topbar h1 {
  margin-top: 2px;
  color: #101828;
  font-size: 20px;
  letter-spacing: -.025em;
}
.workspace-user-line { margin-top: 1px; font-size: 11px; }
.top-actions { gap: 8px; }
.notification-button,
.account-button {
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.account-button { min-height: 44px; }
.account-button .avatar { border-radius: 8px; background: #272d5f; }
.account-copy small { color: #667085; }

.content {
  width: min(100%, 1500px);
  padding: 30px clamp(24px, 3vw, 42px) 72px;
}
.hero { display: none; }
body[data-current-view="overview"] .hero {
  display: flex;
  margin-bottom: 22px;
  padding: 4px 0 2px;
}
.hero h2 { margin-top: 12px; font-size: clamp(28px, 3vw, 38px); }
.hero p { color: #667085; }
.live-pill { border: 1px solid #abefc6; background: #ecfdf3; }

.section-heading {
  min-height: 54px;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}
.section-heading h2 {
  margin: 4px 0 0;
  color: #101828;
  font-size: clamp(25px, 2.5vw, 32px);
  letter-spacing: -.035em;
}
.section-copy { max-width: 720px; margin: 5px 0 0; color: #667085; }
.eyebrow { color: #7b8494; font-size: 10px; letter-spacing: .08em; }

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card:hover { box-shadow: var(--shadow); transform: none; }
.action-card:hover,
.overview-exception-banner:hover { box-shadow: var(--shadow-hover); }
.metric-grid { gap: 12px; }
#platform-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  padding: 19px 20px;
}
.metric-card::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #6258e8;
  content: "";
}
.metric-card .label { color: #667085; font-size: 11px; font-weight: 650; }
.metric-card .value { margin: 12px 0 8px; font-size: 27px; font-weight: 730; }
.metric-card .delta { font-size: 10px; }
.dashboard-grid { gap: 12px; margin-top: 12px; }
.dashboard-grid > .card,
.control-card,
.finance-card { padding: 20px; }
.card-heading { min-width: 0; }
.card-heading h3 { color: #101828; font-size: 16px; }
.flow-list { margin-top: 18px; }
.flow-item { padding: 15px 13px; border: 1px solid #eef0f3; border-radius: 9px; background: #f9fafb; }
.flow-item strong { font-size: 22px; }
.flow-line { height: 3px; }

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
.primary-button {
  background: #5147d9;
  box-shadow: 0 1px 2px rgba(16,24,40,.08);
}
.primary-button:hover { background: #4038b4; box-shadow: 0 2px 5px rgba(64,56,180,.22); transform: none; }
.secondary-button { border-color: var(--line-strong); }
.secondary-button:hover { border-color: #a9a2ee; background: #f8f7ff; }
.text-button {
  min-height: 36px;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 12px;
}
.text-button:hover { background: var(--brand-soft); }

.settings-grid,
.control-grid { gap: 14px; }
.settings-form {
  gap: 16px;
  padding: 22px;
}
.settings-form > div:first-child:not(.form-row),
.control-card > div:first-child:not(.card-heading) {
  padding-bottom: 13px;
  border-bottom: 1px solid #eef0f3;
}
.settings-form h3 { color: #101828; font-size: 18px; }
.settings-form label,
.login-panel label { color: #344054; font-size: 12px; }
.settings-form input,
.settings-form select,
.settings-form textarea {
  min-height: 44px;
  border-color: var(--line-strong);
  border-radius: 8px;
  background-color: #fff;
  font-size: 14px;
}
.settings-form input:hover,
.settings-form select:hover,
.settings-form textarea:hover { border-color: #98a2b3; }
.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
  border-color: #6258e8;
  box-shadow: 0 0 0 3px rgba(98,88,232,.13);
}
.form-section,
.form-disclosure {
  border-color: var(--line);
  border-radius: 9px;
  background: #fafbfc;
}
.form-section { padding: 15px; }
.form-disclosure { padding: 13px 15px; }
.form-disclosure[open] { background: #fff; }
.control-help { color: #667085; }
.field-heading { margin-bottom: 6px; }
.field-requirement { background: #f2f4f7; }
.field-requirement.required { background: #fff1f3; }
.field-info-button { border-color: var(--line-strong); }

.table-card {
  margin-top: 14px;
  padding: 8px 18px 16px;
}
.table-toolbar {
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.responsive-table { scrollbar-color: #c6cad2 transparent; scrollbar-width: thin; }
.responsive-table table { min-width: 760px; }
.responsive-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 10px;
  background: #fff;
  color: #667085;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .055em;
}
.responsive-table td {
  padding: 13px 10px;
  border-top-color: #eaecf0;
  color: #344054;
  font-size: 12px;
  vertical-align: middle;
}
.responsive-table tbody tr:hover td { background: #fafbff; }
.responsive-table td:first-child strong { color: #101828; }
.status-chip {
  padding: 4px 8px;
  border: 1px solid #dddafe;
  background: #f4f3ff;
  color: #4a42b5;
  font-size: 10px;
  font-weight: 750;
  text-transform: capitalize;
}
.summary-total-row {
  gap: 0;
  border-color: #dedbf8;
  border-radius: 10px;
  background: #dedbf8;
  box-shadow: none;
}
.summary-total-item { min-height: 68px; padding: 12px 16px; background: #f8f7ff; }
.summary-total-item + .summary-total-item { border-left: 1px solid #dedbf8; }
.summary-total-item span { color: #625b91; }
.summary-total-item strong { font-size: 18px; }
.empty-state {
  min-height: 120px;
  display: grid;
  place-content: center;
  padding: 28px 18px;
  color: #667085;
}
.exception-board,
.supplier-board,
.action-grid { gap: 12px; }
.action-card,
.supplier-tile,
.exception-tile { padding: 18px; border-radius: 11px; }
.action-icon { width: 42px; height: 42px; border-radius: 9px; }
.exception-tile { border-width: 1px; }

.toast {
  right: 24px;
  bottom: 24px;
  max-width: min(480px, calc(100vw - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 9px;
  font-size: 13px;
  box-shadow: 0 16px 40px rgba(16,24,40,.22);
}
.toast-success { background: #067647; }
.toast-error { background: #b4233b; }

.verification-note {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid #f5c36a;
  border-left: 4px solid #dc8a13;
  border-radius: 9px;
  background: #fff9eb;
  color: #69410a;
  font-size: 12px;
}
.verification-note strong { color: #7a2e0e; font-size: 13px; }
.verification-note span { color: #7a5b25; }
.verification-note.neutral {
  border-color: #d8d5ff;
  border-left-color: #6258e8;
  background: #f8f7ff;
  color: #4038b4;
}
#correction-value-field.pending-verification {
  padding: 12px;
  border: 2px solid #dc8a13;
  border-radius: 9px;
  background: #fffdf7;
}

@media (max-width: 1100px) {
  .sidebar { width: 232px; }
  main { margin-left: 232px; }
  .content { padding-inline: 24px; }
  .flow-list { grid-template-columns: repeat(2, 1fr); }
  #platform-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body {
    background: #f6f7f9;
    font-size: 14px;
  }
  main { margin-left: 0; }
  .topbar {
    min-height: 64px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 8px 10px;
    border-bottom-color: #e4e7ec;
  }
  .topbar h1 { font-size: 17px; }
  .menu-button,
  .notification-button,
  .account-button { width: 40px; min-width: 40px; height: 40px; min-height: 40px; border-radius: 9px; }
  .account-button .avatar { width: 32px; height: 32px; border-radius: 7px; }
  .content { padding: 16px 10px calc(86px + env(safe-area-inset-bottom)); }
  .platform-jump-nav { top: 66px; margin-inline: 2px; }
  .platform-action-group { display: grid; grid-template-columns: 1fr 1fr; }
  .platform-action-group .tenant-danger-menu { grid-column: 1 / -1; }
  body[data-current-view="overview"] .hero {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 4px 4px 0;
  }
  .hero h2 { margin-top: 9px; font-size: 25px; }
  .hero p { font-size: 12px; }
  .freshness {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    align-items: center;
    gap: 4px 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    text-align: left;
  }
  .freshness strong { margin: 0; font-size: 11px; }
  .section-heading {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 2px 4px 14px;
  }
  .section-heading h2 { font-size: 24px; }
  .section-heading > button { width: 100%; }
  .card { border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
  .metric-grid,
  .finance-metrics,
  #partner-settlement-metrics,
  #platform-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card,
  .skeleton { min-height: 104px; padding: 14px; }
  .metric-card .value { font-size: clamp(18px, 5vw, 22px); }
  .dashboard-grid,
  .control-grid,
  .settings-grid,
  .finance-grid,
  .ledger-grid,
  .exception-board,
  .supplier-board,
  .action-grid { grid-template-columns: 1fr; gap: 10px; }
  .supplier-card { grid-column: auto; }
  .dashboard-grid > .card,
  .control-card,
  .finance-card,
  .settings-form { padding: 16px 14px; }
  .flow-list { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .flow-item { padding: 12px 10px; }
  .flow-item strong { font-size: 19px; }
  .summary-total-item + .summary-total-item { border-left: 0; border-top: 1px solid #dedbf8; }
  .table-card { padding: 10px; border-radius: 10px; }
  .responsive-table table { width: 100%; min-width: 0; }
  .responsive-table tr {
    margin-bottom: 9px;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
  }
  .responsive-table tr:first-child { border-top: 1px solid var(--line); }
  .responsive-table td {
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    padding: 5px 0;
    border: 0;
    font-size: 12px;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .responsive-table td > * { min-width: 0; max-width: 100%; }
  .responsive-table td:first-child {
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eaecf0;
  }
  .responsive-table td:first-child::before { color: #475467; }
  .responsive-table td[data-label="Action"],
  .responsive-table td[data-label="Actions"] {
    margin-top: 7px;
    padding-top: 10px;
    border-top: 1px solid #eaecf0;
  }
  .responsive-table td[data-label="Action"] .text-button,
  .responsive-table td[data-label="Actions"] .text-button {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #d8d5ff;
    background: #f8f7ff;
  }
  .table-toolbar { padding: 12px; border-radius: 8px; }
  .primary-button,
  .secondary-button { min-height: 44px; }
  .form-row { gap: 10px; }
  .mobile-nav {
    min-height: 62px;
    border-top: 1px solid #e4e7ec;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -4px 18px rgba(16,24,40,.07);
  }
  .mobile-nav button { min-height: 46px; color: #667085; font-weight: 650; }
  .mobile-nav button.active { background: #f0efff; color: #4038b4; }
  body[data-current-view="platform"] .mobile-nav { display: none; }
  body[data-current-view="platform"] main { padding-bottom: env(safe-area-inset-bottom); }
  .toast {
    right: 10px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 10px;
    max-width: none;
  }
}

@media (max-width: 390px) {
  .metric-grid,
  .finance-metrics,
  #partner-settlement-metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-width: 0; }
  .metric-card .value { font-size: 18px; }
}
