/* Knižní CRM — základní styl */
* { box-sizing: border-box; }
:root {
  --bg: #f5f6f8; --card: #fff; --border: #dcdfe4; --text: #1f2430;
  --muted: #6b7280; --primary: #2f5fd0; --primary-dark: #244aa3;
  --ok: #16803c; --err: #b42318;
}
body { margin: 0; font: 14px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* Pravý panel úkolu (~30 %) */
.layout.has-drawer { display: grid; grid-template-columns: 1fr 30%; }
.layout.has-drawer main { max-width: none; min-width: 0; }
#task-drawer { border-left: 1px solid var(--border); background: var(--card); padding: 18px 20px; min-height: calc(100vh - 52px); position: sticky; top: 0; }
.td-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.td-close { font-size: 22px; color: var(--muted); line-height: 1; }
.td-close:hover { color: var(--err); text-decoration: none; }
.td-meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.td-body { background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.td-done { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-bottom: 14px; cursor: pointer; }
.td-done input { width: 18px; height: 18px; }
.td-reply textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; margin-bottom: 6px; }
.task-focus { background: #fff7d6; border-radius: 8px; outline: 2px solid #f2c94c; }
@media (max-width: 900px) { .layout.has-drawer { grid-template-columns: 1fr; } #task-drawer { position: static; min-height: 0; border-left: 0; border-top: 1px solid var(--border); } }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 14px; background: #1c2434; color: #fff; padding: 0 20px; height: 52px; }
.topbar .brand { color: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; display: inline-flex; align-items: center; }
.brand-logo { height: 30px; width: auto; display: block; background: #fff; padding: 3px 6px; border-radius: 6px; }
.topbar nav { display: flex; gap: 2px; align-items: center; }
.topbar nav > a, .topbar .dropdown-toggle { color: #cbd5e1; padding: 6px 10px; border-radius: 6px; white-space: nowrap; display: inline-block; }
.topbar nav > a:hover, .topbar .dropdown-toggle:hover { background: #2b3548; color: #fff; text-decoration: none; }
.topbar .dropdown { display: inline-flex; align-items: center; align-self: stretch; }
.topbar .dropdown-menu { top: 100%; left: auto; }
.topbar .user { display: flex; align-items: center; gap: 10px; color: #cbd5e1; white-space: nowrap; }

/* Rychlé zkratky (4 sloty) */
.shortcuts { display: flex; align-items: center; gap: 3px; padding-right: 10px; border-right: 1px solid #2b3548; }
.shortcut { display: inline-flex; align-items: center; background: #2b3548; border-radius: 6px; }
.shortcut > a { color: #e2e8f0; padding: 5px 4px 5px 10px; font-size: 12.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut > a:hover { text-decoration: none; color: #fff; }
.shortcut-edit { background: none; border: 0; color: #64748b; cursor: pointer; padding: 5px 6px; display: inline-flex; align-items: center; }
.shortcut-edit:hover { color: #fff; }
.shortcut-add { border: 1px dashed #3d4a63; border-radius: 6px; padding: 5px 7px; }

/* Obálka knihy */
.cover-wrap { float: left; margin: 0 18px 12px 0; }
.cover-box { position: relative; width: 150px; min-height: 210px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cover-box img { width: 100%; height: auto; display: block; }
.cover-empty { border-style: dashed; }
.cover-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #b6bfce; padding: 30px 10px; }
.cover-plus { font-size: 26px; line-height: 1; color: var(--primary); font-weight: 700; }
.cover-edit { position: absolute; right: 6px; top: 6px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 4px 6px; color: var(--muted); display: none; }
.cover-box:hover .cover-edit { display: block; }
.cover-broken { padding: 30px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.zakladni-fields { overflow: hidden; }
#cover-dialog { border: 1px solid var(--border); border-radius: 12px; padding: 22px; width: 480px; }
#cover-dialog::backdrop { background: rgba(0,0,0,.35); }
#cover-dialog input[type=text] { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; margin: 3px 0 10px; font: inherit; }
.cv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 300px; overflow-y: auto; }
.cv-item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; font: inherit; font-size: 11px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.cv-item:hover { border-color: var(--primary); background: #eef4ff; }
.cv-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 5px; }
.cv-noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 90px; background: var(--bg); border-radius: 5px; color: var(--muted); font-weight: 700; }

/* Jednoduchý WYSIWYG */
.wys-toolbar { display: flex; gap: 4px; margin-bottom: 4px; }
.wys-btn { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: 13px; }
.wys-btn:hover { background: var(--bg); }
.wys { min-height: 90px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.wys:focus { outline: 2px solid #bcd0f7; border-color: var(--primary); }
.wys[contenteditable=false], .wys:not([contenteditable]) { background: #f3f4f6; }
.wys h3 { margin: 6px 0 4px; font-size: 16px; }
.prolozene { letter-spacing: .18em; }

/* Panel poznámek */
.notes-panel .np-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; flex-wrap: wrap; }
.notes-panel textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
.notes-panel .np-row textarea { flex: 1; min-width: 220px; }
.np-note { border-bottom: 1px dashed var(--border); padding: 8px 0; }
.np-note-head { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.np-note-body { margin-top: 2px; }
.np-del { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.np-del:hover { color: var(--err); }
.np-task-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.np-task-row select, .np-task-row input { padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.np-task-row .np-task-title { flex: 1 1 220px; }

/* Feedback ucho */
#feedback-ear { position: fixed; right: 0; top: 50%; transform: rotate(-90deg) translateY(-100%); transform-origin: 100% 0;
  background: var(--primary); color: #fff; border: 0; border-radius: 8px 8px 0 0; padding: 7px 18px; font: inherit;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; cursor: pointer; z-index: 80; box-shadow: 0 -2px 10px rgba(0,0,0,.2); }
#feedback-ear:hover { background: var(--primary-dark); }
#feedback-dialog { border: 1px solid var(--border); border-radius: 12px; padding: 22px; width: 460px; }
#feedback-dialog::backdrop { background: rgba(0,0,0,.35); }
#feedback-dialog label { display: block; font-size: 13px; margin-bottom: 8px; }
#feedback-dialog textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; margin-top: 4px; }
.fb-diag summary { cursor: pointer; font-size: 12.5px; }
.fb-diag pre { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 11px; overflow-x: auto; max-height: 140px; }

/* Badge v menu */
.nav-badge { display: inline-block; background: #4c6fbf; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 6px; margin-left: 5px; vertical-align: 1px; }
.nav-badge-alert { background: #e11d48; }
.nav-dot { display: inline-block; width: 7px; height: 7px; background: #e11d48; border-radius: 50%; margin-left: 4px; vertical-align: 6px; }
.dropdown-menu .nav-badge { float: right; margin-left: 10px; }
.bell-overdue { background: #fef2f2; }

/* Zvoneček — notifikace */
.bell { position: relative; }
.bell-btn { position: relative; background: none; border: 0; color: #cbd5e1; cursor: pointer; padding: 8px; border-radius: 8px; display: inline-flex; }
.bell-btn:hover { background: #2b3548; color: #fff; }
.bell-badge { position: absolute; top: 1px; right: 0; background: #e11d48; color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; line-height: 1.3; }
.bell-menu { right: 0; left: auto; min-width: 320px; max-width: 380px; }
.bell-item { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.bell-item:hover { background: var(--bg); text-decoration: none; }
.bell-unread { background: #eef4ff; }
.bell-kind { display: inline-block; font-size: 10px; text-transform: uppercase; font-weight: 700; color: #fff; background: #64748b; border-radius: 8px; padding: 1px 7px; margin-right: 6px; }
.bell-item .bell-subject { font-weight: 600; }
.bell-item .muted { display: block; font-size: 12px; }
.bell-empty { padding: 12px; display: block; font-size: 13px; }
.bell-all { display: block; text-align: center; padding: 8px; border-top: 1px solid var(--border); margin-top: 4px; font-size: 13px; }

/* Globální vyhledávání */
.global-search { position: relative; flex: 1; max-width: 380px; margin-left: auto; }
.global-search input { width: 100%; padding: 7px 12px; border: 1px solid #3d4a63; border-radius: 8px; background: #2b3548; color: #fff; font: inherit; font-size: 13px; }
.global-search input::placeholder { color: #7c8aa5; }
.global-search input:focus { outline: 2px solid #4c6fbf; background: #313d54; }
.gs-results { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 340px; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.25); max-height: 70vh; overflow-y: auto; z-index: 90; }
.gs-results.open { display: block; }
.gs-group { padding: 8px 12px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.gs-item { display: block; padding: 7px 12px; color: var(--text); }
.gs-item:hover, .gs-item.active { background: #eef4ff; text-decoration: none; }
.gs-item .gs-sub { display: block; font-size: 12px; color: var(--muted); }
.gs-empty { padding: 14px; color: var(--muted); font-size: 13px; }
button.link { background: none; border: 0; color: #93b4f5; cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 220px; padding: 6px; }
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: flex; flex-direction: column; }
.dropdown-menu a, .dropdown-menu label { padding: 7px 10px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.dropdown-menu a:hover { background: var(--bg); text-decoration: none; }

/* Page head */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head select, .page-head input[type=text], .page-head input[type=search],
.actions select, .actions input[type=text] { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font: inherit; }
.muted { color: var(--muted); font-weight: 400; }

/* Buttons */
.btn { display: inline-block; background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 7px 14px; cursor: pointer; font: inherit; color: var(--text); }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
.btn.danger { color: var(--err); border-color: #ecc; }
.btn:disabled { opacity: .5; cursor: default; }

/* Tabulky */
.table-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tbl-filter { flex: 0 1 260px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; }
.tbl-count { color: var(--muted); margin-left: auto; }
.tbl-pagesize { padding: 6px; border: 1px solid var(--border); border-radius: 7px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
table.admin-table { border-collapse: collapse; width: 100%; }
table.admin-table th, table.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; min-width: 60px; }
table.admin-table th { background: #f0f2f5; position: sticky; top: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em; }
table.admin-table th.sortable { cursor: pointer; user-select: none; }
table.admin-table tbody tr:hover { background: #f8fafc; }
.table-pager { display: flex; align-items: center; gap: 12px; margin-top: 10px; justify-content: center; }
.cols-menu { max-height: 420px; overflow-y: auto; min-width: 260px; }
.cols-menu label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.cols-menu label:hover { background: var(--bg); }
.col-row .col-name { flex: 1; }
.col-row .col-name small { color: var(--muted); }
.col-move { display: none; gap: 2px; }
.col-row:hover .col-move { display: inline-flex; }
.col-move button { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; cursor: pointer; padding: 0 6px; font-size: 12px; }
.col-move button:hover { background: #e4e9f2; }
.col-group { padding: 8px 10px 2px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; }

table.plain { border-collapse: collapse; width: 100%; }
table.plain th, table.plain td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
table.plain th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

/* Ikony */
.icon { vertical-align: -2px; }
.btn .icon { margin-right: 4px; vertical-align: -3px; }
.icon.ok { color: var(--ok); }

/* Taby (detail knihy) */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 0; border-bottom: 2px solid var(--border); }
.tabs .tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 16px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -2px; }
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; background: var(--card); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px; padding: 18px 20px; margin-bottom: 18px; }
.tab-panel.active { display: block; }
.panel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; min-height: 18px; }
.badge { background: #fef3c7; color: #92400e; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 600; }

/* Hromadná editace */
/* Kontextová nápověda — otazníček u nadpisů karet */
.help-wrap { position: relative; display: inline-flex; vertical-align: middle; margin-left: 7px; }
.help-dot { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--card); color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.help-dot:hover, .help-dot[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.help-pop { position: absolute; top: calc(100% + 8px); left: -10px; z-index: 70; width: 340px; max-width: calc(100vw - 40px);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 15px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .14); font-size: 13px; font-weight: 400; line-height: 1.55;
  color: var(--text); text-align: left; text-transform: none; letter-spacing: normal; white-space: normal; }
.help-pop ul { margin: 6px 0 0; padding-left: 17px; }
.help-pop li { margin-bottom: 4px; }
.help-pop b { display: block; margin-bottom: 3px; }
legend .help-wrap, h1 .help-wrap { font-size: 0; }
legend .help-pop, h1 .help-pop { font-size: 13px; }

/* Plovoucí lišta hromadných akcí (objeví se při výběru řádků) */
.bulk-float { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(100vw - 32px);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 10px 8px 14px; box-shadow: 0 10px 30px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .08);
  animation: bulk-in .18s ease-out; }
@keyframes bulk-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .bulk-float { animation: none; } }
.bulk-count { background: var(--primary); color: #fff; font-weight: 700; font-size: 12.5px;
  min-width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; }
.bulk-label { font-size: 13px; color: var(--muted); }
.bulk-sep { width: 1px; height: 22px; background: var(--border); }
.bulk-float select, .bulk-float input { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; font: inherit; font-size: 13px; background: var(--bg); }
.bulk-float .btn { border-radius: 999px; }
.bulk-clear { border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--muted);
  width: 28px; height: 28px; border-radius: 50%; }
.bulk-clear:hover { background: var(--bg); color: var(--text); }
/* Checkbox výběru řádku */
.sel-col input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.row-selected td { background: #eef4ff; }

/* Řádek filtrů per sloupec */
tr.filter-row th { background: #fafbfc; padding: 4px 6px; }
tr.filter-row input, tr.filter-row select { width: 100%; min-width: 70px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; }
.sel-col { width: 34px; text-align: center; }
.sel-col input { width: 16px; height: 16px; }
tr.row-selected td { background: #eef4ff; }

/* Detail — sekce a pole */
fieldset.section { background: var(--card); border: 1px solid var(--border); border-radius: 10px; margin: 0 0 18px; padding: 16px 18px; }
fieldset.section legend { font-weight: 700; padding: 0 8px; font-size: 15px; }
fieldset.section legend small { margin-left: 8px; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 18px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.field-settings { color: #b6bfce; vertical-align: -1px; }
.field-settings:hover { color: var(--primary); }
.field input[type=text], .field input[type=number], .field input[type=date], .field input[type=email],
.field select, .field textarea { padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; width: 100%; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bcd0f7; border-color: var(--primary); }
.field .readonly { padding: 7px 9px; background: #f3f4f6; border-radius: 7px; min-height: 34px; color: #374151; }
.field input[type=checkbox] { width: 18px; height: 18px; margin-top: 8px; }
.multiselect { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 6px; }
.ms-item { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.ms-item input { width: 15px; height: 15px; margin: 0; }

/* Autocomplete */
.ac-wrap { position: relative; display: block; }
.ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 40; display: flex; flex-direction: column; background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.ac-list:empty { display: none; }
.ac-item { text-align: left; padding: 8px 10px; background: none; border: 0; border-bottom: 1px solid var(--bg); cursor: pointer; font: inherit; }
.ac-item:hover { background: var(--bg); }

/* Save bar */
.save-bar { position: sticky; bottom: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
#save-status { color: var(--muted); }

/* Flash */
#flash { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.flash { padding: 10px 16px; border-radius: 8px; color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.2); animation: fadein .2s; }
.flash.ok { background: var(--ok); }
.flash.err { background: var(--err); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #1c2434; }
.login-box { background: #fff; border-radius: 14px; padding: 36px 40px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { margin: 0 0 20px; font-size: 20px; text-align: center; }
.login-box label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.login-box input { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font: inherit; margin-top: 4px; }
.login-box button { width: 100%; padding: 10px; margin-top: 6px; }
.login-box .error { background: #fee2e2; color: var(--err); padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.login-box .notice-ok { background: #dcfce7; color: #166534; padding: 9px 12px; border-radius: 8px; font-size: 13px; }

/* Chybová stránka */
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 64px; margin: 0; color: var(--muted); }

/* Matice oprávnění */
.perm-matrix td select { padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); font-size: 12.5px; }
.perm-matrix .sec-row { background: #eef1f6; font-weight: 700; }
.perm-matrix td, .perm-matrix th { padding: 4px 8px; }

@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  main { padding: 12px; }
  .grid { grid-template-columns: 1fr; }
}
