/* Schvalovačka faktur — moderní, čistý vzhled (2026). Minimalistický, modrofialová
   identita, jemné vrstvené stíny, vzdušné rozestupy. Externí soubor kvůli přísnému CSP.
   Třídy zůstávají stejné jako dřív (JS/HTML se nemění) — modernizován jen vizuál. */

:root {
  /* Značka */
  --accent: #5b5fc7;
  --accent-hover: #4a4eb8;
  --accent-press: #3f43a3;
  --accent-soft: #eef0fc;
  --accent-grad: linear-gradient(135deg, #6a6ee0 0%, #5b5fc7 100%);

  /* Plochy a text */
  --bg: #f3f4f8;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #eef0f8 0%, #f3f4f8 60%);
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e9e9ef;
  --border-input: #d8d9e2;
  --text: #1b1b22;
  --text-muted: #6a6b78;

  /* Stavy */
  --green: #157a3b; --green-bg: #e7f6ec;
  --red: #c4314b;   --red-bg: #fdeef0;
  --amber: #8a5a00; --amber-bg: #fbf2dc;

  /* Tvar a hloubka */
  --radius: 16px; --radius-md: 11px; --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20,23,40,.05), 0 1px 3px rgba(20,23,40,.07);
  --shadow-md: 0 6px 18px rgba(20,23,40,.08);
  --shadow-lg: 0 14px 40px rgba(20,23,40,.13);
  --ring: 0 0 0 4px rgba(91,95,199,.18);
  --t: .16s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-grad) fixed, var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); }

/* Horní lišta — „skleněná", lepkavá, s jemným stínem místo tvrdé čáry */
header.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(20,23,40,.02), 0 6px 20px -12px rgba(20,23,40,.18);
  padding: 0 22px; height: 60px;
}
header.topbar strong {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em;
}
header.topbar strong::before {
  content: ""; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-grad); box-shadow: 0 2px 8px rgba(91,95,199,.45); flex: none;
}
header.topbar .who { color: var(--text-muted); margin-right: 12px; font-size: .92rem; }

main { max-width: 940px; margin: 30px auto 64px; padding: 0 18px; }
h1 { font-size: 1.7rem; font-weight: 700; letter-spacing: -.022em; margin: 0 0 6px; }
h2 { font-size: 1.12rem; font-weight: 650; letter-spacing: -.01em; margin: 0 0 16px; }

/* Karty — bez tvrdých rámečků, jemný vrstvený stín, větší vzduch */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px 28px; margin-bottom: 22px;
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--shadow-md); }
.center { max-width: 420px; margin: 9vh auto; padding: 0 18px; }
.center .card { padding: 32px; }
.center .card h1 { text-align: center; margin-bottom: 22px; }
.center .card h1::before {
  content: ""; display: block; width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 15px; background: var(--accent-grad);
  box-shadow: 0 8px 22px -6px rgba(91,95,199,.6);
}

/* Formuláře */
label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: .85rem; color: #41424e; }
input, select {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border-input); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
input::placeholder { color: #a3a4b2; }
input:hover, select:hover { border-color: #c3c4d2; }
input:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}

/* Tlačítka */
button {
  margin-top: 20px; padding: 11px 22px; border: 1px solid transparent;
  border-radius: var(--radius-md); background: var(--accent-grad); color: #fff;
  cursor: pointer; font: inherit; font-weight: 600; letter-spacing: .005em;
  box-shadow: 0 2px 8px -2px rgba(91,95,199,.55);
  transition: transform var(--t), box-shadow var(--t), background var(--t), opacity var(--t);
}
button:hover { box-shadow: 0 6px 18px -4px rgba(91,95,199,.6); transform: translateY(-1px); }
button:active { transform: translateY(0); box-shadow: 0 2px 6px -2px rgba(91,95,199,.5); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

button.secondary, button.ghost {
  background: var(--surface); color: var(--accent-hover);
  border-color: var(--border-input); box-shadow: none; margin-top: 0;
}
button.secondary:hover, button.ghost:hover {
  background: var(--accent-soft); border-color: #c6c8ee; transform: translateY(-1px);
}
button.small { margin-top: 0; padding: 7px 14px; font-size: .85rem; border-radius: var(--radius-sm); }

/* Tabulka — vzdušná, bez těžkých linek, jemné zvýraznění řádku */
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 8px; }
th, td { text-align: left; padding: 13px 14px; }
th {
  color: var(--text-muted); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600; border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid #f1f1f5; }
tbody tr { transition: background var(--t); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

/* Hlášky */
.msg { padding: 12px 15px; border-radius: var(--radius-md); margin-top: 16px; font-size: .9rem; font-weight: 500; }
.msg.err { background: var(--red-bg); color: var(--red); box-shadow: inset 0 0 0 1px #f3c9d0; }
.msg.ok  { background: var(--green-bg); color: var(--green); box-shadow: inset 0 0 0 1px #c2e6cd; }

/* Stavové štítky — jemné pilulky s tečkou */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ceka_na_schvaleni, .badge.nahrano { background: var(--amber-bg); color: var(--amber); }
.badge.schvaleno { background: var(--green-bg); color: var(--green); }
.badge.zamitnuto, .badge.finalne_zamitnuto { background: var(--red-bg); color: var(--red); }
.badge.znovu_v_obehu { background: var(--accent-soft); color: var(--accent-hover); }

/* Drobnosti */
.hidden { display: none !important; }
.muted { color: var(--text-muted); font-size: .9rem; }
a.dl { color: var(--accent-hover); font-weight: 600; text-decoration: none; }
a.dl:hover { text-decoration: underline; }
.codebox {
  font-family: "Cascadia Code", ui-monospace, Consolas, monospace; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin: 8px 0; word-break: break-all; font-size: .92rem;
}
.codelist { list-style: none; padding: 0; margin: 8px 0; }
.codelist li { font-family: "Cascadia Code", ui-monospace, Consolas, monospace; padding: 3px 0; letter-spacing: .05em; }
.pill-ok { color: var(--green); font-weight: 600; }

/* Navigace v liště — pilulky */
header.topbar nav.nav { display: flex; gap: 4px; }
header.topbar nav.nav a {
  color: var(--text-muted); text-decoration: none; padding: 7px 13px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  transition: background var(--t), color var(--t);
}
header.topbar nav.nav a:hover { background: var(--surface-2); color: var(--text); }
header.topbar nav.nav a.active { color: var(--accent-hover); background: var(--accent-soft); }

/* Akce v řádcích + inline panely */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form, .subpanel {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-top: 12px;
}
.checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.checks label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; }
.checks input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* --- 2FA --- */
.tf-status { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-radius: var(--radius-md); font-weight: 600; }
.tf-status.on { background: var(--green-bg); color: var(--green); }
.tf-status.off { background: var(--amber-bg); color: var(--amber); }
.tf-status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.tf-warn { background: var(--amber-bg); color: var(--amber); border-radius: var(--radius-md); padding: 15px 17px; margin-bottom: 16px; box-shadow: inset 0 0 0 1px #f0dcab; }
.tf-warn strong { display: block; margin-bottom: 3px; }
.tf-step { display: flex; align-items: center; gap: 11px; margin: 20px 0 9px; }
.tf-step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; flex: none; box-shadow: 0 3px 8px -2px rgba(91,95,199,.6); }
.tf-step .t { font-weight: 600; }
.secret-box {
  font-family: "Cascadia Code", ui-monospace, Consolas, monospace; font-size: 1.15rem; letter-spacing: 3px;
  background: var(--surface-2); border: 1px dashed var(--border-input); border-radius: var(--radius-md);
  padding: 17px; text-align: center; word-break: break-all; color: var(--text);
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-row button { margin-top: 0; }
.codes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 14px 0; }
.codes-grid span { font-family: "Cascadia Code", ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; text-align: center; letter-spacing: 1px; }
@media (max-width: 480px) { .codes-grid { grid-template-columns: 1fr; } }
.tf-hint { color: var(--text-muted); font-size: .9rem; margin: 4px 0 0; }
.copied { color: var(--green); font-size: .85rem; font-weight: 600; }
.qr-wrap { display: flex; justify-content: center; margin: 16px 0 8px; }
.qr-wrap img { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; background: #fff; box-shadow: var(--shadow-sm); }

/* --- Moderní formulář --- */
.form { max-width: 680px; }
.form .field { margin-bottom: 16px; }
.form .field label { margin: 0 0 6px; font-size: .85rem; }
.form .grid2 { gap: 0 18px; }
.form label .opt { color: var(--text-muted); font-weight: 400; font-size: .82em; }
.form button[type="submit"] { margin-top: 10px; padding: 12px 26px; }

/* Stylové pole pro nahrání souboru */
.filedrop {
  display: flex; align-items: center; gap: 13px; cursor: pointer; margin: 0;
  border: 1.5px dashed var(--border-input); border-radius: var(--radius-md);
  padding: 18px 20px; background: var(--surface-2); font-weight: 400;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.filedrop:hover { border-color: var(--accent); background: var(--accent-soft); }
.filedrop .fd-icon { font-size: 1.4rem; line-height: 1; }
.filedrop .fd-text { color: var(--text-muted); }
.filedrop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.filedrop.has-file .fd-text { color: var(--accent-hover); font-weight: 600; }
