/* plastic.filipa.cz – Filipa brand, tablet-first, big touch targets */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #111111;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #111111;
  --accent: #96d701;
  --accent-ink: #111111;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --nok: #b91c1c;
  --nok-bg: #fee2e2;
  --warn: #a16207;
  --warn-bg: #fef3c7;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--brand); }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem;
  background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10;
  border-bottom: 3px solid var(--accent);
}
.topbar .brand {
  display: inline-flex; align-items: center; gap: .65rem;
  font-weight: 700; letter-spacing: .02em; color: #fff; text-decoration: none;
}
.topbar .brand img { height: 28px; width: auto; display: block; }
.topbar .brand .tag { color: var(--accent); font-weight: 800; font-size: .95rem; }
.topbar a.nav { color: #fff; text-decoration: none; font-weight: 600; opacity: .9; }
.topbar a.nav:hover { color: var(--accent); opacity: 1; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
.login-hero { text-align: center; margin-bottom: 1rem; }
.login-hero img { height: 48px; width: auto; margin-bottom: .6rem; }
.login-hero .sub { color: var(--muted); font-size: .95rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem;
        box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 56px; padding: .6rem 1.2rem; border-radius: 12px; border: 2px solid var(--brand);
  background: var(--brand); color: #fff; font-size: 1.1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; touch-action: manipulation;
}
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.nok { background: var(--nok); border-color: var(--nok); }
.btn.small { min-height: 40px; font-size: .95rem; padding: .3rem .8rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.outline-ok { background: #fff; color: var(--ok); border-color: var(--ok); }
.btn.outline-nok { background: #fff; color: var(--nok); border-color: var(--nok); }

input[type=text], input[type=number], input[type=search], input[type=date], input[type=password], select, textarea {
  font: inherit; padding: .65rem .8rem; border: 2px solid var(--line); border-radius: 10px; width: 100%;
  background: #fff;
}
label { font-weight: 600; display: block; margin: .4rem 0 .2rem; }

.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.nok { background: var(--nok-bg); color: var(--nok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.open { background: #e0e7ff; color: #3730a3; }

.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.alert.error { background: var(--nok-bg); color: var(--nok); }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.alert.warning { background: var(--warn-bg); color: var(--warn); }

/* scanner */
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 12% 10%; border: 4px solid rgba(255,255,255,.85); border-radius: 18px;
                  box-shadow: 0 0 0 9999px rgba(0,0,0,.25); pointer-events: none; }
.scanner .hint { position: absolute; left: 0; right: 0; bottom: 0; padding: .6rem; text-align: center; color: #fff;
                 background: rgba(0,0,0,.55); font-weight: 600; }
.scanner .idle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.scan-status { display: flex; gap: .6rem; margin: .6rem 0; flex-wrap: wrap; }
.scan-status span { padding: .3rem .7rem; border-radius: 999px; background: #e5e7eb; font-weight: 600; }
.scan-status span.got { background: var(--ok-bg); color: var(--ok); }

/* inspection */
.head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.head .jis { font-size: 2rem; font-weight: 800; letter-spacing: .03em; }
.side { font-size: 1.4rem; font-weight: 800; padding: .2rem .8rem; border-radius: 10px; background: var(--brand); color: #fff; }
.color-chip { display: inline-flex; align-items: center; gap: .6rem; font-size: 1.3rem; font-weight: 800; }
.color-chip .swatch { width: 44px; height: 44px; border-radius: 10px; border: 2px solid #111; background: repeating-linear-gradient(45deg,#ddd,#ddd 6px,#fff 6px,#fff 12px); }
.config { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; margin-top: .8rem; }
.config div { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; }
.config b { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }

.syscheck { display: flex; gap: .6rem; align-items: flex-start; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.syscheck:last-child { border-bottom: 0; }

.check-row { display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: center; padding: .8rem 0;
             border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-row .name { font-weight: 700; }
.check-row .expected { font-size: 1.15rem; }
.check-row .actions { display: flex; gap: .5rem; }
.check-row.is-ok { background: linear-gradient(90deg, var(--ok-bg), transparent 40%); }
.check-row.is-nok { background: linear-gradient(90deg, var(--nok-bg), transparent 40%); }
.check-row .extra { grid-column: 1 / -1; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.ref { max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }

.thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-slot { border: 2px dashed var(--line); border-radius: 12px; padding: .7rem; margin-bottom: .6rem; }
.photo-slot.done { border-color: var(--ok); }
.file-btn input { display: none; }

table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .85rem; color: var(--muted); }

.result-big { text-align: center; padding: 2.5rem 1rem; border-radius: var(--radius); color: #fff; }
.result-big.ok { background: var(--ok); }
.result-big.nok { background: var(--nok); }
.result-big .word { font-size: 5rem; font-weight: 900; line-height: 1; }

.operators { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; align-items: end; }
.htmx-request .spinner { display: inline-block; }
.spinner { display: none; }

/* staff pages use smaller type */
body.staff { font-size: 15px; }
body.staff .btn { min-height: 40px; font-size: .95rem; }

/* printable operator cards (85 x 54 mm) – Filipa */
.cards { display: flex; flex-wrap: wrap; gap: 6mm; }
.id-card {
  width: 85mm; height: 54mm; border: 1px solid #d1d5db; border-radius: 3mm;
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
  page-break-inside: avoid; background: #fff;
}
.id-card .stripe {
  background: #111; color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 2mm 3.5mm; border-bottom: 2mm solid var(--accent);
}
.id-card .stripe img { height: 7mm; width: auto; }
.id-card .stripe .app { font-size: 8pt; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.id-card .body { flex: 1; display: flex; gap: 3.5mm; align-items: center; padding: 3mm 3.5mm; }
.id-card .qr svg { width: 30mm; height: 30mm; }
.id-card .who { font-size: 11pt; line-height: 1.25; }
.id-card .who b { display: block; font-size: 13pt; margin-bottom: 1mm; }
.id-card .who .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10pt; color: #374151; }

.ops-table .actions { white-space: nowrap; display: flex; gap: .35rem; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }

@media print {
  .no-print, .topbar { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
}
[x-cloak] { display: none !important; }
