:root {
  color-scheme: light;
  --navy-950: #06192f;
  --navy-900: #071d3a;
  --navy-800: #08233f;
  --navy-700: #0b2d57;
  --primary: #173c5f;
  --accent: #08a9bd;
  --accent-dark: #078b9c;
  --accent-soft: #e7fafc;
  --page: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e1e8ef;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 35, 70, 0.04);
  --shadow-card: 0 18px 50px rgba(15, 35, 70, 0.06);
  --shadow-float: 0 24px 80px rgba(15, 35, 70, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy-900);
  background: var(--page);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.56;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

svg {
  display: block;
  flex: none;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
  background:
    radial-gradient(circle at 35% 15%, rgba(8, 169, 189, 0.12), transparent 38%),
    var(--page);
}

.boot-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #0b7faf);
  box-shadow: 0 18px 34px rgba(8, 169, 189, 0.28);
  font-size: 25px;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--muted);
}

.text-small {
  font-size: 12px;
}

.text-mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.stack {
  display: grid;
  gap: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.spacer {
  flex: 1;
}

.btn {
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font-weight: 650;
  font-size: 13px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 24px rgba(23, 60, 95, 0.16);
}

.btn-primary:hover:not(:disabled) {
  background: #214f76;
}

.btn-accent {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(8, 169, 189, 0.18);
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-secondary {
  color: var(--primary);
  background: #fff;
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: #cbd9e4;
  background: #f8fbfd;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--primary);
  background: #eef3f7;
}

.btn-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.btn-small {
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
}

.btn-wide {
  width: 100%;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 11px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 650;
}

.field > span {
  line-height: 1.25;
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--navy-900);
  background: #fff;
  font-size: 13px;
  font-weight: 450;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.field textarea {
  min-height: 96px;
  padding-block: 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  border-color: #64c8d4;
  box-shadow: 0 0 0 3px rgba(8, 169, 189, 0.12);
}

.input-error {
  border-color: #f87171 !important;
  background: #fff7f7 !important;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.notice {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.55;
}

.notice.success {
  color: #047857;
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.notice.warning {
  color: #a16207;
  background: var(--warning-soft);
  border-color: #fde68a;
}

.notice.danger {
  color: #b91c1c;
  background: var(--danger-soft);
  border-color: #fecaca;
}

.badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.pending_arrival,
.badge.disabled,
.badge.voided {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.badge.arrived_pending_inspection,
.badge.notice {
  color: #0e7490;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.badge.inspecting {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.badge.pending_review,
.badge.pending {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.badge.evidence_ready,
.badge.active,
.badge.succeeded {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.badge.merchant_viewed {
  color: #0f766e;
  background: #f0fdfa;
  border-color: #99f6e4;
}

.badge.evidence_incomplete,
.badge.insufficient_balance {
  color: #c2410c;
  background: #fff7ed;
  border-color: #fed7aa;
}

.badge.unmatched,
.badge.failed {
  color: #b91c1c;
  background: var(--danger-soft);
  border-color: #fecaca;
}

.badge.suspended {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
}

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

/* Login */
.login-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 20% 12%, rgba(8, 169, 189, 0.17), transparent 29%),
    radial-gradient(circle at 92% 84%, rgba(21, 108, 166, 0.2), transparent 30%),
    var(--navy-900);
}

.login-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, #000, transparent 68%);
}

.login-layout {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100% - 64px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 54px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 86px;
  align-items: center;
}

.login-visual {
  padding: 24px 8px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #cffafe;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.login-kicker-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(8, 169, 189, 0.18);
}

.login-visual h1 {
  max-width: 720px;
  margin-top: 26px;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.login-visual > p {
  max-width: 720px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 17px;
  line-height: 1.85;
}

.login-role-grid {
  max-width: 820px;
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.login-role {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.login-role:hover {
  transform: translateY(-2px);
  border-color: rgba(80, 213, 226, 0.38);
  background: rgba(255, 255, 255, 0.08);
}

.login-role svg {
  color: #a5f3fc;
}

.login-role strong {
  display: block;
  margin-top: 15px;
  font-size: 15px;
}

.login-role span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 11px;
}

.login-card {
  overflow: hidden;
  color: var(--navy-900);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.26);
}

.login-card-head {
  padding: 28px 28px 20px;
}

.login-card-head .eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.login-card-head h2 {
  margin-top: 7px;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.login-card-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-card-body {
  padding: 0 28px 28px;
}

/* App shells */
.app-shell {
  min-height: 100vh;
  background: var(--page);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 74px;
  padding: 0 max(24px, calc((100vw - 1500px) / 2));
  display: flex;
  align-items: center;
  gap: 26px;
  color: #fff;
  background: rgba(7, 29, 58, 0.98);
  box-shadow: 0 10px 30px rgba(7, 29, 58, 0.12);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 205px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #10c0cf, #0786b1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28);
}

.brand-copy strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.brand-copy span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 10px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.header-nav a {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  transition:
    color 0.16s ease,
    background 0.16s ease;
}

.header-nav a:hover,
.header-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-user .user-copy {
  text-align: right;
}

.header-user strong {
  display: block;
  font-size: 12px;
}

.header-user span {
  display: block;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}

.user-chip {
  min-height: 42px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5edf3;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}

.avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2d7293, #174b70);
  font-size: 11px;
  font-weight: 700;
}

.main-container {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.page-heading h1 {
  margin-top: 4px;
  color: var(--primary);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.page-heading .description {
  max-width: 880px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.card.padded {
  padding: 20px;
}

.card-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-section-head h2,
.card-section-head h3 {
  color: var(--primary);
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.card-section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.section-stack {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.span-4 {
  grid-column: span 4;
}

.span-5 {
  grid-column: span 5;
}

.span-6 {
  grid-column: span 6;
}

.span-7 {
  grid-column: span 7;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.stat-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.stat-card {
  min-height: 128px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--navy-900);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 23px;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

a.stat-card:hover {
  transform: translateY(-2px);
  border-color: #c4dfe3;
  box-shadow: var(--shadow-card);
}

.stat-card .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.stat-card strong {
  margin-top: 8px;
  font-size: 31px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card small {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 11px;
}

.card-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: inherit;
}

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  color: var(--navy-900);
  font-size: 12px;
}

.data-table th {
  padding: 12px 16px;
  color: #728396;
  background: #f8fafc;
  text-align: left;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-top: 1px solid #edf1f5;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fbfcfe;
}

.tracking-cell strong {
  display: block;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.tracking-cell span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.filter-bar {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
}

.filter-bar .field {
  gap: 4px;
}

.filter-bar input,
.filter-bar select {
  background: #fff;
}

.toolbar-line {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.toolbar-line .search {
  flex: 1;
  min-width: 210px;
}

/* Admin */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  background: #fff;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #fff;
  background: var(--navy-900);
  box-shadow: 8px 0 30px rgba(7, 29, 58, 0.08);
}

.admin-brand {
  height: 131px;
  padding: 24px 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.admin-brand strong {
  display: block;
  font-size: 15px;
}

.admin-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
}

.admin-nav {
  padding: 18px 20px;
  display: grid;
  gap: 5px;
}

.admin-nav a {
  height: 44px;
  padding: 0 20px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.admin-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.admin-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, #0caec1, #08a3b5);
  box-shadow: 0 10px 26px rgba(8, 169, 189, 0.22);
}

.admin-sidebar-footer {
  position: absolute;
  right: 20px;
  bottom: 22px;
  left: 20px;
}

.admin-sidebar-footer .header-user {
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-sidebar-footer .user-copy {
  text-align: left;
}

.admin-main {
  min-width: 0;
  background: #fff;
}

.admin-hero {
  height: 137px;
  min-height: 137px;
  padding: 31px 34px 17px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  background: #f4f7fb;
}

.admin-hero-inner {
  width: min(1420px, 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.page-hero {
  min-height: 137px;
}

.admin-hero h1 {
  margin-top: 3px;
  color: var(--primary);
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.admin-hero .description {
  max-width: 900px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.admin-hero .user-chip {
  margin-top: 12px;
  border: 0;
  box-shadow: none;
}

.admin-content {
  width: min(1230px, calc(100% - 48px));
  margin-left: max(24px, calc((100% - 1230px) / 2 - 11px));
  padding: 45px 0 64px;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.metric-card {
  min-height: 134px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.metric-card .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-card small {
  display: block;
  margin-top: 13px;
  color: var(--muted-2);
  font-size: 11px;
}

.admin-dashboard-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr 372px;
  grid-auto-rows: 274px;
  gap: 22px;
}

.quick-card,
.activity-panel {
  min-height: 274px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.quick-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.quick-card.highlight {
  border-color: #80dbe3;
  box-shadow: 0 0 0 1px rgba(8, 169, 189, 0.05);
}

.quick-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}

.quick-link {
  color: var(--accent);
  font-size: 11px;
  font-weight: 650;
}

.quick-card h3 {
  margin-top: 24px;
  color: var(--primary);
  font-size: 17px;
}

.quick-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.activity-panel {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-height: 0;
  height: 570px;
  overflow: hidden;
}

.activity-panel h3 {
  margin-top: 3px;
  color: var(--primary);
  font-size: 20px;
}

.activity-list {
  margin-top: 20px;
  display: grid;
}

.activity-item {
  padding: 15px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid #edf1f5;
}

.activity-item:first-child {
  border-top: 0;
}

.activity-item strong {
  overflow: hidden;
  color: var(--primary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item time {
  align-self: start;
  color: var(--muted-2);
  font-size: 10px;
}

.activity-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-two-col {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.account-card,
.merchant-card,
.warehouse-card {
  padding: 20px;
}

.merchant-grid,
.warehouse-grid {
  display: grid;
  gap: 16px;
}

.store-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.store-card {
  padding: 14px;
  border: 1px solid #edf1f5;
  border-radius: 15px;
  background: #f8fafc;
}

.store-card strong {
  font-size: 13px;
}

.store-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

/* Merchant and warehouse workspace */
.workspace-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.8fr);
  gap: 18px;
}

.workspace-grid.even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  padding: 18px 20px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h2,
.panel-head h3 {
  color: var(--primary);
  font-size: 19px;
  line-height: 1.3;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.panel-body {
  padding: 0 20px 20px;
}

.batch-tabs,
.segmented-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #f3f6f9;
}

.batch-tabs button,
.segmented-tabs button {
  height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.batch-tabs button.active,
.segmented-tabs button.active {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 35, 70, 0.08);
}

.import-area {
  margin-top: 13px;
}

.import-table {
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.mini-table th,
.mini-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
}

.mini-table th {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 650;
}

.mini-table tr:last-child td {
  border-bottom: 0;
}

.scan-hero {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(33, 211, 223, 0.22), transparent 36%),
    linear-gradient(135deg, #08233f, #0a3159);
  box-shadow: 0 20px 50px rgba(7, 29, 58, 0.16);
}

.scan-hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -40px;
  bottom: -80px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.scan-form {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.scan-form input {
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 15px;
  font-weight: 600;
}

.scan-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.scan-form input:focus {
  border-color: rgba(93, 225, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(8, 169, 189, 0.15);
}

.scan-form .btn {
  height: 48px;
  color: #fff;
  background: var(--accent);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.step {
  position: relative;
  min-height: 112px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), transparent),
    #f7f9f6;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 30px;
  right: -13px;
  width: 12px;
  height: 2px;
  background: #d4e2dd;
}

.step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.step-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #dbe4df;
  border-radius: 11px;
  color: #6e7d77;
  background: #eef2ef;
}

.step-state {
  min-height: 23px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #dfe5e1;
  border-radius: 999px;
  color: var(--muted);
  background: #f7f9f7;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.step-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.step.complete {
  border-color: #bad8ce;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), transparent),
    #f1f8f4;
}

.step.complete .step-icon {
  color: #2b685e;
  border-color: #bedbd1;
  background: #deefe9;
}

.step.complete .step-state {
  color: #2f705f;
  border-color: #c7e2d8;
  background: #edf8f2;
}

.step.active {
  border-color: #83bdb3;
  background:
    radial-gradient(circle at 92% 10%, rgba(57, 118, 111, 0.08), transparent 32%),
    #f2faf7;
  box-shadow: 0 8px 22px rgba(57, 118, 111, 0.08);
}

.step.active .step-icon {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.step.active .step-state {
  color: #286a61;
  border-color: #96ccc2;
  background: #e4f4ef;
}

.step-title {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.step-title small {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
}

.step-title strong {
  display: block;
  color: var(--primary);
  font-size: 12px;
}

.step-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.package-picker {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
}

.current-package {
  padding: 14px;
  border: 1px solid #e6edf2;
  border-radius: 15px;
  background: #f8fafc;
}

.current-package strong {
  display: block;
  color: var(--primary);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.current-package p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  min-height: 238px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent),
    #0a1728;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  min-height: 238px;
  object-fit: cover;
}

.camera-placeholder {
  padding: 30px;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.camera-placeholder svg {
  margin: 0 auto 12px;
  color: #67e8f9;
}

.camera-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.evidence-slot {
  padding: 14px;
  border: 1px dashed #ccd8e3;
  border-radius: 16px;
  background: #fafcfd;
}

.evidence-slot.complete {
  border-style: solid;
  border-color: #a7f3d0;
  background: #f0fdf9;
}

.evidence-slot .slot-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.evidence-slot .slot-state {
  color: var(--muted);
  font-size: 10px;
}

.evidence-slot.complete .slot-state {
  color: var(--success);
}

.evidence-slot input[type="file"] {
  width: 100%;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.evidence-slot input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  background: #fff;
  font-size: 10px;
  cursor: pointer;
}

.evidence-slot p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  word-break: break-all;
}

.progress {
  height: 6px;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 999px;
  background: #e7edf2;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #21c6d4);
  transition: width 0.2s ease;
}

.result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.result-pills button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 650;
}

.result-pills button.active {
  color: #0f766e;
  border-color: #7dd3fc;
  background: #ecfeff;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.process-step {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.process-step .index {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.process-step strong {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}

.process-step p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.evidence-preview-grid {
  display: grid;
  gap: 12px;
}

.evidence-preview-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
}

.evidence-preview-card .type-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.evidence-preview-card strong {
  display: block;
  color: var(--primary);
  font-size: 12px;
}

.evidence-preview-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.ledger-list {
  display: grid;
}

.ledger-row {
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid #edf1f5;
}

.ledger-row:first-child {
  border-top: 0;
}

.ledger-row strong {
  display: block;
  font-size: 12px;
}

.ledger-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.points {
  font-weight: 750;
}

.points.minus {
  color: var(--danger);
}

.points.plus {
  color: var(--success);
}

.balance-highlight {
  padding: 18px;
  border: 1px solid #bde9ed;
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 16%, rgba(8, 169, 189, 0.12), transparent 30%),
    #f2fcfd;
}

.balance-highlight strong {
  display: block;
  margin-top: 5px;
  color: var(--primary);
  font-size: 34px;
  line-height: 1;
}

.muted-block {
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: #f7f9fc;
  font-size: 11px;
  line-height: 1.6;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(980px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 25px;
  background: #fff;
  box-shadow: var(--shadow-float);
}

.modal.narrow {
  width: min(620px, 100%);
}

.modal-head {
  padding: 21px 24px 17px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  color: var(--primary);
  font-size: 22px;
  line-height: 1.3;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-cell {
  padding: 14px;
  border-radius: 14px;
  background: #f7f9fc;
}

.detail-cell span {
  color: var(--muted);
  font-size: 10px;
}

.detail-cell strong {
  display: block;
  margin-top: 5px;
  color: var(--primary);
  font-size: 12px;
}

.media-preview {
  min-height: 260px;
  margin-top: 14px;
  padding: 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(8, 169, 189, 0.04), transparent),
    #f8fafc;
}

.media-preview img,
.media-preview video {
  max-width: 100%;
  max-height: 420px;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 35, 70, 0.12);
}

.media-placeholder {
  width: min(480px, 100%);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed #c8d6e2;
  border-radius: 16px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.media-tabs {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.media-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 650;
}

.media-tabs button.active {
  color: var(--accent-dark);
  border-color: #a5e5eb;
  background: var(--accent-soft);
}

/* Toast */
.toast-root {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  width: min(380px, calc(100vw - 44px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--navy-900);
  background: #fff;
  box-shadow: 0 20px 52px rgba(15, 35, 70, 0.16);
  font-size: 12px;
  line-height: 1.55;
  animation: toast-in 0.2s ease both;
}

.toast.success {
  border-color: #a7f3d0;
  background: var(--success-soft);
}

.toast.error {
  border-color: #fecaca;
  background: var(--danger-soft);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1250px) {
  .login-layout {
    gap: 42px;
    grid-template-columns: minmax(0, 1fr) 410px;
  }

  .login-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid,
  .admin-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-panel {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 310px;
  }

  .workspace-grid,
  .workspace-grid.even,
  .review-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .login-layout {
    width: min(760px, calc(100% - 36px));
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 40px 0 56px;
  }

  .login-visual {
    text-align: center;
  }

  .login-kicker {
    margin: 0 auto;
  }

  .login-visual h1,
  .login-visual > p,
  .login-role-grid {
    margin-left: auto;
    margin-right: auto;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
  }

  .admin-brand {
    height: 82px;
  }

  .admin-nav {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    overflow-x: auto;
    padding-top: 8px;
  }

  .admin-sidebar-footer {
    position: static;
    padding: 0 20px 18px;
  }

  .site-header {
    height: auto;
    min-height: 68px;
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .brand {
    min-width: auto;
  }

  .header-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .header-user {
    margin-left: auto;
  }

  .page-heading {
    flex-direction: column;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .login-layout,
  .main-container {
    width: calc(100% - 28px);
  }

  .login-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-role {
    min-height: 96px;
  }

  .login-visual h1 {
    margin-top: 20px;
    font-size: 38px;
  }

  .login-card-head,
  .login-card-body {
    padding-left: 21px;
    padding-right: 21px;
  }

  .stat-grid,
  .admin-metric-grid,
  .admin-dashboard-grid,
  .admin-two-col,
  .workspace-grid,
  .workspace-grid.even,
  .review-layout,
  .form-grid.cols-2,
  .form-grid.cols-3,
  .form-grid.cols-4,
  .evidence-grid,
  .store-grid,
  .package-picker {
    grid-template-columns: 1fr;
  }

  .page-heading h1,
  .admin-hero h1 {
    font-size: 27px;
  }

  .admin-hero {
    height: auto;
    padding: 23px 20px;
    flex-direction: column;
  }

  .admin-content {
    width: calc(100% - 28px);
    margin-inline: auto;
    padding-top: 24px;
  }

  .admin-nav {
    grid-template-columns: repeat(6, 130px);
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .scan-form {
    grid-template-columns: 1fr;
  }

  .stepper {
    grid-template-columns: 1fr;
  }

  .step:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -13px;
    left: 32px;
    width: 2px;
    height: 12px;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    border-radius: 20px;
  }
}
