:root {
  --navy-950: #0a1e3d;
  --navy-900: #0f2c52;
  --navy-800: #163a68;
  --navy-700: #1f4a80;
  --navy-100: #e8edf5;
  --navy-50: #f4f7fb;
  --teal-500: #0ea5a3;
  --teal-100: #e0f7f6;
  --amber-500: #d97706;
  --amber-100: #fef3e0;
  --red-500: #dc2626;
  --red-100: #fde8e8;
  --green-500: #16a34a;
  --green-100: #e6f7ec;
  --gray-900: #1a2233;
  --gray-700: #465065;
  --gray-500: #6b7789;
  --gray-300: #d7dde6;
  --gray-200: #e8ecf2;
  --gray-100: #f4f6f9;
  --white: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 44, 82, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 44, 82, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 44, 82, 0.14);
  --sidebar-w: 240px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: var(--navy-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------- Login page ---------- */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}

.login-brand {
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 55%, var(--navy-700) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 163, 0.25), transparent 70%);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-mark .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--teal-500); display: inline-block; }

.brand-kicker {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-500);
  margin-bottom: 14px;
}

.login-brand h1 {
  font-size: 34px;
  line-height: 1.35;
  font-weight: 600;
  max-width: 440px;
  margin: 0;
}

.login-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  line-height: 1.7;
  max-width: 420px;
}

.module-list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

.module-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.module-item:last-child { padding-bottom: 0; }

.module-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-500);
  padding-top: 2px;
  flex-shrink: 0;
  width: 20px;
}

.module-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 2px;
}

.module-desc {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.brand-stats {
  display: flex;
  gap: 40px;
  position: relative;
  z-index: 1;
  margin-top: 22px;
}

.brand-stats div strong { display: block; font-size: 22px; font-weight: 700; }
.brand-stats div span { font-size: 13px; color: rgba(255,255,255,0.6); }

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-card .mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy-900);
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .login-card .mobile-brand { display: flex; }
}

.login-card h2 { font-size: 22px; margin: 0 0 6px; color: var(--navy-900); }
.login-card .sub { color: var(--gray-500); font-size: 14px; margin: 0 0 28px; }

.tab-switch {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
}

.tab-switch button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--gray-500);
  font-weight: 500;
}

.tab-switch button.active {
  background: var(--white);
  color: var(--navy-900);
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-900);
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
  background: var(--white);
}

.field input:focus, .field select:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(31,74,128,0.12); }

.field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 13px; }
.field-row label { display: flex; align-items: center; gap: 6px; color: var(--gray-700); }
.link-btn { color: var(--navy-700); font-weight: 600; background: none; border: none; padding: 0; font-size: 13px; }

.btn-primary {
  width: 100%;
  background: var(--navy-900);
  color: var(--white);
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  transition: background .15s;
}
.btn-primary:hover { background: var(--navy-800); }

.error-msg {
  display: none;
  background: var(--red-100);
  color: var(--red-500);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.error-msg.show { display: block; }

.demo-hint {
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--teal-100);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--navy-800);
  line-height: 1.6;
}
.demo-hint strong { display: block; margin-bottom: 2px; }

.mfa-code-row { display: flex; gap: 8px; margin-bottom: 20px; }
.mfa-code-row input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}
.mfa-code-row input:focus { border-color: var(--navy-700); outline: none; box-shadow: 0 0 0 3px rgba(31,74,128,0.12); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 18px;
  background: none;
  border: none;
  padding: 0;
}

/* ---------- App shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-950);
  color: var(--white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  font-weight: 700;
  font-size: 17px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--teal-500); }
.sidebar-brand .dot.amber-dot { background: var(--amber-500); }

.sidebar-role {
  padding: 16px 22px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.nav-list { padding: 0 12px; flex: 1; }
.nav-list li { margin-bottom: 2px; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: rgba(255,255,255,0.68);
  font-weight: 500;
}
.nav-list a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-list a.active { background: var(--navy-800); color: var(--white); }
.nav-list a .ico { width: 17px; text-align: center; opacity: 0.85; }

.sidebar-footer {
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar h1 { font-size: 18px; margin: 0; color: var(--navy-900); }
.topbar .crumb { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }

.lang-toggle {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--navy-700); color: var(--navy-800); }
.lang-toggle.floating {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 20;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--gray-700);
}
.icon-btn .badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--red-500);
  color: white;
  font-size: 10px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  padding: 0 3px;
}

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy-100); color: var(--navy-900);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.user-chip .who { line-height: 1.3; }
.user-chip .who .name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.user-chip .who .role { font-size: 11.5px; color: var(--gray-500); }

.content { padding: 26px 28px 60px; }

/* Notification dropdown */
.notif-panel {
  position: absolute;
  top: 58px; right: 28px;
  width: 340px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  display: none;
  z-index: 30;
  overflow: hidden;
}
.notif-panel.show { display: block; }
.notif-panel .head { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-weight: 700; font-size: 13.5px; }
.notif-panel .item { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); display: flex; gap: 10px; }
.notif-panel .item:last-child { border-bottom: none; }
.notif-panel .dot2 { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.notif-panel .txt { font-size: 12.5px; color: var(--gray-700); line-height: 1.5; }
.notif-panel .txt .t { font-weight: 600; color: var(--gray-900); display:block; margin-bottom: 2px;}
.notif-panel .time { font-size: 11px; color: var(--gray-500); margin-top: 3px; }

/* KPI cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}
.kpi-card .label { font-size: 12.5px; color: var(--gray-500); font-weight: 600; margin-bottom: 10px; }
.kpi-card .value { font-size: 24px; font-weight: 700; color: var(--navy-900); }
.kpi-card .value small { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.kpi-card .delta { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.kpi-card .delta.up { color: var(--green-500); }
.kpi-card .delta.warn { color: var(--amber-500); }
.kpi-card .bar-track { height: 6px; background: var(--gray-100); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.kpi-card .bar-fill { height: 100%; background: var(--teal-500); border-radius: 3px; }

/* Panels/cards */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h3 { font-size: 15px; margin: 0; color: var(--navy-900); }
.panel-head .see-all { font-size: 12.5px; color: var(--navy-700); font-weight: 600; }
.panel-body { padding: 8px 20px 18px; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }

/* Table */
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
}
.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-900); vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: var(--navy-50); }
.data-table tbody tr:last-child td { border-bottom: none; }
.mono { font-variant-numeric: tabular-nums; }
.cell-sub { color: var(--gray-500); font-size: 12px; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge .d { width: 6px; height: 6px; border-radius: 50%; }
.badge.blue { background: var(--navy-100); color: var(--navy-800); }
.badge.blue .d { background: var(--navy-700); }
.badge.green { background: var(--green-100); color: #0f7a37; }
.badge.green .d { background: var(--green-500); }
.badge.amber { background: var(--amber-100); color: #a15c04; }
.badge.amber .d { background: var(--amber-500); }
.badge.red { background: var(--red-100); color: var(--red-500); }
.badge.red .d { background: var(--red-500); }
.badge.gray { background: var(--gray-100); color: var(--gray-500); }
.badge.gray .d { background: var(--gray-500); }

/* Filters/search bar */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  outline: none;
}
.search-box input:focus { border-color: var(--navy-700); }
.search-box .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray-500); font-size: 13px; }

.filter-chip {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
}
.filter-chip.active { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.toolbar-select {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
}

/* Notification list on dashboard */
.event-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.event-item:last-child { border-bottom: none; }
.event-ico {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 13px;
}
.event-ico.amber { background: var(--amber-100); color: var(--amber-500); }
.event-ico.red { background: var(--red-100); color: var(--red-500); }
.event-ico.green { background: var(--green-100); color: var(--green-500); }
.event-ico.blue { background: var(--navy-100); color: var(--navy-700); }
.event-text { font-size: 13px; color: var(--gray-900); line-height: 1.5; }
.event-text .sub { color: var(--gray-500); font-size: 12px; margin-top: 2px; }

/* Risk list */
.risk-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.risk-row:last-child { border-bottom: none; }
.risk-row .name { font-weight: 600; color: var(--gray-900); }
.risk-row .name .cell-sub { font-weight: 400; }

/* Order detail */
.back-row { display:flex; align-items:center; gap:8px; margin-bottom: 16px; }
.back-row a { font-size: 13px; color: var(--gray-500); font-weight: 500; display:flex; align-items:center; gap:6px;}
.back-row a:hover { color: var(--navy-900); }

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.order-head h2 { font-size: 22px; margin: 0 0 6px; color: var(--navy-900); }
.order-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.order-meta div { font-size: 12.5px; color: var(--gray-500); }
.order-meta div strong { display: block; font-size: 14px; color: var(--gray-900); font-weight: 600; margin-top: 2px; }

/* Timeline */
.timeline {
  display: flex;
  align-items: flex-start;
  padding: 10px 4px 4px;
}
.tl-step { flex: 1; position: relative; text-align: center; }
.tl-step .line {
  position: absolute;
  top: 17px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--gray-200);
  z-index: 0;
}
.tl-step:first-child .line { display: none; }
.tl-step.done .line, .tl-step.done ~ .tl-step .line { background: var(--gray-200); }
.tl-step .line.filled { background: var(--teal-500); }

.tl-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  position: relative;
  z-index: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-500);
}
.tl-step.done .tl-dot { border-color: var(--teal-500); background: var(--teal-500); color: var(--white); }
.tl-step.current .tl-dot { border-color: var(--navy-700); color: var(--navy-700); box-shadow: 0 0 0 4px rgba(31,74,128,0.14); }
.tl-step.pending .tl-dot { border-color: var(--gray-300); color: var(--gray-400); }
.tl-step.alert .tl-dot { border-color: var(--red-500); color: var(--red-500); }

.tl-label { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.tl-date { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; }
.tl-status { font-size: 11px; margin-top: 5px; font-weight: 600; }
.tl-step.done .tl-status { color: var(--green-500); }
.tl-step.current .tl-status { color: var(--navy-700); }
.tl-step.pending .tl-status { color: var(--gray-500); }
.tl-step.alert .tl-status { color: var(--red-500); }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .info-grid { grid-template-columns: 1fr; } }
.info-box { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 14px 16px; }
.info-box .k { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.info-box .v { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.info-box .v.small { font-size: 13px; font-weight: 600;}

.side-panel .panel-body .info-box { margin-bottom: 12px; }
.side-panel .panel-body .info-box:last-child { margin-bottom: 0; }

.progress-mini { height: 5px; background: var(--gray-100); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-mini > div { height: 100%; background: var(--teal-500); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy-950);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); font-size: 13.5px; }

/* Buttons */
.btn-sm {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-sm.primary { background: var(--navy-900); color: var(--white); }
.btn-sm.primary:hover { background: var(--navy-800); }
.btn-sm.outline { background: var(--white); color: var(--navy-800); border: 1px solid var(--gray-300); }
.btn-sm.outline:hover { border-color: var(--navy-700); }

/* Form page */
.form-shell { max-width: 760px; }
.form-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px 24px;
  margin-bottom: 20px;
}
.form-section h3 { font-size: 15px; margin: 0 0 3px; color: var(--navy-900); }
.form-section .hint { font-size: 12.5px; color: var(--gray-500); margin: 0 0 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-grid .field { margin-bottom: 0; }
.form-grid select, .form-grid textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-900);
  outline: none;
  font-family: inherit;
  background: var(--white);
}
.form-grid select:focus, .form-grid textarea:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(31,74,128,0.12); }
.form-grid textarea { resize: vertical; min-height: 72px; }

.check-list { display: flex; flex-direction: column; gap: 12px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.check-row input { margin-top: 2px; width: auto; }
.check-row .t { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.check-row .d { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.dropzone {
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 13px;
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--navy-700); background: var(--navy-50); }
.dropzone .ic { font-size: 22px; margin-bottom: 8px; }
.dropzone .file-name { margin-top: 8px; font-weight: 600; color: var(--navy-800); }

.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.doc-row.uploaded { border-color: var(--teal-500, #0ea5a3); background: var(--navy-50); }
.doc-info { display: flex; align-items: flex-start; gap: 12px; }
.doc-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--white);
  font-size: 11.5px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.doc-info .t { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.doc-info .d { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.doc-upload { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.doc-upload .file-name { font-size: 12.5px; font-weight: 600; color: var(--navy-800); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.btn-lg { padding: 12px 22px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; border: none; }
.btn-lg.primary { background: var(--navy-900); color: var(--white); }
.btn-lg.primary:hover { background: var(--navy-800); }
.btn-lg.ghost { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-300); }

/* Admin: checklist + score */
.checklist-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--gray-100);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item .label { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.checklist-item .detail { font-size: 12px; color: var(--gray-500); margin-top: 3px; }

.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .score-grid { grid-template-columns: 1fr; } }
.score-card { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 16px 18px; }
.score-card .role { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--gray-500); font-weight: 700; margin-bottom: 10px; }
.score-card .grade { font-size: 26px; font-weight: 700; color: var(--navy-900); margin-bottom: 6px; }
.score-card .note { font-size: 12.5px; color: var(--gray-700); line-height: 1.5; }
.score-card .term { font-size: 12px; color: var(--gray-500); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-100); }

.health-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--gray-100); }
.health-row:last-child { border-bottom: none; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.health-dot.green { background: var(--green-500); }
.health-dot.amber { background: var(--amber-500); }
.health-dot.red { background: var(--red-500); }
.health-name { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--gray-900); }
.health-meta { text-align: right; font-size: 11.5px; color: var(--gray-500); }
.health-meta .note { color: var(--red-500); font-weight: 600; }

.audit-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 12.5px; }
.audit-row:last-child { border-bottom: none; }
.audit-row .time { color: var(--gray-500); white-space: nowrap; width: 118px; flex-shrink: 0; }
.audit-row .body strong { color: var(--gray-900); }
.audit-row .body { color: var(--gray-700); }

/* Pay modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 61, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-head h3 { margin: 0; font-size: 16px; color: var(--navy-900); }
.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--gray-500);
  cursor: pointer;
  padding: 2px;
}
.modal-body { padding: 20px 22px 6px; }

.pay-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--gray-700); margin-bottom: 8px; }
.pay-row strong { color: var(--gray-900); }

.pay-amount { font-size: 30px; font-weight: 700; color: var(--navy-900); text-align: center; margin: 16px 0; }

.fx-box { background: var(--navy-50); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.fx-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--gray-700); padding: 4px 0; }
.fx-line strong { color: var(--navy-900); font-size: 14px; }

.pay-account { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; }
.pay-account .k { font-size: 11.5px; color: var(--gray-500); margin-bottom: 3px; }
.pay-account .v { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 22px 22px;
}
.modal-actions .btn-lg { flex: 1; }

.pay-cta {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--navy-900);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.pay-cta:hover { background: var(--navy-800); }

/* Simple CSS bar charts (insights page) */
.bar-chart-row { margin-bottom: 14px; }
.bar-chart-row:last-child { margin-bottom: 0; }
.bar-chart-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.bar-chart-label strong { color: var(--gray-900); font-weight: 700; }
.bar-chart-track { height: 10px; background: var(--gray-100); border-radius: 5px; overflow: hidden; }
.bar-chart-fill { height: 100%; background: var(--teal-500); border-radius: 5px; }

.insight-stat { text-align: center; }
.insight-stat .big { font-size: 26px; font-weight: 700; color: var(--navy-900); }
.insight-stat .lbl { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* Statement (print-style document) */
.stmt-toolbar {
  position: sticky;
  top: 0;
  background: var(--navy-950);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}
.stmt-toolbar .brand { font-weight: 700; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.stmt-toolbar .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--teal-500); }
.stmt-toolbar .actions { display: flex; gap: 10px; }
.stmt-toolbar button, .stmt-toolbar a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.stmt-toolbar button.primary { background: var(--teal-500); border-color: var(--teal-500); color: var(--navy-950); }

.stmt-page {
  max-width: 760px;
  margin: 32px auto 80px;
  background: var(--white);
  padding: 56px 64px;
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
  color: var(--gray-900);
}
.stmt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 34px; }
.stmt-logo { font-size: 20px; font-weight: 800; letter-spacing: 1px; color: var(--navy-900); }
.stmt-logo .dot { display:inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--teal-500); margin-right: 8px; }
.stmt-title { text-align: right; }
.stmt-title h1 { font-size: 17px; margin: 0; color: var(--navy-900); letter-spacing: 0.5px; }
.stmt-title .sub { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

.stmt-section { margin-bottom: 26px; }
.stmt-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 8px;
  margin: 0 0 12px;
}
.stmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.stmt-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px dotted var(--gray-200); }
.stmt-row span:first-child { color: var(--gray-500); }
.stmt-row span:last-child { font-weight: 600; color: var(--gray-900); }

table.stmt-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
table.stmt-table th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--gray-500); padding: 8px 4px; border-bottom: 2px solid var(--gray-300); }
table.stmt-table td { padding: 10px 4px; border-bottom: 1px solid var(--gray-100); }
table.stmt-table tr.total td { font-weight: 700; color: var(--navy-900); border-top: 2px solid var(--gray-300); border-bottom: none; font-size: 14px; }
table.stmt-table td:last-child, table.stmt-table th:last-child { text-align: right; }

.stmt-formula { background: var(--navy-50); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 12.5px; color: var(--gray-700); font-family: ui-monospace, monospace; margin-bottom: 16px; }

.stmt-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--gray-200); font-size: 11px; color: var(--gray-500); line-height: 1.7; }

@media print {
  body { background: var(--white); }
  .stmt-toolbar { display: none; }
  .stmt-page { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* Vertical approval stepper (order-detail.html) — 10 stages don't fit a
   horizontal layout gracefully, so this replaced the old 5-node timeline. */
.approval-stepper { padding: 4px 4px 0; }
.ap-step { display: flex; gap: 14px; }
.ap-rail { display: flex; flex-direction: column; align-items: center; }
.ap-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--gray-500);
  flex-shrink: 0;
  z-index: 1;
}
.ap-line { width: 2px; flex: 1; min-height: 22px; background: var(--gray-200); margin: 2px 0; }
.ap-step:last-child .ap-line { display: none; }
.ap-body { padding: 2px 0 22px; flex: 1; }
.ap-step:last-child .ap-body { padding-bottom: 0; }
.ap-label { font-size: 13.5px; font-weight: 700; color: var(--gray-900); }
.ap-date { font-size: 11.5px; color: var(--gray-500); margin-top: 2px; }
.ap-note { font-size: 12px; margin-top: 4px; line-height: 1.5; }

.ap-step.done .ap-dot { background: var(--teal-500); border-color: var(--teal-500); color: var(--white); }
.ap-step.done .ap-line { background: var(--teal-500); }
.ap-step.current .ap-dot { border-color: var(--navy-700); color: var(--navy-700); box-shadow: 0 0 0 4px rgba(31,74,128,0.14); }
.ap-step.current .ap-note { color: var(--navy-700); font-weight: 600; }
.ap-step.alert .ap-dot { border-color: var(--red-500); color: var(--red-500); }
.ap-step.alert .ap-note { color: var(--red-500); font-weight: 600; }
.ap-step.pending .ap-label { color: var(--gray-500); font-weight: 600; }
.ap-step.skip .ap-dot { border-color: var(--gray-200); color: var(--gray-300); }
.ap-step.skip .ap-label { color: var(--gray-400); font-weight: 600; }
.ap-step.skip .ap-line { background: var(--gray-200); }

/* Three-amount breakdown (order detail + admin review) */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .amount-grid { grid-template-columns: 1fr; } }
.amount-box { border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: 14px 16px; }
.amount-box .k { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.amount-box .v { font-size: 18px; font-weight: 700; color: var(--navy-900); }
.amount-box .hint { font-size: 11px; color: var(--gray-500); margin-top: 4px; }

.ai-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 18px;
}
.ai-banner .ic { font-size: 16px; line-height: 1; margin-top: 1px; }
.ai-banner .label { font-size: 13.5px; font-weight: 700; color: var(--gray-900); margin-bottom: 3px; }
.ai-banner .reason { font-size: 12.5px; color: var(--gray-600, var(--gray-700)); line-height: 1.5; }
.ai-banner.green { background: var(--green-100); border-color: rgba(22,163,74,0.25); }
.ai-banner.amber { background: var(--amber-100); border-color: rgba(217,119,6,0.25); }
.ai-banner.red { background: var(--red-100); border-color: rgba(220,38,38,0.25); }
.ai-banner.gray { background: var(--gray-100); border-color: var(--gray-200); }

.ops-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--amber-500);
  background: rgba(217, 119, 6, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}
