/* Pracovní návrh využívá existující paletu a font Panzon. */
@font-face { font-family: AlbertSans; src: url(/assets/albert-sans.ttf) format(truetype); font-weight: 100 900; font-display: swap; }
:root {
  --c-bg: #FCFBF8;
  --c-surface: #ffffff;
  --c-text: #081D35;
  --c-muted: #556274;
  --c-border: #E5EFFB;
  --c-primary: #1D5DA5;
  --c-primary-hover: #081D35;
  --c-primary-contrast: #ffffff;
  --c-focus: #f59e0b;
  --c-danger: #b42318;
  --c-danger-bg: #fdecea;
  --c-ok-bg: #e7f5ec;
  --c-ok: #136c34;
  --c-warn-bg: #fff4d6;
  --c-warn: #7a4b00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  font-family: AlbertSans, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.5;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
a { color: var(--c-primary); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--c-surface); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: .5rem; top: .5rem; }

/* Hlavička */
.topbar { background: var(--c-primary); color: var(--c-primary-contrast); }
.topbar__inner { max-width: 1200px; margin: 0 auto; padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.15rem; color: inherit; text-decoration: none; letter-spacing: .2px; display: flex; align-items: center; gap: .5rem; }
.brand__mark { width: 28px; height: 28px; border-radius: 7px; background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: .9rem; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button { color: inherit; text-decoration: none; background: none; border: 0; font: inherit; padding: .45rem .7rem; border-radius: 6px; cursor: pointer; }
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.12); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.2); }
.nav__user { opacity: .85; font-size: .9rem; padding: 0 .5rem; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.lead { color: var(--c-muted); margin: 0 0 1.5rem; }
footer { color: var(--c-muted); font-size: .85rem; text-align: center; padding: 1rem; }

/* Tlačítka a formuláře */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn--primary { background: var(--c-primary); color: var(--c-primary-contrast); }
.btn--primary:hover { background: var(--c-primary-hover); }
.btn--secondary { background: var(--c-surface); color: var(--c-primary); border-color: var(--c-border); }
.btn--secondary:hover { background: #eef2f7; }
.btn--danger { background: var(--c-surface); color: var(--c-danger); border-color: #f1b8b2; }
.btn--danger:hover { background: var(--c-danger-bg); }
.btn--small { min-height: 36px; padding: .35rem .7rem; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.field input[type=text], .field input[type=password], .field input[type=url], .field input[type=number], .field select, .field textarea {
  font: inherit; padding: .6rem .7rem; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; min-height: 44px; width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { color: var(--c-muted); font-size: .85rem; }
.field .field-error { color: var(--c-danger); font-size: .85rem; }
fieldset.field { border: 1px solid var(--c-border); border-radius: 8px; padding: .75rem; }
.check { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; font-weight: 400 !important; }
.check input { width: 20px; height: 20px; }
.checklist { max-height: 220px; overflow: auto; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert--error { background: var(--c-danger-bg); color: var(--c-danger); border-color: #f5c2bc; }
.alert--ok { background: var(--c-ok-bg); color: var(--c-ok); border-color: #b9e2c7; }
.alert--warn { background: var(--c-warn-bg); color: var(--c-warn); border-color: #f0d68f; }

/* Přihlášení */
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 1.5rem 1rem; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { text-align: center; }
.auth-card .lead { text-align: center; }
.auth-card .btn { width: 100%; }

/* Dlaždice */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 0; }
.tile { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.tile__head { display: flex; gap: .75rem; align-items: center; }
.tile__icon { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #e8eef6; color: var(--c-primary); display: grid; place-items: center; }
.tile__icon svg { width: 24px; height: 24px; }
.tile__name { font-size: 1.1rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.tile__desc { color: var(--c-muted); margin: 0; flex: 1; overflow-wrap: anywhere; }
.tile__url { font-size: .8rem; color: var(--c-muted); overflow-wrap: anywhere; margin: 0; }
.tile .btn { align-self: flex-start; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; padding: .15rem .45rem; border-radius: 4px; }
.badge--test { background: var(--c-warn-bg); color: var(--c-warn); border: 1px solid #f0d68f; }
.badge--off { background: #eceff3; color: var(--c-muted); }
.badge--admin { background: #e3e9f6; color: var(--c-primary); }

.state { text-align: center; padding: 2.5rem 1rem; background: var(--c-surface); border: 1px dashed var(--c-border); border-radius: var(--radius); }
.state h2 { margin-bottom: .4rem; }
.state p { color: var(--c-muted); margin: 0 0 1rem; }
.note { font-size: .85rem; color: var(--c-muted); margin-top: 1.5rem; }

/* Administrace */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--c-border); margin-bottom: 1.25rem; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; font-weight: 600; padding: .6rem 1rem; cursor: pointer; color: var(--c-muted); min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.row { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: .9rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.row__main { flex: 1 1 280px; min-width: 0; }
.row__title { font-weight: 700; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.row__meta { color: var(--c-muted); font-size: .88rem; overflow-wrap: anywhere; }
.row__actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.row--off { opacity: .75; }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(15, 23, 42, .5); }
.dialog__body { padding: 1.25rem; overflow: auto; }
.dialog__actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; padding-top: .5rem; }

@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
  .topbar__inner { padding: .6rem .75rem; }
  .nav { margin-left: 0; width: 100%; }
  .nav__user { width: 100%; padding: 0 .7rem; }
  main { padding: 1rem .75rem 2rem; }
  .tiles { grid-template-columns: 1fr; }
  .row__actions { width: 100%; }
  .row__actions .btn { flex: 1; }
}
.narrow { max-width: 520px; }

.brand__logo { width: 30px; height: 24px; object-fit: contain; }

.tile__controls { display: flex; gap: .4rem; flex-wrap: wrap; }
.tile__status { color: var(--c-muted); font-size: .85rem; margin: 0; }
