/* ─────────────────────────────────────────────
   Dotykačka Intranet – Brand CSS
   Primary green: #31B24A  |  Black: #191919
   Fonts: Gotham (primary, self-hosted) + Caveat (accent)
   Theming: light (default) / dark via [data-theme]
───────────────────────────────────────────── */

/* ── FONTS ── */
/* WOFF2 (≈30 kB) s OTF/TTF fallbackem pro starší prohlížeče */
@font-face { font-family:'Gotham'; src:url('/font/Gotham-Light.woff2')  format('woff2'), url('/font/Gotham-Light.otf')  format('opentype'); font-weight:300; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('/font/Gotham-Book.woff2')   format('woff2'), url('/font/Gotham-Book.otf')   format('opentype'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('/font/Gotham-Medium.woff2') format('woff2'), url('/font/Gotham-Medium.otf') format('opentype'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Gotham'; src:url('/font/Gotham-Bold.woff2')   format('woff2'), url('/font/Gotham-Bold.otf')   format('opentype'); font-weight:700; font-style:normal; font-display:swap; }
@font-face { font-family:'Caveat'; src:url('../fonts/Caveat-SemiBold.woff2') format('woff2'), url('../fonts/Caveat-SemiBold.ttf') format('truetype'); font-weight:600; font-style:normal; font-display:swap; }

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand constants (theme-independent) — Brand Guidelines 2025 */
  --green:         #31B24A;   /* primary */
  --green-dark:    #27902E;
  --green-darkest: #1F7024;
  --green-medium:  #5BB24C;
  --green-light:   #5FD367;
  --ink:           #191919;   /* Brand Black — jen max-kontrastní znaky */

  /* Akcentová / datová paleta (grafy, role, kategorie třetích stran) */
  --accent-blue:   #0084F4;
  --accent-cyan:   #1AB8D1;
  --accent-teal:   #31B08A;
  --accent-brown:  #7A574A;
  --accent-purple: #A115B0;
  --red:           #E94555;   /* accent-red */
  --accent-orange: #F7A600;
  --yellow:        #F4C905;
  --slate:         #404959;
  --gray-violet:   #716C80;

  /* Radius škála dle manuálu (4 / 8 / 16 / full) */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;
  --radius:      var(--radius-lg);   /* karty, modály */

  /* Spacing — 8px rytmus s 4px půlkrokem */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 64px;

  /* Typografická škála (root 15px) */
  --fs-xs:   .73rem;    /* ~11px — jen uppercase mikro-labely */
  --fs-sm:   .83rem;    /* ~12.5px — meta, hinty */
  --fs-md:   .875rem;   /* ~13px — běžný UI text */
  --fs-base: 1rem;      /* 15px — obsahový text */
  --fs-lg:   1.2rem;    /* nadpis karty / sekce */
  --fs-xl:   1.45rem;   /* nadpis detailu */
  --fs-2xl:  1.85rem;   /* nadpis stránky */

  /* Z-index vrstvy */
  --z-sidebar: 100;
  --z-modal:   200;
  --z-confirm: 400;

  /* Light theme (default) — Off-White pozadí, bílé karty (flat/tonální) */
  --bg:            #F6F7FA;
  --surface:       #ffffff;
  --surface-2:     #f0f2f7;
  --surface-3:     #fafbfc;
  --text:          #242933;   /* on-surface — Dark Navy dle manuálu */
  --text-muted:    #5d6472;
  --text-soft:     #767e8b;
  --border:        #e7e9ef;
  --border-strong: #d8dbe4;
  --green-pale:    #e8f7ec;

  --sidebar-bg:         #ffffff;
  --sidebar-text:       #4a5160;
  --sidebar-text-muted: #767e8b;
  --sidebar-border:     #ecedf2;
  --sidebar-hover:      #f4f5f9;
  --sidebar-active-bg:  var(--green-pale);

  --shadow:    0 1px 2px rgba(20,22,35,.04), 0 2px 10px rgba(20,22,35,.05);
  --shadow-md: 0 6px 28px rgba(20,22,35,.10);
  --focus-ring: 0 0 0 3px rgba(49,178,74,.35);

  --sidebar-w: 264px;

  /* Aliasy starších názvů — šablony je dosud používají; bez nich se pozadí
     (např. modál nahrávání) vyhodnotí jako průhledné. Odkazují na theme
     proměnné, takže fungují i v tmavém režimu. */
  --white:      var(--surface);
  --black:      var(--text);
  --gray:       var(--text-muted);
  --gray-light: var(--border);
}

[data-theme="dark"] {
  --bg:            #15171c;
  --surface:       #1e2228;
  --surface-2:     #262b33;
  --surface-3:     #22262d;
  --text:          #f2f4f7;
  --text-muted:    #a6adba;
  --text-soft:     #8b93a1;
  --border:        rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --green-pale:    rgba(49,178,74,.15);
  --ink:           #f6f7fa;

  --sidebar-bg:         #16181d;
  --sidebar-text:       rgba(255,255,255,.72);
  --sidebar-text-muted: rgba(255,255,255,.45);
  --sidebar-border:     rgba(255,255,255,.08);
  --sidebar-hover:      rgba(255,255,255,.05);
  --sidebar-active-bg:  rgba(49,178,74,.16);

  --shadow:    0 1px 2px rgba(0,0,0,.30), 0 2px 10px rgba(0,0,0,.25);
  --shadow-md: 0 8px 30px rgba(0,0,0,.45);
  --focus-ring: 0 0 0 3px rgba(95,211,103,.4);
}

html { font-size: 15px; }
body {
  font-family: 'Gotham', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color .25s ease, color .25s ease;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; }

/* Nadpisy dle manuálu: Bold, těsnější prostrkání a řádkování */
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }

/* Viditelný focus pro ovládání klávesnicí — všude, ne jen u inputů */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Vizuálně skrytý obsah (čtečky obrazovky, klávesnicová validace) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 22px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo-link { display: block; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand-logo--dark { display: none; }
[data-theme="dark"] .brand-logo--light { display: none; }
[data-theme="dark"] .brand-logo--dark  { display: block; }
.logo-sub {
  font-size: .65rem;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-top: 10px;
  display: block;
}

.sidebar-nav { flex: 1; padding: 14px 0; }
.nav-section {
  padding: 16px 22px 6px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sidebar-text-muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 22px;
  margin: 1px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--green-dark);
  font-weight: 600;
}
[data-theme="dark"] .nav-item.active { color: var(--green-light); }
.nav-item svg { flex-shrink: 0; opacity: .7; }
.nav-item.active svg { opacity: 1; color: var(--green); }

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--sidebar-border);
  font-size: .8rem;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
a.sidebar-user {
  text-decoration: none;
  color: inherit;
  padding: 6px;
  margin: -6px -6px 6px;
  border-radius: var(--radius-md);
  transition: background .15s;
}
a.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-avatar-img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* Profile avatar */
.profile-avatar-row { display: flex; align-items: center; gap: 20px; }
.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 2.1rem;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  font-weight: 600;
  color: var(--text);
  font-size: .82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .65rem;
  color: var(--sidebar-text-muted);
  text-transform: capitalize;
}
.btn-logout {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
  border: none;
  border-radius: var(--radius-md);
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.btn-logout:hover { background: var(--green-pale); color: var(--green-dark); }
[data-theme="dark"] .btn-logout:hover { color: var(--green-light); }

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  padding: 0 32px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color .25s ease, border-color .25s ease;
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.content { padding: 30px 32px; flex: 1; }

/* ── FLASH MESSAGES ── */
.flash-container { margin-bottom: 20px; }
.flash {
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}
.flash-success { background: #e8f7ec; color: var(--green-darkest); border-color: #bce5c6; }
.flash-error   { background: #fde8e8; color: #c0392b; border-color: #f5c6cb; }
.flash-info    { background: #e3f0ff; color: #1a56db; border-color: #b8d4f5; }
[data-theme="dark"] .flash-success { background: rgba(49,178,74,.15); color: var(--green-light); border-color: rgba(49,178,74,.3); }
[data-theme="dark"] .flash-error   { background: rgba(233,69,85,.15); color: #ff909a; border-color: rgba(233,69,85,.32); }
[data-theme="dark"] .flash-info    { background: rgba(0,132,244,.15); color: #7ab8ff; border-color: rgba(0,132,244,.32); }
.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: .85rem;
  min-width: 28px; min-height: 28px;
  border-radius: var(--radius-full);
  opacity: .7;
}
.flash-close:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ── BUTTONS ── */
/* Dle manuálu: CTA = pill, zelená výplň, bílý tučný text, hover primary-dark */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: var(--radius-full); }
/* Bílý text na --green má kontrast 2,76:1 (WCAG AA žádá 4,5:1). --green-darkest
   dává 6,17:1 a je to schválený brandový token. Hover jen prosvětlíme filtrem,
   ať nevzniká nová barva – i po prosvětlení zůstává kontrast nad 5:1. */
.btn-primary   { background: var(--green-darkest); color: #fff; }
.btn-primary:hover { background: var(--green-darkest); color: #fff; filter: brightness(1.18); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger    { background: rgba(233,69,85,.12); color: #c8323f; }
.btn-danger:hover { background: rgba(233,69,85,.22); color: #c8323f; }
[data-theme="dark"] .btn-danger { background: rgba(233,69,85,.16); color: #ff909a; }
[data-theme="dark"] .btn-danger:hover { background: rgba(233,69,85,.26); }
/* Plná varianta pro nevratné akce (trvalé smazání v koši) */
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #c8323f; color: #fff; }
.btn-sm { min-height: 32px; padding: 5px 15px; font-size: var(--fs-sm); }
.btn-icon {
  min-width: 36px; min-height: 36px;
  padding: 6px;
  border-radius: var(--radius-full);
}
/* Loading stav — nastavuje main.js po potvrzeném odeslání */
.btn.is-loading { opacity: .65; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  width: 14px; height: 14px;
  margin-left: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius-full);
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Zpětný odkaz nad detailem/formulářem */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 16px;
}
.btn-back:hover { color: var(--green); }

/* ── CARDS ── */
/* Flat/tonální hloubka dle manuálu: bílá karta na Off-White, jen okraj.
   Stín zůstává vyvýšeným vrstvám (modály) a hoveru interaktivních karet. */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  display: inline-block;
  padding-bottom: 8px;
  position: relative;
}
/* Brandový oblouk („smile") pod nadpisem stránky — jediný dekorativní prvek */
.page-header h1::after {
  content: '';
  position: absolute;
  left: 2px; bottom: 0;
  width: 34px; height: 10px;
  border: 3px solid var(--green);
  border-top: none;
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 0 0 17px 17px;
}
.page-header p { color: var(--text-muted); font-size: var(--fs-md); margin-top: 4px; }

/* ── STATS ROW ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── GRID LAYOUTS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── ARTICLE CARDS ── */
.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 24px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  border-left: 4px solid transparent;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.article-card.pinned { border-left-color: var(--green); }
.article-card-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.article-card-title a { color: inherit; }
.article-card-title a:hover { color: var(--green); }
.article-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.article-card-excerpt {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* Badge = skutečný STAV (Provize, Koncept, role). Pro volný text užij .tag. */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-green  { background: var(--green-pale); color: var(--green-dark); }
.badge-gray   { background: var(--surface-2); color: var(--text-muted); }
.badge-admin  { background: rgba(247,166,0,.16); color: #9a6a00; }
.badge-editor { background: rgba(0,132,244,.13); color: #0568bd; }
.badge-purple { background: rgba(161,21,176,.12); color: #891296; }
[data-theme="dark"] .badge-green  { color: var(--green-light); }
[data-theme="dark"] .badge-admin  { background: rgba(247,166,0,.18); color: #f7a600; }
[data-theme="dark"] .badge-editor { background: rgba(0,132,244,.18); color: #7ab8ff; }
[data-theme="dark"] .badge-purple { background: rgba(161,21,176,.22); color: #e07ae8; }

/* Tag = datový popisek volným textem (kategorie, podmínky, poznámky) */
.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  text-align: left;
  padding: 11px 14px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-3); }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: .875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background-color .25s;
  outline: none;
}
input::placeholder, textarea::placeholder { color: var(--text-soft); }
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(49,178,74,.15);
}
textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--green); }
.checkbox-row label { margin: 0; font-weight: 500; cursor: pointer; }

/* ── FILE UPLOAD ── */
.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--green); background: var(--green-pale); }
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text { font-size: .875rem; color: var(--text-muted); }
.upload-text strong { color: var(--green); }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.page-link {
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  transition: all .15s;
}
.page-link:hover { background: var(--green-pale); border-color: var(--green); color: var(--green-dark); }
.page-link.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ── WIKI ── */
.wiki-sidebar { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.wiki-nav { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 16px; }
.wiki-nav-category {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--green);
  margin: 12px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--green-pale);
}
.wiki-nav-category:first-child { margin-top: 0; }
.wiki-nav a {
  display: block;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  color: var(--text);
  transition: background .12s, color .12s;
}
.wiki-nav a:hover { background: var(--surface-2); color: var(--green); }

/* ── ARTICLE CONTENT ── */
.article-content { line-height: 1.75; color: var(--text); }
.article-content h1, .article-content h2, .article-content h3 { font-weight: 700; color: var(--text); margin: 1.4em 0 .6em; }
.article-content h1 { font-size: 1.5rem; }
.article-content h2 { font-size: 1.2rem; }
.article-content h3 { font-size: 1rem; }
.article-content p { margin-bottom: .85em; }
.article-content ul, .article-content ol { padding-left: 1.5em; margin-bottom: .85em; }
.article-content li { margin-bottom: .3em; }
.article-content strong { font-weight: 700; }
.article-content a { color: var(--green); text-decoration: underline; }
.article-content blockquote {
  border-left: 3px solid var(--green);
  padding: 8px 16px;
  margin: 12px 0;
  background: var(--green-pale);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}
.article-content code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: .85em;
  font-family: ui-monospace, monospace;
}
.article-content pre {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: .85em;
}

/* ── HLEDÁNÍ V HLAVIČCE ── */
.topbar-search input {
  width: 190px; padding: 7px 12px; font-size: .85rem;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text); transition: width .18s, border-color .15s;
}
.topbar-search input:focus { width: 260px; border-color: var(--green); box-shadow: var(--focus-ring); }
@media (max-width: 720px) { .topbar-search { display: none; } }

/* ── OBRÁZKY, EMBEDY A TABULKY V OBSAHU ── */
.article-content img, .ql-editor img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 10px 0; }
.article-content img.align-left,   .ql-editor img.align-left   { display: block; margin-right: auto; margin-left: 0; }
.article-content img.align-center, .ql-editor img.align-center { display: block; margin-left: auto; margin-right: auto; }
.article-content img.align-right,  .ql-editor img.align-right  { display: block; margin-left: auto; margin-right: 0; }
.article-content img.w-50, .ql-editor img.w-50 { width: 50%; }
.article-content img.w-75, .ql-editor img.w-75 { width: 75%; }

/* Embed (YouTube, mapy, Google dokumenty) – responzivní poměr 16:9 */
.article-content .embed-wrap, .ql-editor .embed-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  margin: 16px 0; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-2);
}
.article-content .embed-wrap iframe, .ql-editor .embed-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.article-content table, .ql-editor table {
  border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .88rem;
}
.article-content th, .article-content td, .ql-editor th, .ql-editor td {
  border: 1px solid var(--border-strong); padding: 8px 10px; text-align: left; vertical-align: top;
}
.article-content th, .ql-editor th { background: var(--surface-2); font-weight: 700; }
/* Široké tabulky nesmí roztáhnout stránku */
.article-content { overflow-x: auto; }

/* Popover pro zarovnání/velikost obrázku v editoru */
.img-tools {
  position: absolute; z-index: 40; display: flex; gap: 4px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.img-tools button {
  border: 1px solid transparent; background: transparent; cursor: pointer;
  padding: 4px 8px; border-radius: var(--radius-sm); font-size: .75rem; color: var(--text);
}
.img-tools button:hover { background: var(--surface-2); }
.img-tools button.active { background: var(--green-pale); border-color: var(--green); }

/* ── QUILL EDITOR ── */
.ql-toolbar { border-radius: var(--radius-md) var(--radius-md) 0 0 !important; border-color: var(--border-strong) !important; background: var(--surface); }
.ql-container { border-radius: 0 0 var(--radius-md) var(--radius-md) !important; border-color: var(--border-strong) !important; min-height: 260px; font-family: inherit !important; font-size: .9rem !important; color: var(--text); }
.ql-editor { min-height: 240px; }
[data-theme="dark"] .ql-snow .ql-stroke { stroke: var(--text-muted); }
[data-theme="dark"] .ql-snow .ql-fill { fill: var(--text-muted); }
[data-theme="dark"] .ql-snow .ql-picker { color: var(--text-muted); }

/* ── LOGIN PAGE ── */
.login-page { min-height: 100vh; display: flex; background: var(--bg); }
.login-brand {
  flex: 1;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.login-brand::before {
  content: '';
  position: absolute;
  width: 440px; height: 440px;
  border-radius: 50%;
  border: 70px solid rgba(255,255,255,.10);
  top: -120px; right: -120px;
}
.login-brand::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  border: 46px solid rgba(255,255,255,.08);
  bottom: -90px; left: -90px;
}
.login-brand-inner { position: relative; z-index: 1; color: #fff; text-align: center; }
.login-brand-logo { height: 46px; width: auto; margin-bottom: 22px; }
.login-brand-claim { font-size: .95rem; opacity: .9; font-weight: 600; letter-spacing: .5px; }
.login-brand-note { margin-top: 30px; font-size: .85rem; opacity: .8; font-family: 'Caveat', cursive; }

.login-form-wrap {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}
.login-box { width: 100%; }
.login-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-sub { font-size: .875rem; color: var(--text-muted); margin-bottom: 28px; }
.login-remember { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .82rem; font-weight: 500; }
.login-remember input { accent-color: var(--green); }
.login-theme-toggle { position: absolute; top: 24px; right: 24px; }

/* Google sign-in button + divider */
.btn-google {
  width: 100%;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}
.btn-google:hover { background: var(--surface-2); color: var(--text); }
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-soft);
  font-size: .75rem;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── FILTERS ── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
  padding: 7px 15px;
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.filter-btn:hover { border-color: var(--green); color: var(--green); }
.filter-btn.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ── RESPONSIVE ── */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; }

@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-264px); width: 264px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .wiki-sidebar { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-wrap { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── UTILITIES ── */
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm  { font-size: .8rem; }
.text-gray { color: var(--text-muted); }
.text-green { color: var(--green); }
.font-bold { font-weight: 700; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
/* Ikona tužky (templates/_icon_edit.html) – v textu sedí na účaří, v .btn
   (inline-flex) se zarovná sama a od textu ji odsadí gap tlačítka */
.icon-edit { display: inline-block; vertical-align: -0.15em; flex-shrink: 0; }
.empty-state p { font-size: .9rem; }

/* Sidebar overlay (mobile) */
#sidebarOverlay.show { display: block !important; }

/* ── ZVONEČEK UPOZORNĚNÍ ── */
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-md); color: var(--text);
  border: 1.5px solid var(--border-strong); background: var(--surface);
}
.notif-bell:hover { background: var(--surface-2); }
.notif-dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: var(--radius-md); background: var(--green); color: #fff;
  font-size: var(--fs-xs); font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ── HROMADNÉ OPERACE ── */
.bulk-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius-md);
  background: var(--green-pale); border: 1.5px solid var(--green);
}
.bulk-bar[hidden] { display: none; }

/* Blok „Tlačítko" v obsahu (Aktuality / Wiki) – renderované z Editor.js */
.content-btn-wrap { margin: 16px 0; }
.content-btn {
  display: inline-block;
  padding: 11px 24px;
  font-weight: 700;
  font-size: .92rem;
  color: #fff;
  background: var(--green);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: background .15s ease, transform .1s ease;
}
.content-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
[data-theme="dark"] .content-btn { color: #fff; }
/* Kontextové .article-content a by jinak přebilo barvu/podtržení tlačítka */
.article-content .content-btn { color: #fff; text-decoration: none; }
.article-content .content-btn:hover { color: #fff; }
/* Detail partnera (Integrace) vykresluje obsah v .rich-text, jehož pravidlo
   `.rich-text a` dávalo tlačítku zelený text na zeleném pozadí. */
.rich-text .content-btn { color: #fff; text-decoration: none; }
.rich-text .content-btn:hover { color: #fff; }

/* Sloupce v obsahu (Aktuality / Wiki / Integrace) – renderované z bloku
   „Sloupce". Šířky nese třída content-col--wNN (kroky po 5 %, generuje
   server z dat editoru); bez ní jsou sloupce rovnoměrné. */
.content-columns {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 16px 0;
}
.content-col { min-width: 0; flex: 1 1 0; }
.content-col > :first-child { margin-top: 0; }
.content-col--w20 { flex: 0 1 20%; } .content-col--w25 { flex: 0 1 25%; }
.content-col--w30 { flex: 0 1 30%; } .content-col--w35 { flex: 0 1 35%; }
.content-col--w40 { flex: 0 1 40%; } .content-col--w45 { flex: 0 1 45%; }
.content-col--w50 { flex: 0 1 50%; } .content-col--w55 { flex: 0 1 55%; }
.content-col--w60 { flex: 0 1 60%; } .content-col--w65 { flex: 0 1 65%; }
.content-col--w70 { flex: 0 1 70%; } .content-col--w75 { flex: 0 1 75%; }
.content-col--w80 { flex: 0 1 80%; }
@media (max-width: 640px) {
  .content-columns { flex-direction: column; }
  .content-columns [class*="content-col--w"] { flex-basis: auto; width: 100%; }
}

/* Zarovnání textu z bloku (tune align) — align-* platí i pro text */
.article-content .align-center { text-align: center; }
.article-content .align-right  { text-align: right; }

/* Zvýraznění a barevný text z inline nástrojů editoru */
.article-content mark { background: rgba(244,201,5,.4); padding: 0 2px; border-radius: 2px; }
[data-theme="dark"] .article-content mark { background: rgba(244,201,5,.3); color: var(--text); }

/* Obrázky a tabulky renderované serverem z bloků (dosud bez vlastního
   pravidla — spoléhaly jen na kontextové .article-content selektory) */
.content-img { margin: 10px 0; }
.content-img figcaption { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; }
.content-table { width: 100%; }

/* Motivační widgety na nástěnce (KPI dlaždice) */
.widgets-grid {
  display: flex;         /* dlaždice se šíří podle délky textu, ne pevné sloupce */
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}
/* Meta řádek (autor · datum · kategorie) */
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Drobečková navigace */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: var(--fs-sm);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs .crumb-sep { color: var(--text-soft); }
.breadcrumbs .crumb-current { color: var(--text); font-weight: 600; }

/* Upozorňovací panel (nahrazuje ad-hoc bordery v šablonách) */
.alert {
  border-left: 4px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: var(--fs-md);
}
.alert-info    { border-left-color: var(--accent-blue); background: rgba(0,132,244,.08); }
.alert-success { border-left-color: var(--green); background: var(--green-pale); }
.alert-warn    { border-left-color: var(--accent-orange); background: rgba(247,166,0,.10); }
.alert-danger  { border-left-color: var(--red); background: rgba(233,69,85,.08); }

/* ── LAYOUT UTILITY ── */
/* Vertikální seznam s mezerou */
.stack    { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
/* Horizontální řádek (ikona/avatar + text) — láme se, ať na mobilu nepřetéká */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Mřížka karet: karty sekcí 16px (jako .integrace-grid), checkboxy hustší 10px */
.card-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card-grid-sm { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
/* Tlačítka pod formulářem (zarovnaná doprava; odkaz Zrušit na ose tlačítek) */
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 8px;
}
/* Formuláře ve sloupci akcí zabírají celou šířku (schvalovací fronta) */
.stack-sm form, .reject-form { width: 100%; }

/* Avatar (kolečko s iniciálou nebo fotkou) — brandový zelený disk,
   shodně se .sidebar-avatar a .profile-avatar */
.avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: var(--green);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

/* Hromadný výběr v seznamech */
.bulk-check { cursor: pointer; }
/* Název vybraného souboru v uploadu */
.upload-filename:empty { display: none; }

/* Řádek seznamu s oddělovačem (poslední bez čáry) */
.divider-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.divider-row:last-child { border-bottom: none; }
hr.rule { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Karta motivačního widgetu */
.widget-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* Šířka podle obsahu: aspoň min, roste s textem do max (pak ellipsis). */
  min-width: 220px;
  max-width: 440px;
}
.widget-leaderboard { min-width: 320px; max-width: 560px; }
.widget-card.accent-green  { border-left-color: var(--green); }
.widget-card.accent-yellow { border-left-color: var(--yellow); }
.widget-card.accent-teal   { border-left-color: var(--accent-cyan); }
.widget-card.accent-red    { border-left-color: var(--red); }
.widget-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--fs-sm); }

/* Tišší varianta prázdného stavu (do panelů, ne přes celou stránku) */
.empty-state--subtle { padding: 20px 12px; }
.empty-state--subtle p { font-size: var(--fs-sm); }

/* Standardní šířky obsahu */
.page-narrow { max-width: 860px; }
.page-form   { max-width: 760px; }

/* ── POTVRZOVACÍ DIALOG (appConfirm/appPrompt z main.js) ──
   POZOR: tyto třídy vznikají za běhu v static/js/main.js, ne v šablonách.
   Bez nich je dialog neviditelný a všechna tlačítka s data-confirm mrtvá
   (regrese z merge #31). check_css.py nově skenuje i JS. */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: var(--z-confirm);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.confirm-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%; max-width: 420px;
  padding: 22px 24px;
}
.confirm-box h3 { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.confirm-box p  { font-size: .9rem; color: var(--text-muted); margin: 0 0 18px; overflow-wrap: anywhere; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-box input[type="text"] { margin-bottom: 18px; }

/* Modální okno (stejný vzor jako confirm dialog) */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted);
  min-width: 36px; min-height: 36px;
  border-radius: var(--radius-full);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 24px; }

/* Bohatý text z DB (detail partnera aj.) — sdílí styl s obsahem článků */
.rich-text { line-height: 1.7; color: var(--text); }
.rich-text p { margin-bottom: .85em; }
.rich-text ul, .rich-text ol { padding-left: 1.5em; margin-bottom: .85em; }
.rich-text li { margin-bottom: .3em; }
.rich-text a { color: var(--green); text-decoration: underline; }
.rich-text table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .88rem; }
.rich-text th, .rich-text td { border: 1px solid var(--border-strong); padding: 8px 10px; text-align: left; }
.rich-text th { background: var(--surface-2); font-weight: 700; }

/* Katalog Integrací */
.integrace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.integrace-card-wrap { display: flex; flex-direction: column; }
.integrace-card-wrap[draggable="true"] { cursor: grab; }
.integrace-card-wrap > .card { flex: 1; transition: border-color .15s, box-shadow .2s; }
.integrace-card-wrap > .card:hover { border-color: var(--green); box-shadow: var(--shadow); }
.integrace-tools { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

/* Historie verzí (dřív <style> blok v admin_releases.html) */
.release-timeline { display: flex; flex-direction: column; }
.release-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.release-item:last-child { border-bottom: none; }
.release-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.release-body {
  margin-top: 8px;
  font-size: var(--fs-md);
  color: var(--text-muted);
  white-space: pre-wrap;   /* popis verze má zachovat odřádkování */
  line-height: 1.6;
}

/* Titulek widgetu – jednořádkový, ořezaný (ne zalomený) */
.widget-body { min-width: 0; }
.widget-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-subtitle { font-size: .82rem; color: var(--text-muted); }

/* Motivační dashboard – rozšířené typy widgetů
   (základní .widget-card je definován výš; row je výchozí směr flexu) */
.widget-unit { font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.widget-target { font-size: .95rem; font-weight: 600; color: var(--text-muted); }

/* Trend (metric) */
.widget-trend { font-size: .8rem; font-weight: 700; margin-top: 2px; }
.widget-trend.trend-up   { color: var(--green); }
.widget-trend.trend-down { color: var(--red); }
.widget-trend.trend-flat { color: var(--text-muted); }

/* Progress */
.widget-progress { flex-direction: column; align-items: stretch; gap: 8px; }
.widget-progress .widget-title { text-transform: none; font-size: .92rem; color: var(--text); }
.widget-bar { height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.widget-bar-fill { height: 100%; border-radius: 6px; background: var(--green); transition: width .4s ease; }
.accent-yellow .widget-bar-fill { background: var(--yellow); }
.accent-teal   .widget-bar-fill { background: var(--accent-cyan); }
.accent-red    .widget-bar-fill { background: var(--red); }

/* Leaderboard – zabírá víc místa */
.widget-leaderboard { flex-direction: column; align-items: stretch; gap: 12px; }
@media (max-width: 640px) { .widget-leaderboard { min-width: 100%; } }
.widget-lb-head { display: flex; align-items: center; gap: 12px; }
.widget-lb-head .widget-icon { font-size: 1.7rem; }
.widget-lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.widget-lb-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-soft, var(--border)); font-size: .9rem; }
.widget-lb-list li:last-child { border-bottom: 0; }
.lb-rank { width: 26px; text-align: center; font-weight: 700; flex-shrink: 0; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.lb-value { font-weight: 700; color: var(--text); white-space: nowrap; }  /* Gotham nemá řez 800 */
.lb-empty { color: var(--text-muted); border-bottom: 0 !important; }

/* ── EET 2.0 (templates/eet.html) ── */
.eet-section { margin-top: 32px; }
.eet-section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.eet-section-head h2 { font-size: var(--fs-lg); margin: 0; }
.eet-section-head p { font-size: var(--fs-sm); color: var(--text-muted); margin: 2px 0 0; }
/* Stat karty s textovou hodnotou („1. 1. 2027", „Nepovinná") – menší než číslo na nástěnce */
.eet-stats .stat-number { font-size: 1.45rem; }
.eet-stats .stat-label {
  text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); font-weight: 500; margin-top: 4px; line-height: 1.4;
}
.eet-list { margin: 0; padding-left: 20px; }
.eet-list li { margin: 6px 0; font-size: var(--fs-md); line-height: 1.5; }
.eet-contact-phone { font-size: var(--fs-xl); font-weight: 700; color: var(--text); letter-spacing: .02em; }
.eet-contact-phone:hover { color: var(--green); }

/* Harmonogram: vodorovná osa, hotové milníky zelené, „Jste zde" u prvního budoucího */
.eet-timeline { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 8px; }
.eet-milestone { flex: 1 1 0; min-width: 0; position: relative; padding: 26px 8px 0 0; }
.eet-milestone::before {                        /* spojnice k dalšímu milníku */
  content: ''; position: absolute; left: 0; right: -8px; top: 7px; height: 2px; background: var(--border-strong);
}
.eet-milestone:last-child::before { right: calc(100% - 8px); }
.eet-milestone-dot {
  position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.eet-milestone.is-done::before,
.eet-milestone.is-done .eet-milestone-dot { background: var(--green); border-color: var(--green); }
.eet-milestone.is-now .eet-milestone-dot { border-color: var(--green); box-shadow: var(--focus-ring); }
.eet-milestone-now {
  display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: var(--radius-full);
  background: var(--green-pale); color: var(--green-dark);
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.eet-milestone-date { font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.eet-milestone.is-done .eet-milestone-date { color: var(--green-dark); }
.eet-milestone-label { font-size: var(--fs-md); line-height: 1.35; margin-top: 2px; }
.eet-milestone-src { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; }

/* Karta odkazu (ikona + název + popis + šipka) – samostatně v mřížce i uvnitř karty */
.link-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .2s;
}
.link-card:hover { border-color: var(--green); box-shadow: var(--shadow); color: inherit; }
.link-card-icon { font-size: 1.4rem; flex-shrink: 0; width: 32px; text-align: center; }
.link-card-body { min-width: 0; flex: 1; }
.link-card-title { font-weight: 600; font-size: var(--fs-md); color: var(--text); }
.link-card-desc { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.4; }
.link-card-arrow { color: var(--green); font-weight: 700; flex-shrink: 0; }

/* Sbalený náhled cizího webu – iframe se načte až po rozbalení (skript v šabloně) */
.eet-embed { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-top: 16px; }
.eet-embed summary {
  list-style: none; cursor: pointer; padding: 16px 24px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.eet-embed summary::-webkit-details-marker { display: none; }
.eet-embed summary::after { content: '▾'; color: var(--text-muted); }
.eet-embed[open] summary::after { content: '▴'; }
.eet-embed-body { padding: 0 16px 16px; }
.eet-embed iframe {
  display: block; width: 100%; height: 640px; border: 0;
  border-radius: var(--radius-md); background: var(--surface-2);
}

@media (max-width: 768px) {
  .eet-timeline { flex-direction: column; gap: 0; }
  .eet-milestone { padding: 0 0 18px 28px; }
  .eet-milestone::before { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .eet-milestone:last-child::before { bottom: auto; height: 8px; }
  .eet-embed iframe { height: 70vh; }
}

/* ── MOTION: jemné animace napříč intranetem ──
   Cíl: stránka působí živě a reaguje na akce, ale nic neblokuje ani
   nerozptyluje (do 300 ms, malé posuny). Vše jen přidává transition/
   animation k existujícím prvkům – barvy a rozměry zůstávají v jejich
   blocích. Respektuje prefers-reduced-motion. */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}
/* Obsah stránky nabíhá zespodu, po blocích s malým zpožděním */
.content > * { animation: fade-up .28s ease-out both; }
.content > :nth-child(2) { animation-delay: .04s; }
.content > :nth-child(3) { animation-delay: .08s; }
.content > :nth-child(4) { animation-delay: .12s; }
.content > :nth-child(5) { animation-delay: .16s; }
.content > :nth-child(n+6) { animation-delay: .2s; }
/* Dialogy leží v .content, ale náběh obsahu mít nesmí: animace by se spustila
   při každém otevření (display:none → flex) a dialog by se objevil zpožděně
   a průhledně. Dialog sám má vlastní pop-in na .modal-box. */
.content > .modal-overlay { animation: none; }
/* Karty a dlaždice lehce „vystoupí" pod kurzorem – jen tam, kde jsou klikací */
.card, .stat-card, .widget-card, .article-card, .link-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .15s ease;
}
a.card:hover, .article-card:hover, .link-card:hover, .integrace-card-wrap > .card:hover {
  transform: translateY(-2px);
}
/* Tlačítka: stisk je cítit */
.btn { transition: transform .08s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease; }
.btn:active { transform: scale(.97); }
/* Menu a filtry reagují plynule */
.nav-item, .filter-btn, .page-link { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
/* Hlášky, modály a potvrzovací dialog se objeví, nezablikají */
.flash { animation: fade-up .25s ease-out; }
.modal-box, .confirm-box { animation: pop-in .18s ease-out; }
.notif-dot { animation: pop-in .25s ease-out; }
/* Kdo si přeje méně pohybu, dostane vše okamžitě */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ── PREZENTAČNÍ REŽIM (admin se dívá očima skupiny) ── */
/* Stavový pruh nad lištou. Tmavá plocha, ne varovná barva: není to chyba,
   ale jiný režim zobrazení — musí být nepřehlédnutelný a přitom klidný. */
.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: 10px 32px;
  background: var(--slate);
  color: #fff;
  font-size: var(--fs-sm);
}
.preview-bar__label { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.preview-bar__label strong { font-weight: 700; }
.preview-bar__note {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .16);
  font-size: var(--fs-xs);
}
.preview-bar__exit {
  padding: 5px 14px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.preview-bar__exit:hover { background: rgba(255, 255, 255, .14); border-color: #fff; }
@media (max-width: 640px) { .preview-bar { padding: 10px 16px; } }

/* Přepínač v horní liště */
.preview-switch select {
  padding: 6px 10px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  max-width: 170px;
}
.preview-switch select:hover { border-color: var(--border-strong); color: var(--text); }

/* Mezinadpis v tabulce oprávnění (odděluje sekce od vlastních odkazů) */
.perm-subhead {
  padding-top: 18px;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}
.perm-subhead .meta { font-weight: 400; display: inline; }
