/* Vzhled podle znacky EKP Advisory: tmava modra #013A57 + zluta #DDD200,
   doplnkove zlata #D3BC82. Odstiny jsou vytazene primo z loga klienta. */

:root {
  --brand:        #013A57;
  --brand-dark:   #002738;
  --brand-light:  #0d5478;
  --accent:       #DDD200;
  --gold:         #D3BC82;

  --text:         #262626;
  --text-muted:   #5f6b73;
  --line:         #dfe4e8;
  --bg:           #f4f6f8;
  --panel:        #ffffff;

  --ok:           #1a7f4b;
  --warn:         #a06800;
  --err:          #a90707;

  --radius: 8px;
  --shadow: 0 1px 2px rgba(1, 58, 87, .06), 0 4px 16px rgba(1, 58, 87, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-light); }
a:hover { color: var(--brand); }

/* ---------- hlavicka ---------- */

.topbar {
  background: var(--brand);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 28px; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand img { width: 34px; height: 34px; display: block; background: #fff; border-radius: 6px; padding: 3px; }
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand-text span { font-size: 12px; color: rgba(255,255,255,.72); }

.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav a {
  position: relative;
  color: rgba(255,255,255,.85); text-decoration: none; padding: 8px 14px;
  border-radius: var(--radius); font-weight: 500; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--accent);
}

.user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,.8); }
.user strong { color: #fff; font-weight: 600; }
.role-chip {
  background: rgba(221,210,0,.16); color: var(--accent);
  border: 1px solid rgba(221,210,0,.35);
  padding: 1px 8px; border-radius: 20px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
}

/* ---------- rozvrzeni ---------- */

.wrap { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 0; font-weight: 650; color: var(--brand); letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; color: var(--brand); }
.sub { color: var(--text-muted); font-size: 13px; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px;
}
.panel.tight { padding: 0; overflow: hidden; }
.panel-head {
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ---------- dlazdice s cisly ---------- */

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .value { font-size: 21px; font-weight: 650; color: var(--brand); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.warn { color: var(--warn); }
.stat .value.err  { color: var(--err); }
.stat .note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- tabulky ---------- */

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
thead th {
  background: #f0f3f6; color: var(--brand); font-weight: 650; font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
tbody tr:hover { background: #f7fafc; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 650; background: #f0f3f6; color: var(--brand); border-top: 2px solid var(--brand); }
.mono { font-family: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-muted); }

/* ---------- formulare ---------- */

label { display: block; font-size: 13px; font-weight: 600; color: var(--brand); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=file], input[type=month], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; font-size: 14px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(13, 84, 120, .12);
}
.field { margin-bottom: 14px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.check { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: var(--text); }
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: 8px 16px; border-radius: 6px; font: inherit; font-size: 14px; font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: #f0f3f6; color: var(--brand); }
.btn.danger { background: #fff; color: var(--err); border-color: #e6c3c3; }
.btn.danger:hover { background: #fdf3f3; color: var(--err); }
.btn.small { padding: 5px 11px; font-size: 13px; }

/* ---------- hlasky a stitky ---------- */

.alert { padding: 11px 15px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert.ok   { background: #eef8f2; border-color: #bfe3ce; color: var(--ok); }
.alert.err  { background: #fdf3f3; border-color: #eccccc; color: var(--err); }
.alert.warn { background: #fdf8ec; border-color: #ecdcb4; color: var(--warn); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
  font-weight: 600; background: #eef1f4; color: var(--text-muted); white-space: nowrap;
}
.tag.err  { background: #fdeaea; color: var(--err); }
.tag.warn { background: #fdf4e3; color: var(--warn); }
.tag.ok   { background: #e9f6ef; color: var(--ok); }
.tag.accent { background: rgba(221,210,0,.22); color: #6d6700; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.pager { display: flex; gap: 8px; align-items: center; padding: 12px 20px; font-size: 14px; }

/* ---------- prihlaseni ---------- */

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%); padding: 20px;
}
.login-card { background: #fff; border-radius: 12px; padding: 34px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card img { width: 54px; height: 54px; display: block; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 19px; margin-bottom: 4px; }
.login-card .sub { text-align: center; margin-bottom: 22px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-muted); }

/* ---------- pomocne tridy ----------
   Inline style="" atributy zamerne nepouzivame - aplikace bezi pod prisnou
   CSP (style-src 'self'), ktera je blokuje. */

.inline-form { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mb { margin-bottom: 18px; }
.span-2 { grid-column: span 2; }
.reasons { margin: 6px 0 0; padding-left: 20px; }

/* ---------- bublinová nápověda ----------
   Podtržení tečkovaně = najeď myší a dozvíš se, odkud číslo pochází. */

.help { border-bottom: 1px dotted var(--text-muted); cursor: help; }
thead th.help, thead .help { border-bottom-color: rgba(1, 58, 87, .45); }

/* ---------- grafy ---------- */

.panel svg { display: block; max-width: 100%; }
.cisla { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.cisla summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand-light);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
.cisla summary::before { content: "▸"; font-size: 11px; }
.cisla[open] summary::before { content: "▾"; }
.cisla summary::-webkit-details-marker { display: none; }
.cisla .table-scroll { margin-top: 10px; }

/* Mezisoučet za rok ve výstupu podle účtů - odlišený, ať se neplete s měsíci. */
th.rok, td.rok { background: #f0f3f6; font-weight: 600; }
tr.total td.rok { background: #e6ecf1; }

/* ---------- patička ---------- */

.paticka {
  border-top: 1px solid var(--line);
  background: var(--panel);
  margin-top: 40px;
}
.paticka-obsah {
  max-width: 1400px; margin: 0 auto; padding: 14px 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
}
.paticka strong { color: var(--brand); font-weight: 600; }
.login-verze { display: inline-block; margin-top: 8px; opacity: .75; }
