/* ============================================================
   Hlídač úřední desky — Calderon design system
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

@font-face{font-family:'Now';src:url('/static/fonts/Now-Regular.otf') format('opentype');font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:'Now';src:url('/static/fonts/Now-Medium.otf') format('opentype');font-weight:500;font-style:normal;font-display:swap;}
@font-face{font-family:'Now';src:url('/static/fonts/Now-Bold.otf') format('opentype');font-weight:600 700;font-style:normal;font-display:swap;}
@font-face{font-family:'Now';src:url('/static/fonts/Now-Black.otf') format('opentype');font-weight:800 900;font-style:normal;font-display:swap;}

:root {
  /* Akcent: modrá škála (#3B82C4 primární) — přemapováno z původní teal */
  --teal-50:#EFF5FB; --teal-100:#DCEAF7; --teal-200:#BBD6EE; --teal-300:#8FBAE2;
  --teal-400:#629FD6; --teal-500:#3B82C4; --teal-600:#2E68A4; --teal-700:#245484;
  --teal-800:#1D4368; --teal-900:#16304B; --teal-950:#0F2236;
  --accent-rgb: 59,130,196;
  --ink-950:#0F1F1A; --ink-900:#14201C; --ink-800:#1E2D28; --ink-700:#2C3A35;
  --ink-600:#41514B; --ink-500:#5A6B64; --ink-400:#808E88; --ink-300:#B6C1BC;
  --ink-250:#CDD6D1; --ink-200:#E1E7E4; --ink-150:#ECF0EE; --ink-100:#F2F5F3;
  --ink-50:#F8FAF9; --white:#FFFFFF;
  --amber-500:#E9A23C; --amber-100:#FBEFD7;
  --success:#1F9D5B; --success-bg:#E4F5EC;
  --warning:#D8941A; --warning-bg:#FBEFD7;
  --error:#D8534A; --error-bg:#FBE7E5;
  --info:#2F7FBF; --info-bg:#E5F0F9;

  --font-sans:'Now', system-ui, -apple-system, sans-serif;
  --font-mono:'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius-md:10px; --radius-lg:16px; --radius-xl:22px; --radius-pill:999px;
  --shadow-sm:0 1px 3px rgba(15,31,26,.07),0 1px 2px rgba(15,31,26,.05);
  --shadow-md:0 4px 12px rgba(15,31,26,.08),0 2px 4px rgba(15,31,26,.05);
  --shadow-lg:0 12px 28px rgba(15,31,26,.10),0 4px 10px rgba(15,31,26,.06);
  --shadow-primary:0 8px 22px rgba(59,130,196,.30);
  --ease-out:cubic-bezier(.22,1,.36,1); --dur:200ms;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink-50); color: var(--ink-800);
  font-family: var(--font-sans); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-600); text-decoration: none; }
a:hover { color: var(--teal-700); text-decoration: underline; }
h1,h2,h3 { color: var(--ink-900); margin: 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-500); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

.eyebrow {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--teal-600);
}

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex-shrink: 0; background: var(--ink-950); color: var(--fg-on-inverse, #E7EEEB);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 16px; gap: 6px;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.mark {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-700));
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-primary);
}
.brand-lockup .bt { line-height: 1.1; }
.brand-lockup .bt strong { color: #fff; font-weight: 800; font-size: 15px; display: block; }
.brand-lockup .bt span {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal-300);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-md);
  color: #AEBCB6; font-weight: 500; font-size: 14px; transition: background var(--dur), color var(--dur);
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(59,130,196,.16); color: var(--teal-300); }
.nav a svg { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.nav .badge-count {
  margin-left: auto; background: var(--teal-500); color: #fff; font-size: 11px;
  font-weight: 700; min-width: 19px; height: 19px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 5px;
}
.side-status {
  margin-top: auto; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-md); padding: 12px 13px; font-size: 12px; color: #AEBCB6;
}
.side-status .dot { color: var(--teal-400); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 13px 36px; background: rgba(248,250,249,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-200);
}
.topbar form.search { flex: 1; max-width: 460px; position: relative; display: flex; }
.topbar form.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-400); }
.topbar form.search input {
  width: 100%; padding: 9px 14px 9px 38px; border: 1px solid var(--ink-200); background: var(--white);
  border-radius: var(--radius-pill); font: inherit; font-size: 13.5px;
}
.topbar form.search input:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(59,130,196,.18); }
.topbar .tb-meta { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-500); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--teal-600); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.content { padding: 30px 36px 70px; max-width: 1180px; width: 100%; }

/* ---------- typography blocks ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1, h1.page { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 30px 0 14px; }
.section-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.cols { display: flex; gap: 18px; flex-wrap: wrap; }
.cols > .card { flex: 1; min-width: 300px; }

/* ---------- buttons ---------- */
button, .btn { cursor: pointer; font: inherit; }
.btn, button.primary, button.small, .btn-clear {
  display: inline-flex; align-items: center; gap: 7px; border-radius: var(--radius-pill);
  font-weight: 600; border: 1px solid transparent; transition: all var(--dur) var(--ease-out);
  text-decoration: none;
}
button.primary, .btn-primary {
  background: var(--teal-500); color: #fff; padding: 10px 18px; font-size: 14px;
  box-shadow: var(--shadow-primary);
}
button.primary:hover, .btn-primary:hover { background: var(--teal-600); text-decoration: none; }
button.small, .btn-ghost {
  background: var(--white); color: var(--ink-700); border-color: var(--ink-200);
  padding: 7px 13px; font-size: 13px;
}
button.small:hover, .btn-ghost:hover { border-color: var(--ink-250); background: var(--ink-50); }
button.danger, .btn.danger { color: var(--error); border-color: var(--error-bg); background: var(--white); }
button.danger:hover { background: var(--error-bg); }
button.link { background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
.btn-clear { color: var(--ink-500); padding: 7px 10px; }
form.inline { display: inline; margin: 0; }
.actionbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------- pills / chips / badges ---------- */
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--ink-200); background: var(--white); color: var(--ink-700);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all var(--dur);
}
.pill:hover { border-color: var(--ink-250); text-decoration: none; }
.pill svg { width: 15px; height: 15px; }
.pill.on-dark.active { background: var(--ink-950); color: #fff; border-color: var(--ink-950); }
.pill.on-teal.active { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-300); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  padding: 2px 9px; border-radius: var(--radius-pill); border: 1px solid var(--ink-200);
  background: var(--ink-100); color: var(--ink-600);
}
.tag.prio { background: var(--teal-50); border-color: var(--teal-200); color: var(--teal-700); }
.tag-area { background: var(--teal-50); border-color: var(--teal-200); color: var(--teal-700); }
.tag-cat { background: var(--info-bg); border-color: #c7ddf0; color: var(--info); }
.tag-board { font-weight: 600; }

.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 5px; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.err { background: var(--error-bg); color: var(--error); }
.badge.warn { background: var(--warning-bg); color: var(--warning); }
.badge.muted-badge { background: var(--ink-100); color: var(--ink-500); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* deadline pill */
.deadline { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); }
.deadline.d-ok { background: var(--teal-50); color: var(--teal-700); }
.deadline.d-warn { background: var(--warning-bg); color: var(--warning); }
.deadline.d-urgent { background: var(--error-bg); color: var(--error); }
.deadline.d-gone { background: var(--ink-100); color: var(--ink-500); }

/* ---------- flash ---------- */
.flash {
  background: var(--success-bg); border: 1px solid #b7e3cb; color: var(--teal-800);
  padding: 11px 15px; border-radius: var(--radius-md); margin-bottom: 18px; font-size: 13.5px;
}
.flash.error { background: var(--error-bg); border-color: #f1c7c3; color: #9a2e27; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--ink-150); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-400); }
tbody tr:hover { background: var(--ink-50); }
tbody tr:last-child td { border-bottom: 0; }
tr.row-priority { background: rgba(59,130,196,.05); }

/* ---------- forms ---------- */
label { display: block; margin-bottom: 13px; font-size: 13.5px; color: var(--ink-700); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=date], input[type=time], select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 12px; font: inherit; font-size: 14px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-md); background: var(--white); color: var(--ink-900);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(59,130,196,.16); }
label.chk { display: flex; align-items: center; gap: 9px; }
label.chk input { width: auto; margin: 0; }
.grid-form { max-width: 480px; }
.login-card { max-width: 400px; margin: 9vh auto 0; }

/* ---------- dashboard hero + stats ---------- */
.hero {
  border-radius: var(--radius-xl); padding: 34px 36px; color: #EAF3EF; margin-bottom: 22px;
  background:
    radial-gradient(120% 120% at 85% 10%, rgba(59,130,196,.28), transparent 55%),
    linear-gradient(135deg, var(--teal-900), var(--ink-950) 72%);
  position: relative; overflow: hidden;
}
.hero .eyebrow { color: var(--teal-300); }
.hero h1 { color: #fff; font-size: 31px; font-weight: 800; letter-spacing: -.02em; line-height: 1.18; margin: 12px 0 8px; max-width: 30ch; }
.hero h1 .hl { color: var(--teal-300); }
.hero p { color: #B9CCC4; max-width: 56ch; margin: 0; }
.herostats { display: flex; gap: 26px; margin-top: 24px; flex-wrap: wrap; }
.herostat { display: flex; align-items: center; gap: 12px; }
.herostat .ic { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: var(--teal-300); }
.herostat .n { font-size: 24px; font-weight: 800; color: #fff; line-height: 1; }
.herostat .l { font-size: 12px; color: #9FB3AB; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  padding: 16px 18px; color: var(--ink-500); font-size: 13px; text-decoration: none;
  display: flex; flex-direction: column; gap: 3px; transition: all var(--dur) var(--ease-out);
}
.stat:hover { text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--ink-250); }
.stat .num { font-size: 26px; font-weight: 800; color: var(--ink-900); letter-spacing: -.01em; }
.stat.priority .num { color: var(--teal-600); }

/* doc cards grid (attention) */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.doccard {
  background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius-lg);
  padding: 16px 17px; display: flex; flex-direction: column; gap: 9px; transition: all var(--dur) var(--ease-out);
}
.doccard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--ink-250); text-decoration: none; }
.doccard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.doccard .title { font-weight: 600; color: var(--ink-900); font-size: 14.5px; line-height: 1.35; }
.doccard .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* notice list (compact) */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { padding: 11px 0; border-bottom: 1px solid var(--ink-150); }
.notice-list li:last-child { border-bottom: 0; }
.tagline { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

/* ---------- filterbar ---------- */
.filterbar .fb-row { display: flex; flex-wrap: wrap; gap: 13px; align-items: flex-end; }
.filterbar label { margin: 0; font-size: 12.5px; color: var(--ink-500); }
.filterbar input, .filterbar select { min-width: 130px; width: auto; }
.filterbar .chk { flex-direction: row; align-items: center; gap: 7px; padding-bottom: 9px; }
.filterbar .chk input { width: auto; }
.fb-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 1px; }

/* ---------- detail ---------- */
.backlink { font-family: var(--font-mono); font-size: 12px; color: var(--ink-500); }
.detail-head h1 { font-size: 27px; font-weight: 800; line-height: 1.18; letter-spacing: -.01em; margin: 10px 0; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
table.kv th { font-family: var(--font-sans); text-transform: none; letter-spacing: 0; color: var(--ink-500); font-weight: 500; width: 44%; vertical-align: top; }
table.kv td { font-weight: 600; color: var(--ink-900); }
.copyfield { display: flex; align-items: center; gap: 8px; }
.copyfield code { font-family: var(--font-mono); font-size: 12px; word-break: break-all; background: var(--ink-100); padding: 5px 9px; border-radius: var(--radius-md); flex: 1; }
.pdf-preview { width: 100%; height: 72vh; border: 1px solid var(--ink-200); border-radius: var(--radius-md); background: var(--ink-100); }
details.verify summary { cursor: pointer; font-weight: 700; color: var(--ink-900); display: flex; align-items: center; gap: 8px; }
details.verify summary::-webkit-details-marker { display: none; }

/* lifecycle timeline */
.lifecycle { display: flex; align-items: flex-start; gap: 0; margin: 6px 0; }
.lc-node { flex: 1; text-align: center; position: relative; }
.lc-node .dot { width: 16px; height: 16px; border-radius: 50%; margin: 0 auto 8px; background: var(--white); border: 2px solid var(--ink-300); position: relative; z-index: 2; }
.lc-node.done .dot { border-color: var(--teal-500); background: var(--teal-100); }
.lc-node.current .dot { background: var(--teal-500); border-color: var(--teal-500); box-shadow: 0 0 0 4px rgba(59,130,196,.18); }
.lc-node:not(:last-child)::after { content: ""; position: absolute; top: 7px; left: 50%; width: 100%; height: 2px; background: var(--ink-200); z-index: 1; }
.lc-node.done:not(:last-child)::after { background: var(--teal-300); }
.lc-node .lab { font-size: 12px; font-weight: 600; color: var(--ink-700); }
.lc-node .sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); }

/* audit timeline */
.audit { list-style: none; margin: 0; padding: 0; }
.audit li { display: flex; gap: 12px; padding: 8px 0; }
.audit .when { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); white-space: nowrap; min-width: 112px; }
.ev { font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-md); background: var(--ink-100); color: var(--ink-600); white-space: nowrap; }
.ev-discovered { background: var(--info-bg); color: var(--info); }
.ev-downloaded { background: var(--success-bg); color: var(--success); }
.ev-download_failed, .ev-disappeared { background: var(--error-bg); color: var(--error); }
.ev-classified, .ev-matched_watch, .ev-priority_set { background: var(--teal-50); color: var(--teal-700); }
.ev-removal_date_changed, .ev-reappeared { background: var(--warning-bg); color: var(--warning); }

/* attachments */
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ink-150); }
.att-list li:last-child { border-bottom: 0; }
.att-list .ic { color: var(--ink-400); }
.att-list .nm { flex: 1; min-width: 0; word-break: break-word; }
.att-list .sz { font-family: var(--font-mono); font-size: 11px; color: var(--ink-400); white-space: nowrap; }

/* ---------- admin rows (classifiers / boards / users) ---------- */
.row-edit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--ink-150); }
.row-edit:last-child { border-bottom: 0; }
.row-edit form { display: flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; }
.row-edit input, .row-edit select { margin: 0; }
.row-id { min-width: 180px; flex: 1; }
.row-id strong { color: var(--ink-900); }

@media (max-width: 880px) {
  .sidebar { display: none; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
  .lifecycle { flex-wrap: wrap; gap: 12px; }
  .lc-node { flex-basis: 45%; }
  .lc-node::after { display: none; }
}
