/* ZeroDot OCR - monochrom (brand Zero Dot: czern, biel, szarosci, bokeh) */
:root {
  --ink: #050505;
  --bg: #0a0a0a;
  --surface: #121212;
  --surface-2: #181818;
  --line: #262626;
  --line-2: #333333;
  --text: #f4f4f4;
  --text-2: #b3b3b3;
  --muted: #7a7a7a;
  --white: #ffffff;
  --ok: #9be7b5;
  --warn: #f2cf7a;
  --err: #f28b8b;
  --font-display: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 4px;
  --r-lg: 8px;
  --max: 1280px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b { font-weight: 600; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }

.bg-bokeh {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url('/static/brand/background_zerodot.png') center / cover no-repeat;
  filter: invert(1) contrast(1.15); opacity: .22;
}
.bg-bokeh::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,0,0,0) 0%, rgba(10,10,10,.85) 70%, #0a0a0a 100%);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 0 32px; height: 64px;
  background: rgba(10,10,10,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { height: 30px; width: auto; }
.brand-word { height: 12px; width: auto; margin-left: 2px; }
.brand-product {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .18em;
  padding: 3px 7px; border: 1px solid var(--text); border-radius: 3px; margin-left: 4px;
}
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  padding: 8px 14px; border-radius: var(--r); color: var(--text-2); font-weight: 500;
  border: 1px solid transparent;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); border-color: var(--line-2); background: var(--surface); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--white); color: var(--ink);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; font-family: var(--font-display);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.pill-ghost { border: 1px solid var(--line-2); color: var(--text-2); }

.page { max-width: var(--max); margin: 0 auto; padding: 36px 32px 80px; }
.footer {
  max-width: var(--max); margin: 0 auto; padding: 24px 32px 40px; display: flex; gap: 10px; align-items: center;
  color: var(--muted); font-size: 12px; border-top: 1px solid var(--line);
}
.footer-mark { height: 16px; opacity: .5; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 20px 0 48px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.eyebrow .dot { width: 8px; height: 8px; background: var(--white); display: inline-block; }
.hero h1 { font-size: clamp(44px, 6vw, 76px); line-height: .98; font-weight: 700; margin: 18px 0 20px; }
.hero h1 .thin { font-weight: 400; color: var(--text-2); }
.lead { font-size: 16px; color: var(--text-2); max-width: 540px; margin: 0 0 22px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--text-2); }
.hero-points li { display: flex; align-items: center; gap: 12px; }
.hero-points b {
  width: 24px; height: 24px; border: 1px solid var(--line-2); border-radius: 3px; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 12px; color: var(--text);
}
.hero-visual { position: relative; min-height: 360px; }
.hero-photo {
  position: absolute; inset: 0; border-radius: var(--r-lg); overflow: hidden;
  background: url('/static/brand/zerodot_chlopcy.png') center / cover no-repeat;
  filter: grayscale(1) brightness(.58) contrast(1.08);
  border: 1px solid var(--line);
}
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,10,.1), rgba(10,10,10,.85)); }
.hero-card {
  position: absolute; left: 28px; right: 28px; bottom: 28px;
  background: rgba(18,18,18,.92); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px 18px;
  backdrop-filter: blur(8px); box-shadow: 0 30px 60px rgba(0,0,0,.5);
}
.hero-card-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hero-card-row:last-child { border-bottom: 0; }
.hero-card-row span { color: var(--muted); }
.hero-card-row .conf { color: var(--ok); }

/* ---------- layout & cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1.3fr .9fr; gap: 24px; align-items: start; }
.stack { display: grid; gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { font-size: 17px; font-weight: 600; }
.sticky { position: sticky; top: 84px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head-right { display: flex; align-items: center; gap: 16px; }
.h-page { font-size: 30px; font-weight: 600; }
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.crumbs a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--r);
  font: 600 13px var(--font); cursor: pointer; border: 1px solid var(--line-2); background: transparent; color: var(--text);
  transition: background .15s, border-color .15s, transform .08s;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn-primary:hover { background: #e6e6e6; border-color: #e6e6e6; }
.btn-ghost { padding: 8px 12px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.link { background: none; border: 0; color: var(--text-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.input {
  background: var(--ink); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r);
  padding: 10px 12px; font: inherit; flex: 1; min-width: 0;
}
.input:focus { outline: none; border-color: var(--text-2); }

/* ---------- upload ---------- */
.dropzone {
  display: grid; justify-items: center; gap: 8px; padding: 34px 20px; text-align: center; cursor: pointer;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--ink); position: relative;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--text); background: #0e0e0e; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.dz-icon svg { width: 20px; height: 20px; }
.dz-text { display: grid; gap: 2px; }
.dz-text span { color: var(--muted); font-size: 13px; }
.dz-files { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dz-files span { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--surface); }
.samples { margin-top: 18px; }
.samples-head { display: flex; justify-content: space-between; align-items: center; color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.samples-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sample { display: block; cursor: pointer; }
.sample input { position: absolute; opacity: 0; pointer-events: none; }
.sample-box {
  display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--ink); transition: border-color .15s, background .15s;
}
.sample:hover .sample-box { border-color: var(--line-2); }
.sample input:checked + .sample-box { border-color: var(--white); background: #141414; box-shadow: inset 3px 0 0 var(--white); }
.sample-type { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sample-label { font-weight: 600; font-size: 13px; }
.sample-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.upload-foot { display: flex; gap: 12px; margin-top: 18px; }

/* ---------- tiles / types / jobs ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 12px; display: grid; gap: 4px; }
.tile-v { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1; }
.tile-l { font-size: 11px; color: var(--muted); }
.type-bars { display: grid; gap: 8px; margin-top: 16px; }
.type-bar { display: grid; grid-template-columns: 150px 1fr 30px; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); }
.type-bar i { display: block; height: 6px; background: var(--white); border-radius: 3px; min-width: 4px; }
.type-bar b { text-align: right; color: var(--text); }
.types { list-style: none; margin: 0; padding: 0; display: grid; }
.types li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.types li:last-child { border-bottom: 0; }
.types li span { color: var(--muted); font-size: 12px; }
.jobs-list { list-style: none; margin: 0; padding: 0; }
.jobs-list li a { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.jobs-list li:last-child a { border-bottom: 0; }
.jobs-list li a:hover .job-name { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.job-meta { color: var(--muted); font-size: 12px; }

.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 3px; font-size: 11px;
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--text-2);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-done { color: var(--ok); border-color: rgba(155,231,181,.35); }
.status-processing { color: var(--text); border-color: var(--text-2); }
.status-processing::before { animation: blink 1s infinite; }
.status-partial { color: var(--warn); border-color: rgba(242,207,122,.35); }
.status-error { color: var(--err); border-color: rgba(242,139,139,.35); }
@keyframes blink { 50% { opacity: .2; } }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }

/* ---------- job page ---------- */
.progress-wrap { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 12px; font-family: var(--mono); }
.progress { width: 180px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--white); transition: width .4s ease; }
.job-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.docs { display: grid; gap: 16px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .3s; }
.doc.is-processing { border-color: var(--text-2); }
.doc.is-done { border-color: var(--line-2); }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.doc-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-title > div { display: grid; min-width: 0; }
.doc-idx { width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 3px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 12px; flex: none; }
.doc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-sub { color: var(--muted); font-size: 12px; }
.doc-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge-type { background: var(--white); color: var(--ink); border-color: var(--white); font-weight: 600; }
.badge-conf { font-family: var(--mono); }
.badge-ok { color: var(--ok); border-color: rgba(155,231,181,.35); }
.badge-check { color: var(--warn); border-color: rgba(242,207,122,.35); }
.badge-review { color: var(--err); border-color: rgba(242,139,139,.35); }

.steps { list-style: none; margin: 0; padding: 0 20px 14px; display: flex; gap: 6px; }
.steps li { flex: 1; display: grid; gap: 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.steps li i { display: block; height: 3px; background: var(--line); border-radius: 2px; position: relative; overflow: hidden; }
.steps li.done { color: var(--text-2); }
.steps li.done i { background: var(--white); }
.steps li.active { color: var(--text); }
.steps li.active i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--white), transparent); animation: sweep 1.1s infinite; }
.steps li.error i { background: var(--err); }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.doc-body { display: grid; grid-template-columns: 300px 1fr; gap: 0; border-top: 1px solid var(--line); animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.doc-preview { padding: 16px; border-right: 1px solid var(--line); background: var(--ink); display: grid; gap: 10px; align-content: start; }
.preview-frame { border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; background: #fff; aspect-ratio: 1 / 1.35; display: grid; place-items: center; }
.preview-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.preview-empty { color: #999; font-size: 12px; }
.doc-text { max-height: 220px; overflow: auto; white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 10px; color: var(--text-2); font-size: 11px; margin: 0; }
.doc-data { padding: 16px 20px; display: grid; gap: 18px; align-content: start; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.field { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; animation: fadeIn .35s ease both; }
.field-label { font-size: 11px; color: var(--muted); grid-column: 1 / -1; }
.field-value { font-weight: 500; word-break: break-word; }
.field-value.empty { color: var(--muted); font-style: italic; font-weight: 400; }
.field-conf { display: grid; gap: 3px; justify-items: end; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.field-conf i { display: block; width: 44px; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.field-conf i::after { content: ""; display: block; height: 100%; width: var(--w, 0%); background: var(--white); }
.field.low .field-conf { color: var(--warn); }
.field.low .field-conf i::after { background: var(--warn); }
.field-src { grid-column: 1 / -1; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.field-src::before { content: "↳ "; }
.line-items h3, .validation h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.items-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.items-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line-2); font-size: 11px; }
.items-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notes li { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-2); }
.notes li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none; margin-top: 2px; border: 1px solid currentColor; }
.notes li.ok { color: var(--ok); } .notes li.ok::before { background: var(--ok); border-color: var(--ok); }
.notes li.warn { color: var(--warn); }
.notes li.error { color: var(--err); }
.notes li.info { color: var(--muted); }
.doc-error { padding: 14px 20px; border-top: 1px solid rgba(242,139,139,.3); color: var(--err); font-size: 13px; }

.targets { display: grid; gap: 8px; }
.target { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink); }
.target-main { display: grid; gap: 2px; min-width: 0; }
.target-main span { font-size: 11px; color: var(--muted); }
.target.done { border-color: rgba(155,231,181,.4); }
.push-log { margin-top: 14px; display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
.push-entry { display: flex; gap: 8px; align-items: baseline; }
.push-detail { background: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 10px; margin-top: 8px; font-size: 11px; }
.push-detail table { width: 100%; border-collapse: collapse; }
.push-detail td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.push-detail pre { margin: 0; white-space: pre-wrap; color: var(--text-2); max-height: 180px; overflow: auto; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--white); color: var(--ink); padding: 10px 16px; border-radius: var(--r); font-weight: 600; box-shadow: 0 20px 50px rgba(0,0,0,.6); z-index: 50; animation: fadeIn .2s; }

@media (max-width: 1000px) {
  .hero, .grid-2, .job-layout { grid-template-columns: 1fr; }
  .hero-visual { min-height: 280px; }
  .doc-body { grid-template-columns: 1fr; }
  .doc-preview { border-right: 0; border-bottom: 1px solid var(--line); }
  .fields { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; gap: 14px; }
  .page { padding: 24px 16px 60px; }
  .sticky { position: static; }
  .brand-word { display: none; }
}
