﻿@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Condensed:wght@600;700&display=swap");

:root {
  --navy: #0a1a3a;
  --navy-2: #122a4d;
  --navy-3: #1a3d6e;
  --navy-accent: #1d6fd8;
  --line: #d4dde8;
  --line-soft: #e8eef5;
  --bg: #eef2f7;
  --bg-main: #f4f7fb;
  --card: #ffffff;
  --text: #152033;
  --muted: #64748b;
  --link: #0b4ea2;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --info: #0b4ea2; --zzs-red: #c8102e; --zzs-yellow: #f5c518;
  --header-h: 56px;
  --side-w: 248px;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 30, 55, 0.05), 0 4px 12px rgba(15, 30, 55, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 30, 55, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* —— Fixed shell: header + sidebar stay, main scrolls —— */
.app {
  min-height: 100vh;
  display: block;
}

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 0 14px;
  background: linear-gradient(180deg, #0c2456 0%, var(--navy) 70%, #1a0a12 100%); border-bottom: 3px solid var(--zzs-red, #c8102e);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 12px rgba(5, 15, 30, 0.25);
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 0; flex-shrink: 0; }
.logo {
  width: 42px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}
.brand-text { min-width: 0; }
.brand h1 {
  margin: 0;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: normal;
  max-width: 320px;
}
.brand p {
  margin: 1px 0 0;
  font-size: 11px;
  opacity: 0.72;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-search {
  display: flex;
  align-items: center;
  width: min(420px, 36vw);
  margin-left: auto;
  flex-shrink: 1;
}
.top-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 6px 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.top-search-box:focus-within {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(140, 190, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(42, 90, 154, 0.35);
}
.top-search-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.55);
}
.top-search-box:focus-within .top-search-ico { color: rgba(190, 220, 255, 0.95); }
.top-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 8px 0;
  font-size: 13px;
  outline: none;
  box-shadow: none;
}
.top-search input::placeholder { color: rgba(255, 255, 255, 0.48); }
.top-search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.6; }
.top-search-go {
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 12px;
  color: var(--navy);
  background: #fff;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.top-search-go:hover { filter: brightness(0.96); }
.top-search-go:active { transform: scale(0.98); }

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-bell {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.top-bell svg { width: 18px; height: 18px; display: block; }
.top-bell:hover,
.top-bell.on {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  text-decoration: none;
}
.top-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.who {
  position: relative;
  font-size: 12px;
  white-space: nowrap;
}
.who-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.who-toggle::-webkit-details-marker { display: none; }
.who-toggle:hover,
.who[open] .who-toggle {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}
.who-text { text-align: right; min-width: 0; }
.who-text strong { display: block; font-weight: 600; }
.who-text > span { display: block; opacity: 0.75; font-size: 11px; }
.who-caret {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.who[open] .who-caret { transform: rotate(180deg); }
.who-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  z-index: 50;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(5, 15, 30, 0.22);
}
.who-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.who-menu button:hover {
  background: #f1f5f9;
  color: var(--navy);
}

.side {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  z-index: 30;
  width: var(--side-w);
  background: var(--navy-2);
  color: #c5d4e6;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 4px 0 24px rgba(5, 15, 30, 0.12);
}

.side-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.side-label {
  padding: 16px 18px 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #7e93ab;
  font-weight: 700;
  text-transform: uppercase;
}

.side a {
  display: block;
  margin: 1px 10px;
  padding: 8px 12px;
  color: #c8d6e6;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.12s ease, color 0.12s ease;
}
.side a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}
.side a.on {
  background: rgba(42, 90, 154, 0.35);
  color: #fff;
  border-left-color: #6eb0ff;
  font-weight: 600;
}

.main {
  margin-left: var(--side-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  padding: 22px 28px 48px;
  background: var(--bg-main);
  overflow-x: hidden;
}

.main h2 {
  margin: 0 0 4px;
  font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.lead { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat b {
  display: block;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  margin-top: 4px;
}
.stat span { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: var(--bad); }

/* —— Dashboard —— */
.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.dash-lead { margin-bottom: 14px; }
.dash-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}
.dash-links a { color: var(--link); }
.dash-links a:hover { text-decoration: underline; }

.dash-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.dash-alert {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
}
.dash-alert:hover { filter: brightness(0.98); text-decoration: none; }

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.dash-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: inherit;
  min-height: 76px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.dash-kpi:hover {
  border-color: #b8c7d9;
  box-shadow: var(--shadow);
  text-decoration: none;
}
.dash-kpi-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}
.dash-kpi-val {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.02em;
}
.dash-kpi.is-hot {
  border-color: #f1b4b4;
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
}
.dash-kpi.is-hot .dash-kpi-val { color: var(--bad); }
.dash-kpi.is-warn {
  border-color: #f0d3a8;
  background: linear-gradient(180deg, #fff 0%, #fffaf3 100%);
}
.dash-kpi.is-warn .dash-kpi-val { color: var(--warn); }

.dash-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}
.dash-panel { margin-bottom: 0; }
.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--line-soft);
}
.dash-panel-head h3 {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.dash-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
  white-space: nowrap;
}
.dash-empty {
  margin: 0;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-list li + li { border-top: 1px solid var(--line-soft); }
.dash-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  color: inherit;
}
.dash-item:hover {
  background: #f8fafc;
  text-decoration: none;
}
.dash-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-item-main strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.dash-item-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-item-meta {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  max-width: 46%;
  line-height: 1.3;
}
.dash-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.dash-foot b { color: var(--text); }

@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dash-head { flex-direction: column; align-items: flex-start; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--navy-3);
  background: var(--navy-2);
  color: #fff;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.btn.sec {
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn.danger { background: #991b1b; border-color: #991b1b; }
.btn:hover { filter: brightness(1.08); text-decoration: none; box-shadow: var(--shadow-sm); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card h3 {
  margin: 0;
  padding: 11px 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.table th {
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tbody tr:hover td { background: #f8fafc; }
.table tr:nth-child(even) td { background: #fafbfc; }
.table tr:nth-child(even):hover td { background: #f3f6fa; }

.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
.kv th {
  width: 34%;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.pill.on_duty, .pill.available, .pill.ok, .pill.open, .pill.v_provozu, .pill.potvrzena_garantem, .pill.uzavrena_velitelem_zasahu {
  color: var(--ok); border-color: #bbf7d0; background: #f0fdf4;
}
.pill.off_duty, .pill.closed, .pill.archived, .pill.archivovana, .pill.archivovan, .pill.nesledovan, .pill.vyrazeno {
  color: var(--muted); background: #f1f5f9; border-color: #e2e8f0;
}
.pill.dispatched, .pill.off_station, .pill.trip, .pill.at_event, .pill.rozpracovana, .pill.pripravena_k_uzavreni, .pill.vracena_k_doplneni, .pill.ohledani, .pill.ceka_podklady, .pill.ceka_expertizu {
  color: #9a3412; border-color: #fed7aa; background: #fff7ed;
}
.pill.service, .pill.check, .pill.vacation, .pill.sick, .pill.training, .pill.v_oprave, .pill.na_kalibraci, .pill.na_overeni {
  color: var(--warn); background: #fffbeb; border-color: #fde68a;
}
.pill.oos, .pill.defect, .pill.bad, .pill.mimo_provoz {
  color: var(--bad); background: #fef2f2; border-color: #fecaca;
}
.pill.nove {
  color: #854d0e;
  background: #fef9c3;
  border-color: #fde047;
}
.pill.preciteno {
  color: #64748b;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.notif-card { overflow-x: auto; }
.notif-table td { vertical-align: middle; }
.notif-table tr.notif-new td {
  background: #f7f3df;
}
.notif-table tr.notif-new:hover td {
  background: #f1ebc8;
}
.notif-table tr.notif-read td {
  background: #fff;
}
.notif-table tr.notif-read:hover td {
  background: #f8fafc;
}
.notif-table tr:nth-child(even).notif-read td { background: #fafbfc; }
.notif-table tr:nth-child(even).notif-read:hover td { background: #f3f6fa; }
.notif-time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.notif-title { font-weight: 600; min-width: 160px; }
.notif-text {
  color: var(--muted);
  font-size: 13px;
  max-width: 420px;
}
.notif-actions {
  white-space: nowrap;
  text-align: right;
}
.notif-actions form { display: inline; }
.notif-btn {
  padding: 5px 10px;
  font-size: 12px;
  margin-left: 4px;
}

.from-game { display: none; }

.zoz-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.zoz-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.zoz-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.zoz-section-head {
  margin: 0;
  padding: 10px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.zoz-pad { padding: 16px; }
.zoz-times input { font-variant-numeric: tabular-nums; }
.zoz .actions { margin: 0 0 8px; }

.zoz-event {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px 28px;
}
.zoz-event-left,
.zoz-event-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.zoz-addr textarea {
  min-height: 120px;
}
.zoz-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.zoz-lookup {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.zoz-lookup input[type="text"],
.zoz-lookup input:not([type]) {
  flex: 1;
  min-width: 0;
}
.zoz-lookup .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.zoz-check-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  min-height: 38px;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
}
.zoz-check-label input {
  width: auto !important;
  margin: 0;
}
.zoz-split {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 14px;
  align-items: start;
}
.zoz-unit-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.zoz-times-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zoz-times-stack > div {
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) minmax(140px, 1fr);
  gap: 8px 12px;
  align-items: center;
}
.zoz-times-stack label {
  margin: 0;
}
.zoz-times-stack input {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 1100px) {
  .zoz-event,
  .zoz-split { grid-template-columns: 1fr; }
  .zoz-times-stack > div { grid-template-columns: 1fr; }
}

.zoz-panel input,
.zoz-panel select,
.zoz-panel textarea,
.zoz-pad input,
.zoz-pad select,
.zoz-pad textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  appearance: auto;
  -webkit-appearance: auto;
}
.zoz-panel input:focus,
.zoz-panel select:focus,
.zoz-panel textarea:focus,
.zoz-pad input:focus,
.zoz-pad select:focus,
.zoz-pad textarea:focus {
  outline: none;
  border-color: var(--navy-accent);
  box-shadow: 0 0 0 3px rgba(42, 90, 154, 0.15);
}
.zoz-panel input:disabled,
.zoz-panel select:disabled,
.zoz-panel textarea:disabled,
.zoz-pad input:disabled,
.zoz-pad select:disabled,
.zoz-pad textarea:disabled {
  background: #f8fafc;
  color: var(--text);
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}
.zoz-panel textarea,
.zoz-pad textarea {
  min-height: 84px;
  resize: vertical;
}
.zoz-panel label,
.zoz-pad label {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.zoz-panel .form-grid {
  gap: 12px 18px;
}

.picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  color: var(--text);
}
.picker::backdrop { background: rgba(15, 23, 42, 0.45); }
.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #0c2456 0%, var(--navy) 70%, #1a0a12 100%); border-bottom: 3px solid var(--zzs-red, #c8102e);
  color: #fff;
}
.picker-head strong { font-size: 14px; }
.picker-close {
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.picker-body { padding: 14px; }
.picker-search { display: block; margin-bottom: 10px; }
.picker-search input { width: 100%; }
.picker-table-wrap {
  max-height: min(360px, 45vh);
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.picker-table { margin: 0; }
.picker-table tbody tr { cursor: pointer; }
.picker-table tbody tr:hover td { background: #eef5ff; }
.picker-table tbody tr.on td { background: #dbeafe; }
.picker-code { width: 72px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.picker-foot {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line-soft);
  background: #f8fafc;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 16px;
  background: transparent;
  flex-wrap: wrap;
  padding: 0;
}
.tabs a {
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--navy); background: #fff; text-decoration: none; }
.tabs a.on {
  background: #fff;
  color: var(--navy);
  font-weight: 650;
  border-color: var(--line);
  border-bottom-color: #fff;
  box-shadow: var(--shadow-sm);
}

.form { padding: 14px 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.form label { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 4px; letter-spacing: 0.02em; }
.form input, .form select, .form textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #fff;
  border-radius: 6px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--navy-accent);
  box-shadow: 0 0 0 3px rgba(42, 90, 154, 0.15);
}
.form textarea { min-height: 84px; resize: vertical; }
.form .full { grid-column: 1 / -1; }

.zoz-panel.form,
.zoz-panel .form {
  padding: 0;
}
.zoz-panel.form .zoz-pad,
.zoz-panel .form.zoz-pad {
  padding: 16px;
}
.zoz-panel.form input,
.zoz-panel.form select,
.zoz-panel.form textarea,
.zoz-panel .form input,
.zoz-panel .form select,
.zoz-panel .form textarea,
.zoz-panel .form-grid input,
.zoz-panel .form-grid select,
.zoz-panel .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  box-shadow: none;
  font-weight: 400;
}
.zoz-panel.form input:focus,
.zoz-panel.form select:focus,
.zoz-panel.form textarea:focus,
.zoz-panel .form-grid input:focus,
.zoz-panel .form-grid select:focus,
.zoz-panel .form-grid textarea:focus {
  outline: none;
  border-color: var(--navy-accent);
  box-shadow: 0 0 0 3px rgba(42, 90, 154, 0.15);
}

.flash {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--ok);
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius);
}
.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--bad);
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius);
}

.search { display: flex; gap: 8px; align-items: center; }
.search input {
  flex: 1;
  border: 1px solid var(--line);
  padding: 9px 12px;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.foot {
  display: none; /* footer info je v sidebaru / headeru; hlavní oblast scrolluje čistě */
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(42, 90, 154, 0.35), transparent),
    linear-gradient(160deg, #0a1628 0%, #12233d 45%, #0a1628 100%);
}
.login {
  width: min(400px, 92vw);
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  border-top: 4px solid var(--navy-accent);
}
.login h1 {
  margin: 0 0 4px;
  font-family: "IBM Plex Sans Condensed", sans-serif;
  color: var(--navy);
  font-size: 28px;
  font-weight: 700;
}
.login p { color: var(--muted); margin: 0 0 18px; }
.login label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.login input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 9px 11px;
  border-radius: 6px;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.btn.discord {
  background: #5865F2;
  border-color: #5865F2;
  color: #fff;
}
.btn.discord:hover {
  background: #4752c4;
  border-color: #4752c4;
}

.map { height: 280px; border-top: 1px solid var(--line); }
.muted { color: var(--muted); }

.mail-head h2 { margin: 0 0 12px; }
.mail-page {
  max-width: 1100px;
  margin: 0;
  padding: 0;
  min-height: 0;
  box-sizing: border-box;
  background: transparent;
  color: var(--text);
  border-radius: 0;
}
.mail-page .mail-title,
.main .mail-page h2.mail-title {
  margin: 0 0 18px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.15;
}
.mail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.mail-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #dbe3ee;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.mail-tab:hover { background: #cfd9e8; }
.mail-tab.on {
  background: #cfe0f7;
  color: #163a6b;
}
.mail-tab.primary {
  background: #2f6fed;
  color: #fff;
}
.mail-tab.primary:hover { filter: brightness(1.08); color: #fff; }
.mail-tab.primary.on { background: #2f6fed; color: #fff; }

.mail-compose-panel {
  display: grid;
  gap: 16px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 8px 0 0;
  box-shadow: none;
}
.mail-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 16px;
  align-items: center;
}
.mail-row-msg,
.mail-row-files { align-items: start; }
.mail-row > label {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.mail-row-msg > label,
.mail-row-files > label { padding-top: 12px; }
.mail-row-ctrl { min-width: 0; width: 100%; }
.mail-input,
.mail-lookup input[type="search"],
.mail-lookup input {
  display: block;
  width: 100% !important;
  max-width: none;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.mail-input:focus,
.mail-lookup input:focus {
  outline: none;
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18);
}
.mail-editor-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.mail-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.mail-toolbar button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}
.mail-toolbar button:hover { background: #f1f5f9; }
.mail-editor {
  min-height: 240px;
  padding: 12px 14px;
  line-height: 1.55;
  border: 0;
  outline: none;
  color: var(--text);
}
.mail-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  color: var(--muted);
}
.mail-file-btn {
  cursor: pointer;
  margin: 0;
  border-radius: 8px;
  background: #fff !important;
  color: var(--navy) !important;
  border-color: var(--line) !important;
}
.mail-files input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.mail-files-hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.mail-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 136px;
  margin-top: 2px;
}
.mail-compose-actions .btn,
.mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #2f6fed;
  background: #2f6fed;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.mail-compose-actions .btn.sec,
.mail-btn.ghost {
  background: #e8eef8;
  border-color: #d3dceb;
  color: #163a6b;
}
.mail-compose-actions .btn:hover,
.mail-btn:hover { filter: brightness(1.08); color: #fff; text-decoration: none; }
.mail-compose-actions .btn.sec:hover,
.mail-btn.ghost:hover { filter: none; background: #dce6f5; color: #163a6b; }
.mail-inline-form { display: inline; margin: 0; }
.mail-card {
  overflow-x: auto;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.mail-table { margin: 0; color: var(--text); }
.mail-table th {
  background: #f8fafc;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.mail-table td {
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.mail-table tbody tr { cursor: pointer; }
.mail-table tr.mail-row-new td { background: #f7f3df; }
.mail-table tr.mail-row-new:hover td { background: #f1ebc8; }
.mail-table tr.mail-row-read td { background: #fff; }
.mail-table tr.mail-row-read:hover td { background: #f8fafc; }
.mail-from { font-weight: 600; color: var(--text); }
.mail-from-mail { font-size: 12px; color: var(--muted); }
.mail-subject { font-weight: 600; color: var(--text); }
.mail-preview { font-size: 12px; margin-top: 4px; color: var(--muted); }
.mail-time { white-space: nowrap; color: var(--muted); }
.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.mail-meta {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 14px;
  color: var(--text);
}
.mail-meta-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}
.mail-meta-k {
  color: var(--muted);
  margin: 0;
  padding-top: 1px;
  font-weight: 500;
}
.mail-meta-v { min-width: 0; }
.mail-meta strong { color: var(--text); font-weight: 700; }
.mail-meta-mail {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.3;
}
.mail-meta-person + .mail-meta-person { margin-top: 8px; }
.mail-thread { display: grid; gap: 12px; }
.mail-bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: none;
}
.mail-bubble.on {
  border-color: var(--line);
  box-shadow: none;
  background: #fff;
}
.mail-bubble-head { display: none; }
.mail-bubble-body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.mail-bubble-body p { margin: 0 0 0.75em; }
.mail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  min-height: 0;
}
.mail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8eef8;
  border: 1px solid #c9d7ea;
  font-size: 12px;
  color: var(--text);
}
.mail-chip-x {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.mail-lookup { position: relative; }
.mail-suggest {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  max-height: 280px;
  overflow: auto;
}
.mail-suggest-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}
.mail-suggest-item:last-child { border-bottom: 0; }
.mail-suggest-item:hover { background: #f8fafc; }
.mail-suggest-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.mail-suggest-text small {
  color: var(--muted);
  font-size: 12px;
}
.mail-suggest-add {
  flex: 0 0 auto;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #eff6ff;
}
.mail-suggest-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.mail-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mail-attach-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
}
.mail-attach-item span { color: var(--muted); }
.mail-page .muted { color: var(--muted); }

.kopis-table td { vertical-align: top; }
.kopis-table .nowrap { white-space: nowrap; }
.kopis-table tr.kopis-alert td { background: #fff7ed; }
.kopis-table tr.kopis-alert:hover td { background: #ffedd5; }

@media (max-width: 720px) {
  .mail-row,
  .mail-compose-actions { grid-template-columns: 1fr; padding-left: 0; }
  .mail-row > label { padding-top: 0; }
  .mail-compose-actions { display: flex; }
}

@media (max-width: 1100px) {
  :root { --side-w: 0px; }
  .side { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .stats, .form-grid { grid-template-columns: 1fr; }
  .top {
    padding: 0 12px;
    gap: 10px;
  }
  .top-search { display: none; }
  .brand h1 { font-size: 14px; }
  .brand p { display: none; }
}
