@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --ink: #141A23;
  --muted: #5A6472;
  --quiet: #47505C;
  --ground: #F4F5F7;
  --surface: #fff;
  --line: #E2E5EA;
  --line-soft: #EEF0F3;
  --field: #CBD2DB;
  --accent: #0B6E5C;
  --accent-dark: #07503F;
  --accent-tint: #F1F7F5;
  --accent-line: #CFE6DF;
  --side: #101820;
  --danger: #A3261B;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); background: var(--ground); font-size: 15px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { margin: 0; font-size: 24px; font-weight: 600; }
h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sr { position: absolute; left: -9999px; }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.small { font-size: 12px; color: var(--muted); }
.sub { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* Rozvržení */
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 220px; max-width: 100%; background: var(--side); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 900px) { .side { flex: 0 0 240px; position: sticky; top: 0; height: 100vh; } }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; padding: 4px 8px 20px; text-decoration: none; }
.brand:hover { color: #fff; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; }
.nav { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; border-radius: 8px; color: #C9D1D9; text-decoration: none; font-size: 14px; }
.nav:hover { background: #1B2631; color: #fff; }
.nav.on { background: #22313F; color: #fff; font-weight: 500; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8D99A6; padding: 18px 12px 6px; }
.me { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid #22313F; display: flex; flex-direction: column; gap: 2px; }
.me strong { color: #fff; font-size: 14px; font-weight: 500; }
.me span { color: #8D99A6; font-size: 12px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: #8FD3C2; cursor: pointer; text-decoration: underline; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) { .main { padding: 20px 16px; } }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Karty, tabulky */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sel td { background: var(--accent-tint); }
.tbl .strong { font-weight: 500; text-decoration: none; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* Formuláře a tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #9AA5B3; color: var(--ink); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { background: var(--accent-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.input:focus, .btn:focus-visible, .nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toolbar .input { width: auto; }
.lbl { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.check { width: 20px; height: 20px; accent-color: var(--accent); }
form.inline { display: inline; }
.callout { background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: #24413A; overflow-wrap: anywhere; }

/* Stavy */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.ok { background: #E3F4EC; color: #11603F; }
.err { background: #FCE8E6; color: var(--danger); }
.run { background: #E6EEFB; color: #1F4E9C; }
.wait { background: #FFF3DC; color: #7A4A00; }
.muted { background: var(--line-soft); color: var(--quiet); }
.adm { background: #EDE7FB; color: #4B2A9A; }
.flash { border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.flash.ok { border: 1px solid #BFE3CF; }
.flash.error { background: #FCE8E6; color: var(--danger); border: 1px solid #F3C4BE; }

/* Klient: exporty a termíny */
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid #D5DAE1; border-radius: 999px; font-size: 13px; background: #fff; }
.x { width: 28px; height: 28px; border: 0; border-radius: 999px; background: var(--line-soft); color: var(--quiet); cursor: pointer; font: inherit; font-size: 14px; }
.x:hover { background: #E2E5EA; }
.export { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.export.on { border-color: var(--accent-line); }
.export.off { background: #FAFBFC; }
.export-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.export-head .push { margin-left: auto; }
.sched { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #FAFBFC; font-size: 14px; }
.sched .push { margin-left: auto; }
.sched-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px; border: 1px dashed #9FB7B0; border-radius: 8px; }
.sched-form > div { flex: 0 1 140px; }
.sched-form > div.wide { flex: 1 1 200px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Uživatelé */
.av { width: 36px; height: 36px; border-radius: 999px; background: #DCEBE6; color: #0B4F42; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.who { display: flex; align-items: center; gap: 12px; }
.role { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid #D5DAE1; border-radius: 10px; cursor: pointer; }
.role:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-tint); padding: 15px; }
.role ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--quiet); line-height: 1.6; }
.cl { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.cl:last-child { border-bottom: 0; }
.cl .small { margin-left: auto; }
.list-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-height: 480px; overflow-y: auto; }

/* Fronta */
.stat { flex: 1 1 180px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat strong { font-size: 20px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
pre.cmd { margin: 0; padding: 14px; border-radius: 8px; background: var(--side); color: #D8E1E8; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
pre.cmd b { color: #8FD3C2; font-weight: 400; }

/* Přihlášení */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-side { flex: 1 1 420px; background: var(--side); color: #E6EAEE; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.login-side h2 { font-size: 34px; line-height: 1.15; margin: 0 0 16px; }
.login-side p { margin: 0; color: #AEB8C4; line-height: 1.6; }
.login-main { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.login-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) { .login-side { padding: 32px 24px; } .login-side h2 { font-size: 26px; } }
