:root {
  --ink: #172033;
  --navy: #123b68;
  --blue: #2563eb;
  --sky: #e8f1fc;
  --paper: #ffffff;
  --line: #dce4ee;
  --muted: #64748b;
  --danger: #b42318;
  --success: #087443;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
a { color: inherit; }
.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 56px);
  color: white;
  background: #0d2f55;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px; background: #2563eb; font-weight: 800;
}
.brand strong { display: block; font-size: 18px; }
.brand small { color: #cbd8e8; }
.container { width: min(1460px, calc(100% - 36px)); margin: 28px auto 56px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .1em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; }
h2 { margin-bottom: 16px; font-size: 21px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; border: 1px solid transparent; border-radius: 10px;
  color: white; background: var(--navy); font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { color: var(--navy); background: white; border-color: var(--line); }
.btn.smartone { background: #087443; white-space: nowrap; }
.btn.pay { background: #d97706; white-space: nowrap; }
.btn.danger { background: var(--danger); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(15, 43, 73, .06); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 20px; }
.stat span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 14px; }
.stat strong { font-size: 28px; }
.toolbar { display: flex; gap: 12px; padding: 18px; margin-bottom: 18px; }
.toolbar form { display: flex; width: 100%; gap: 10px; }
.field { display: grid; gap: 7px; }
.field label { color: #344054; font-size: 14px; font-weight: 700; }
.mac-entry, .password-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.mac-entry .btn, .password-entry .btn { white-space: nowrap; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.ocr-status { color: var(--muted); font-size: 12px; line-height: 1.35; }
.ocr-status.working { color: #1d4ed8; }
.ocr-status.success { color: var(--success); font-weight: 700; }
.ocr-status.error { color: var(--danger); font-weight: 700; }
input, select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid #cbd5e1; border-radius: 9px; color: var(--ink); background: white;
}
input:focus, select:focus { outline: 3px solid rgba(37, 99, 235, .15); border-color: #3b82f6; }
.form-card { padding: 22px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.notice { margin-bottom: 16px; padding: 13px 16px; border-radius: 10px; font-weight: 650; }
.notice.success { color: #05603a; background: #e8f8ef; border: 1px solid #a9dfbf; }
.notice.error { color: #8b1e16; background: #fff0ee; border: 1px solid #ffc5bf; }
.table-card { overflow: hidden; }
.table-head { display: flex; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1050px; }
th { padding: 13px 14px; text-align: left; color: #475467; background: #f8fafc; font-size: 13px; }
td { padding: 14px; border-top: 1px solid #edf1f5; vertical-align: top; }
tr:hover td { background: #fbfdff; }
code { color: #132f4d; font-weight: 750; }
.muted { color: var(--muted); font-size: 13px; }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #eef2f7; font-size: 12px; font-weight: 750; }
.pill.warn { color: #8a4b08; background: #fff7d6; }
.pill.danger { color: var(--danger); background: #fff0ee; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #0d2f55 0 45%, #eaf2fc 45% 100%); }
.login-card { width: min(460px, 100%); padding: 32px; background: white; border-radius: 20px; box-shadow: 0 24px 70px rgba(4, 24, 49, .25); }
.login-card .brand-mark { color: white; margin-bottom: 22px; }
.login-card h1 { margin-bottom: 10px; font-size: 30px; }
.login-card p { color: var(--muted); }
.login-card form { display: grid; gap: 16px; margin-top: 24px; }
.login-card .btn { width: 100%; }
.footer-note { margin-top: 18px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { align-items: stretch; flex-direction: column; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; }
  .stats { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .toolbar form { flex-direction: column; }
  .container { width: min(100% - 22px, 1460px); margin-top: 18px; }
  .mac-entry, .password-entry { grid-template-columns: 1fr; }
}
