:root {
  --ink: #102033;
  --muted: #5c6b80;
  --forest: #023397;
  --forest-2: #01256e;
  --leaf: #0d7a45;
  --mint: #e7f3ec;
  --gold: #fb6603;
  --gold-2: #ffd3b8;
  --cream: #f3f6fb;
  --paper: #ffffff;
  --line: #d5e0ee;
  --white: #ffffff;
  --bad: #8d342c;
  --bad-bg: #f8e8e4;
  --wait: #9a4b00;
  --wait-bg: #fff0e6;
  --shadow: 0 18px 40px rgba(2, 51, 151, 0.08);
  --serif: "Archivo", "Segoe UI", sans-serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  background: linear-gradient(180deg, var(--forest) 0%, var(--forest-2) 100%);
  color: #f4f7ff;
  padding: 22px 16px 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand { display: flex; justify-content: center; padding: 2px 10px 18px; text-decoration: none; }
.brand img { width: 104px; background: white; border-radius: 10px; display: block; }
.logo-lockup { width: min(220px, 100%); background: white; border-radius: 14px; display: block; }
.mark { display: none; }
.nav-section { margin: 16px 8px 6px; color: #b9c7e4; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav-link {
  display: flex; align-items: center; justify-content: space-between;
  text-decoration: none; color: #f4f7ff;
  padding: 9px 10px; border-radius: 10px; margin-bottom: 2px;
}
.nav-link:hover { background: rgba(251, 102, 3, 0.22); color: white; }
.nav-link.active { background: #fb6603; color: white; }
.nav-link small { color: var(--gold-2); }
.side-user { margin-top: 22px; padding: 12px; border-top: 1px solid rgba(255,255,255,.14); }
.side-user strong { display: block; }
.side-user span { color: #c5d2ea; font-size: 13px; }
.side-user button { margin-top: 10px; background: transparent; color: #ffd3b8; border: 0; padding: 0; cursor: pointer; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--line); background: rgba(251,248,242,.9);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px);
}
.topbar-start { display: flex; gap: 10px; align-items: center; min-width: 0; }
.nav-shade { display: none; }
.session-pill {
  display: inline-flex; gap: 8px; align-items: center;
  background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
.session-pill i { width: 8px; height: 8px; border-radius: 99px; background: var(--leaf); display: inline-block; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.bell { text-decoration: none; background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.bell b { color: var(--bad); }
.btn.burger { display: none; }

.page { padding: 28px; }
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 22px; }
.kicker { margin: 0 0 4px; color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; font-size: 12px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 750; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 40px; line-height: 1.05; }
h2 { font-size: 28px; }
.lede { color: var(--muted); max-width: 62ch; margin: 8px 0 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stat { padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 30px; font-weight: 560; letter-spacing: -0.03em; }
.stat em { font-style: normal; color: var(--leaf); font-size: 12px; }

.panel { padding: 18px; margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.panel-head h2, .panel-head h3 { font-size: 22px; }

.layout-2 { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.layout-3 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }

table { width: 100%; border-collapse: collapse; }
.panel table { min-width: 560px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 560; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid #e7eef8; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 12px; text-transform: capitalize; background: #e8eef8; }
.badge-ok { background: var(--mint); color: var(--leaf); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-gold { background: #fff0e6; color: #c2410c; }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 10px 16px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer; background: var(--forest); color: white;
}
.btn:hover { filter: brightness(1.08); }
.btn-gold { background: var(--gold); color: #01256e; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-bad { background: var(--bad); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head .actions { justify-content: flex-end; }
.page-head .actions input,
.page-head .actions select { width: auto; min-width: 8rem; flex: 1 1 8rem; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span, label { font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
}
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }

.flash { background: #e8f0ff; border: 1px solid #c5d6f5; color: #01256e; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; }
.flash-bad { background: var(--bad-bg); border-color: #efcfc9; color: var(--bad); }

.plastic {
  width: min(100%, 460px);
  aspect-ratio: 1.7 / 1;
  border-radius: 22px;
  padding: 18px;
  color: white;
  background:
    radial-gradient(circle at 90% 0%, rgba(251,102,3,.45), transparent 32%),
    linear-gradient(145deg, #1d5fe0 0%, #023397 52%, #01256e 100%);
  box-shadow: 0 22px 40px rgba(2, 51, 151, .28);
  display: grid;
  grid-template-columns: 1fr auto;
  position: relative;
  overflow: hidden;
}
.plastic:before {
  content: "";
  position: absolute; inset: 10px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 16px;
  pointer-events: none;
}
.plastic .card-logo { width: 108px; background: white; border-radius: 8px; position: relative; z-index: 1; }
.plastic .who { display: flex; gap: 12px; align-items: center; }
.avatar, .avatar-lg {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover;
  background: var(--gold-2); color: var(--forest);
  display: grid; place-items: center; font-family: var(--serif); font-size: 18px;
}
.plastic .sv { font-family: var(--serif); font-size: 28px; font-weight: 800; letter-spacing: 0.04em; color: #ffd8bf; }
.plastic .qr { width: 92px; height: 92px; background: white; border-radius: 10px; padding: 6px; }
.mini-cards { display: flex; gap: 12px; overflow: auto; padding-bottom: 6px; }
.mini {
  min-width: 220px; text-decoration: none; color: #f7f1e4; border-radius: 16px; padding: 14px;
  background: linear-gradient(160deg, #1d5fe0, #023397);
}
.mini strong { display: block; font-family: var(--serif); font-size: 20px; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar i { display: block; width: 100%; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--gold-2), var(--leaf)); min-height: 4px; }
.bar span { font-size: 11px; color: var(--muted); }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pipe { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.pipe b { display: block; font-family: var(--serif); font-size: 26px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding-bottom: 12px; }
.timeline i { width: 10px; height: 10px; border-radius: 99px; background: var(--gold); margin-top: 6px; }

.empty { padding: 28px 10px; color: var(--muted); text-align: center; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.pager a, .pager span { text-decoration: none; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: white; }
.pager .active { background: var(--forest); color: white; }

.site { min-height: 100vh; background: #f4f7fb; display: flex; flex-direction: column; }
.site-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px 40px; background: #fff; border-bottom: 3px solid var(--forest);
  position: sticky; top: 0; z-index: 5;
}
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.site-brand img { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; background: #fff; flex: none; }
.site-brand strong { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: -0.02em; color: var(--forest); line-height: 1.1; }
.site-brand em { display: block; margin-top: 3px; font-style: normal; font-size: 12px; color: var(--muted); }
.site-menu { position: absolute; opacity: 0; pointer-events: none; }
.site-burger {
  display: none; width: 42px; height: 42px; flex: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  align-items: center; justify-content: center;
}
.site-burger span, .site-burger span:before, .site-burger span:after {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--forest); position: relative;
}
.site-burger span:before, .site-burger span:after { content: ""; position: absolute; left: 0; }
.site-burger span:before { top: -6px; }
.site-burger span:after { top: 6px; }
.site-menu:checked ~ .site-burger span { background: transparent; }
.site-menu:checked ~ .site-burger span:before { top: 0; transform: rotate(45deg); }
.site-menu:checked ~ .site-burger span:after { top: 0; transform: rotate(-45deg); }
.site-nav { display: flex; align-items: center; gap: 18px; flex: none; }
.site-nav a { text-decoration: none; }
.site-nav .text-link { font-size: 14px; color: var(--ink); }
.site-nav .text-link:hover, .site-nav .text-link.is-current { color: var(--forest); font-weight: 600; }
.site-hero h1 { font-size: 46px; line-height: 1.08; max-width: 14ch; }
.site-hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
  width: min(1120px, 100%); margin: 0 auto; padding: 72px 40px 48px;
}
.site-foot nav { display: flex; gap: 16px; }
.about { width: min(760px, 100%); margin: 0 auto; padding: 56px 40px 72px; }
.about h1 { font-size: 44px; max-width: 14ch; }
.about .lede { font-size: 18px; margin: 14px 0 28px; }
.about-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; }
.about-block h2 { font-size: 20px; margin-bottom: 8px; }
.about-block p { margin: 0; color: var(--muted); }
.about-block p + p { margin-top: 10px; }
.hero-photo { width: 100%; height: 100%; min-height: 420px; object-fit: cover; border-radius: 18px; display: block; }
.site-hero .lede { font-size: 17px; margin-top: 14px; white-space: pre-line; }
.site-hero .actions { margin-top: 26px; }
.site-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 6px 22px 8px; box-shadow: 0 12px 32px rgba(2, 51, 151, .06);
}
.site-panel header { padding: 16px 0 12px; border-bottom: 1px solid var(--line); }
.site-panel h2 { font-size: 26px; }
.site-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid #e7eef8; font-size: 14.5px;
}
.site-row:last-child { border-bottom: 0; }
.site-row span { color: var(--muted); }
.site-row strong { font-weight: 600; text-align: right; }
.site-section { width: min(1120px, 100%); margin: 0 auto; padding: 12px 40px 72px; }
.site-section h2 { font-size: 28px; margin-bottom: 16px; }
.site-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.site-grid article {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--forest);
  border-radius: 12px; padding: 18px 16px 20px;
}
.site-grid h3 { font-size: 17px; margin-bottom: 8px; }
.site-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.site-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 40px; background: var(--forest-2); color: #d5e0ee; font-size: 13px;
}
.site-foot a { color: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: .9fr 1.1fr; position: relative; }
.auth-back {
  position: absolute; top: 18px; left: 24px; z-index: 2;
  color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
}
.auth-back:hover { color: #ffd3b8; }
.auth-card .auth-back { position: static; display: inline-block; margin-bottom: 14px; color: var(--forest); }
.auth-card .auth-back:hover { color: var(--gold); }
.auth-art { background: linear-gradient(180deg, #023397, #01256e); color: #f4f7ff; padding: 64px 48px 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { font-size: clamp(32px, 4.5vw, 52px); max-width: 12ch; line-height: 1.05; }
.auth-art .logo-lockup { width: min(280px, 100%); margin-bottom: 28px; }
.auth-box { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(100%, 440px); }
.demo { background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 12px; margin-top: 16px; font-size: 13px; }
.demo code { font-family: ui-monospace, monospace; }

.print-sheet { background: white; min-height: 100vh; padding: 24px; }
.cr80 { width: 86mm; height: 54mm; }

@media (max-width: 1100px) {
  .stats, .pipeline, .site-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 20; transform: translateX(-105%); transition: .2s ease;
    width: min(84vw, 300px); box-shadow: 16px 0 40px rgba(1, 37, 110, .28);
  }
  .nav-toggle:checked ~ .shell .sidebar { transform: none; }
  .nav-toggle:checked ~ .shell .nav-shade { display: block; position: fixed; inset: 0; background: rgba(16, 32, 51, .45); z-index: 15; }
  .btn.burger { display: inline-flex; }
  .layout-2, .layout-3, .form-grid, .auth-wrap, .site-hero { grid-template-columns: 1fr; }
  .page, .auth-art { padding: 24px; }
  .auth-art { padding-top: 56px; }
  .topbar, .page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .site-bar, .site-hero, .site-section, .site-foot, .about { padding-left: 20px; padding-right: 20px; }
  .about h1 { font-size: 34px; }
  .site-bar { align-items: center; flex-wrap: nowrap; }
  .site-brand { flex: 1; }
  .site-brand em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
  .site-burger { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 6px; width: auto;
    padding: 8px 20px 16px; background: #fff;
    border-bottom: 3px solid var(--forest);
    box-shadow: 0 16px 32px rgba(2, 51, 151, .12);
  }
  .site-menu:checked ~ .site-nav { display: flex; }
  .site-nav .text-link, .site-nav .btn { padding: 12px 14px; border-radius: 10px; }
  .site-nav .btn { width: 100%; }
  .site-foot { flex-wrap: wrap; }
  .site-hero { padding-top: 36px; padding-bottom: 28px; gap: 28px; }
  .site-hero h1 { font-size: 34px; max-width: none; }
  h1 { font-size: 34px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .actions { justify-content: flex-start; width: 100%; }
  .stat strong { font-size: clamp(22px, 6vw, 30px); overflow-wrap: anywhere; }
  .panel-head { flex-wrap: wrap; align-items: flex-start; }
}
@media (max-width: 640px) {
  .stats, .pipeline, .site-grid { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .topbar { padding-top: 12px; padding-bottom: 12px; gap: 8px; }
  .session-pill { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  h1, .site-hero h1, .about h1, .auth-art h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .site-brand em { font-size: 11px; }
  .site-brand img { width: 48px; height: 48px; }
  .site-row { align-items: flex-start; }
  .site-row strong { max-width: 52%; }
  .hero-photo { min-height: 220px; border-radius: 14px; }
  .plastic { padding: 12px; border-radius: 16px; }
  .plastic .card-logo { width: 72px; }
  .plastic .qr { width: 68px; height: 68px; }
  .plastic .sv { font-size: 22px; }
  .plastic .avatar, .plastic .avatar-lg { width: 40px; height: 40px; font-size: 14px; }
  input, select, textarea { font-size: 16px; }
  .auth-box { padding: 20px 16px 32px; }
  .auth-art .logo-lockup { width: min(200px, 100%); }
  .demo { overflow-wrap: anywhere; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; }
  body { background: white; }
}
