/* ==========================================================================
   ELEKTRO TULIS — INTRANET STYLE
   --------------------------------------------------------------------------
   Sjednocená vizuální identita s prezentačním webem (elektrotulis.cz):
     • paleta navy + gold (--brand-*),
     • typografie Exo 2 + Roboto Condensed,
     • komponenty: topbar, sidebar, cards, table, form, badge,
     • mikroanimace (card-in, pulseEmergency, hover-lift),
     • plně responsive (desktop sidebar / mobil drawer).

   Strukturováno do bloků:
     1) Design tokens (CSS custom properties)
     2) Base reset & typografie
     3) App shell — topbar / sidebar / content
     4) Cards & moduly
     5) Tabulky & data
     6) Formuláře
     7) Badges, alerts, buttons
     8) 2FA, modal, dashboard
     9) Login / splash
    10) Responsive overrides
    11) Animace
   ========================================================================== */


/* ──────────────────────────────────────────────────────────────────────────
   1) DESIGN TOKENS
   ────────────────────────────────────────────────────────────────────────── */
:root {
  /* Firemní paleta — přesně podle webu */
  --navy:        #0a1628;   /* hlavní tmavá */
  --navy2:       #11203a;   /* nav blur */
  --navy3:       #061021;   /* topbar nad nav */
  --navy-soft:   #1a2a47;   /* lehčí navy pro panely */
  --gold:        #f0b429;   /* primární akcent */
  --gold-light:  #f5c84b;   /* hover gold */
  --gold-dark:   #d49824;   /* active gold */
  --emergency:   #e74c3c;   /* pohotovost */

  /* Neutrály */
  --bg:           #f6f7fb;
  --surface:      #ffffff;
  --surface-soft: #f9fafc;
  --border:       #e3e7ef;
  --border-soft:  #eef1f6;
  --text:         #1a1f2e;
  --text-soft:    #5a6478;
  --text-muted:   #8a93a6;
  --link:         #1d4ed8;

  /* Stavové barvy */
  --ok-bg:      #e7f6ec;   --ok-fg:      #1f5d33;   --ok-border:      #b8e0c2;
  --warn-bg:    #fff4d6;   --warn-fg:    #6b4e00;   --warn-border:    #f5d27a;
  --error-bg:   #fde8e8;   --error-fg:   #8a1f1f;   --error-border:   #f3b6b6;
  --info-bg:    #e8f1fd;   --info-fg:    #103e7a;   --info-border:    #b6cff0;

  /* Geometrie */
  --radius-sm: 8px;
  --radius:    14px;       /* sjednoceno s webem */
  --radius-lg: 20px;

  /* Stíny */
  --shadow-xs: 0 1px 2px rgba(10,22,40,.05);
  --shadow-sm: 0 2px 8px rgba(10,22,40,.06);
  --shadow:    0 4px 16px rgba(10,22,40,.08);
  --shadow-lg: 0 12px 32px rgba(10,22,40,.12);
  --shadow-gold: 0 4px 14px rgba(240,180,41,.32);

  /* Layout */
  --sidebar-w:   258px;
  --sidebar-w-collapsed: 72px;
  --topbar-h:    64px;
  --infobar-h:   34px;     /* horní pruh kontaktů (jako web) */

  /* Přechody */
  --t-fast:  .15s ease;
  --t-base:  .22s ease;
  --t-slow:  .35s cubic-bezier(.34,1.56,.64,1);

  /* Typografie */
  --font-body:    'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head:    'Roboto Condensed', 'Exo 2', sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}


/* ──────────────────────────────────────────────────────────────────────────
   2) BASE RESET & TYPOGRAFIE
   ────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0 0 .6em;
}
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 .9rem; }

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { text-decoration: underline; }

code, kbd, pre {
  font-family: var(--font-mono);
  font-size: .92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

::selection { background: rgba(240,180,41,.35); }

/* Šedý popisek pomocný */
.muted     { color: var(--text-muted); }
.text-center { text-align: center; }
.hint      { color: var(--text-soft); font-size: .9rem; line-height: 1.5; }
.field-hint { color: var(--text-muted); font-size: .82rem; margin: .3rem 0 0; }
.warn-inline { color: var(--warn-fg); }


/* ──────────────────────────────────────────────────────────────────────────
   3) APP SHELL — TOPBAR / SIDEBAR / CONTENT
   ────────────────────────────────────────────────────────────────────────── */

/* HOTFIX 2C-2.1 — sprite SVG host
 * Inline SVG sprite (`assets/icons.svg`) je injektovaný hned za <body> přes
 * _layout.php a používán `<use href="#i-…">`. I když má root <svg> v souboru
 * `style="display:none"`, některé enginy (Chromium s backdrop-filter v topbaru)
 * mu navzdory tomu rezervovaly ~32px vertikálního prostoru → vznikal bílý
 * pruh pod topbarem před `.app-shell`. Tato pravidla garantují, že sprite
 * nikdy nezasáhne do layoutu, bez ohledu na atributy v icons.svg. */
.et-sprite-host,
.et-sprite-host > svg {
  position: absolute;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

/* ===== Tenký horní info-pruh (kontakty, jako web) ===== */
.app-infobar {
  background: var(--navy3);
  color: rgba(255,255,255,.8);
  font-size: .76rem;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: var(--infobar-h);
  gap: 1rem;
}
.app-infobar .ib-group { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.app-infobar a { color: rgba(255,255,255,.85); }
.app-infobar a:hover { color: var(--gold); text-decoration: none; }
.app-infobar .et-ico { color: var(--gold); margin-right: .3em; vertical-align: -2px; }

.ib-emergency {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .15rem .55rem;
  background: rgba(231,76,60,.18);
  color: #ffb1a6;
  border: 1px solid rgba(231,76,60,.42);
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .68rem;
  animation: pulseEmergency 2.6s infinite;
}
.ib-emergency .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emergency);
  box-shadow: 0 0 8px var(--emergency);
}

/* ===== Hlavní topbar (logo + akce + uživatel) ===== */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  height: var(--topbar-h);
  background: rgba(10,22,40,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.app-topbar .topbar-burger {
  display: none;
  background: transparent; border: 0;
  color: #fff; cursor: pointer;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  transition: background var(--t-fast);
}
.app-topbar .topbar-burger:hover { background: rgba(255,255,255,.08); }

.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 1.05rem;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand img {
  height: 34px; width: auto; display: block;
  filter: drop-shadow(0 0 8px rgba(240,180,41,.35));
  transition: filter var(--t-base);
}
.brand:hover img { filter: drop-shadow(0 0 14px rgba(240,180,41,.6)); }
.brand-sub {
  font-size: .68rem;
  letter-spacing: .14em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 1px;
}
.brand-name-wrap { display: flex; flex-direction: column; line-height: 1; }

.topbar-spacer { flex: 1; }

.topbar-clock {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: rgba(255,255,255,.75);
  padding: .3rem .65rem;
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  letter-spacing: .04em;
}

.topbar-user {
  display: flex; align-items: center; gap: .65rem;
  color: rgba(255,255,255,.92);
  font-size: .9rem;
}
.user-chip {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .3rem .65rem .3rem .35rem;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  transition: background var(--t-fast);
  cursor: pointer;
}
.user-chip:hover { background: rgba(255,255,255,.12); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .02em;
  box-shadow: var(--shadow-gold);
  flex-shrink: 0;
}
.user-name { font-weight: 600; }
.user-role { color: var(--gold); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

/* User dropdown menu */
.user-menu {
  position: relative;
}
.user-menu-pop {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: .35rem;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 60;
}
.user-menu.is-open .user-menu-pop {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.user-menu-pop a, .user-menu-pop button {
  display: flex; align-items: center; gap: .6rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0; background: transparent;
  text-align: left;
  color: var(--text);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .9rem;
  cursor: pointer;
}
.user-menu-pop a:hover, .user-menu-pop button:hover {
  background: var(--surface-soft); text-decoration: none;
}
.user-menu-pop .menu-sep { border-top: 1px solid var(--border-soft); margin: .3rem -.35rem; }
.user-menu-pop .et-ico { color: var(--text-muted); }


/* ===== Sidebar ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h) - var(--infobar-h));
}

.app-sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: #cdd6e6;
  padding: 1.1rem .75rem 1.5rem;
  position: sticky;
  top: calc(var(--topbar-h) + var(--infobar-h));
  align-self: start;
  height: calc(100vh - var(--topbar-h) - var(--infobar-h));
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15); border-radius: 3px;
}

.sb-group {
  margin-bottom: 1.1rem;
}
.sb-group-title {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.4);
  padding: 0 .85rem .4rem;
  font-weight: 600;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .85rem;
  border-radius: var(--radius-sm);
  color: #cdd6e6;
  font-weight: 500;
  font-size: .92rem;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
  position: relative;
  margin-bottom: 2px;
}
.sb-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.sb-item.is-active {
  background: rgba(240,180,41,.15);
  color: #fff;
}
.sb-item.is-active::before {
  content: ""; position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--gold);
  border-radius: 2px;
}
.sb-item .et-ico {
  color: rgba(255,255,255,.7);
  flex-shrink: 0;
}
.sb-item.is-active .et-ico { color: var(--gold); }

.sb-item.is-disabled {
  opacity: .45; pointer-events: none; cursor: not-allowed;
}
.sb-badge {
  margin-left: auto;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: rgba(240,180,41,.2);
  color: var(--gold);
  font-weight: 600;
}

.sb-foot {
  margin-top: auto;
  padding: 1rem .85rem;
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  border-top: 1px solid rgba(255,255,255,.05);
}

/* ===== Hlavní obsah ===== */
.app-content {
  padding: 1.6rem 2rem 3rem;
  max-width: 1320px;
  width: 100%;
}

/* Drobečková navigace */
.breadcrumb {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb .sep { color: var(--text-muted); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-head h1 { margin: 0 0 .25rem; }
.page-head p  { margin: 0; color: var(--text-soft); }

/* Role banner — barva podle role */
.role-banner {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem;
  border-radius: var(--radius);
  background: var(--info-bg);
  color: var(--info-fg);
  border: 1px solid var(--info-border);
  margin-bottom: 1.4rem;
}
.role-banner strong { display: block; }
.role-banner .muted { font-size: .85rem; color: inherit; opacity: .8; }
.role-banner-brand { background: rgba(10,22,40,.06); border-color: rgba(10,22,40,.15); color: var(--navy); }
.role-banner-gold  { background: rgba(240,180,41,.12); border-color: rgba(240,180,41,.35); color: #6b4e00; }
.role-banner .tile-icon, .role-banner .et-ico { color: var(--gold); }


/* ──────────────────────────────────────────────────────────────────────────
   4) CARDS & MODULY (dashboard dlaždice)
   ────────────────────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
}

.module-card {
  position: relative;
  display: flex; flex-direction: column;
  gap: .55rem;
  padding: 1.2rem 1.1rem 1.1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  animation: card-in .45s var(--t-slow) both;
}
.module-card::before {
  content: ""; position: absolute;
  inset: 0 auto 0 0; width: 4px;
  background: var(--navy);
  opacity: .85;
}
.module-card.accent-gold::before { background: var(--gold); }
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border);
  text-decoration: none;
}
.module-card.accent-gold:hover { box-shadow: 0 12px 28px rgba(240,180,41,.22); }

.module-card h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -.005em;
}
.module-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: .9rem;
  line-height: 1.5;
}

.module-disabled {
  opacity: .65;
  cursor: not-allowed;
}
.module-disabled:hover {
  transform: none;
  box-shadow: var(--shadow-xs);
}

.tile-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(10,22,40,.06);
  color: var(--navy);
  margin-bottom: .35rem;
  transition: transform var(--t-base), background var(--t-base);
}
.module-card.accent-gold .tile-icon {
  background: rgba(240,180,41,.15); color: var(--gold-dark);
}
.module-card:hover .tile-icon { transform: rotate(-4deg) scale(1.05); }

.tile-badge {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 1;
}

/* Prázdný stav po RBAC filtru */
.dash-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: .75rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.dash-empty .et-ico { width: 38px; height: 38px; color: var(--text-muted); }


/* ──────────────────────────────────────────────────────────────────────────
   5) PANELY & TABULKY
   ────────────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
  animation: card-in .35s ease both;
}
.panel-head {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin: -.4rem -.5rem 1rem;
  padding: 0 .5rem .75rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
table.data thead th {
  text-align: left;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .65rem .8rem;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody td {
  padding: .8rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.row-inactive { opacity: .55; }
table.data tbody tr:hover { background: var(--surface-soft); }

table.data .cell-name  { font-weight: 600; }
table.data .cell-email { color: var(--text-soft); font-family: var(--font-mono); font-size: .85rem; }
table.data .col-actions { text-align: right; white-space: nowrap; }
table.data .empty-row td {
  text-align: center; padding: 2rem; color: var(--text-muted);
}


/* ──────────────────────────────────────────────────────────────────────────
   6) FORMULÁŘE
   ────────────────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.form-grid > div { display: flex; flex-direction: column; }

label {
  font-weight: 600;
  font-size: .84rem;
  letter-spacing: .03em;
  color: var(--text);
  margin-bottom: .35rem;
  display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  padding: .65rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,180,41,.18);
}
input[disabled], select[disabled] {
  background: var(--surface-soft); color: var(--text-muted); cursor: not-allowed;
}

textarea { min-height: 110px; resize: vertical; }

.checkbox-row {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .6rem 0;
}
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.checkbox-row label { margin: 0; }
.checkbox-row .field-hint { margin-top: .15rem; }

.btn-row {
  display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
  margin-top: 1rem;
}

.inline-form { margin: 0; }
.inline-form .btn-row { margin-top: .75rem; }


/* ──────────────────────────────────────────────────────────────────────────
   7) BUTTONS, BADGES, ALERTS
   ────────────────────────────────────────────────────────────────────────── */
.btn, button.btn, button:not([type]):not(.copy-secret):not(.topbar-burger),
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .02em;
  padding: .65rem 1.1rem;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), transform .08s ease, box-shadow var(--t-fast);
  text-decoration: none;
}
.btn:hover, button[type="submit"]:hover {
  background: #142340;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active, button[type="submit"]:active { transform: translateY(0); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--surface-soft); border-color: var(--text-muted); }

.btn-danger {
  background: #c0392b;
  color: #fff;
}
.btn-danger:hover { background: #a83227; }

.btn-sm {
  padding: .4rem .8rem;
  font-size: .82rem;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(10,22,40,.07);
  color: var(--text);
}
.badge-ok     { background: var(--ok-bg);    color: var(--ok-fg); }
.badge-danger { background: var(--error-bg); color: var(--error-fg); }
.badge-off    { background: rgba(0,0,0,.06); color: var(--text-muted); }
.badge-gold   { background: rgba(240,180,41,.2); color: #6b4e00; }
.badge-role   { background: var(--info-bg); color: var(--info-fg); }

/* Alerts */
.alert-ok, .alert-error, .alert-warning, .alert-info {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: .92rem;
  margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: .55rem;
  animation: card-in .25s ease both;
}
.alert-ok       { background: var(--ok-bg);    color: var(--ok-fg);    border-color: var(--ok-border); }
.alert-error    { background: var(--error-bg); color: var(--error-fg); border-color: var(--error-border); }
.alert-warning  { background: var(--warn-bg);  color: var(--warn-fg);  border-color: var(--warn-border); }
.alert-info     { background: var(--info-bg);  color: var(--info-fg);  border-color: var(--info-border); }


/* ──────────────────────────────────────────────────────────────────────────
   8) 2FA, MODAL, RECOVERY
   ────────────────────────────────────────────────────────────────────────── */
.block { margin-bottom: 1.6rem; }
.block-highlight {
  background: linear-gradient(135deg, #fffbe6, #fff4cc);
  border: 1px solid rgba(240,180,41,.45);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.recovery-grid {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .55rem;
}
.recovery-grid li {
  background: #fff;
  border: 1px dashed #d49824;
  border-radius: var(--radius-sm);
  padding: .55rem .7rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: .95rem;
  letter-spacing: .08em;
  color: var(--text);
}

.status-ok {
  color: var(--ok-fg);
  font-weight: 600;
  font-size: 1rem;
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(10,22,40,.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.modal:target { display: flex; }
.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.7rem 1.8rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: card-in .35s var(--t-slow) both;
}
.modal-card.danger { border-top: 4px solid #c0392b; }
.modal-card h2 { margin-top: 0; color: #c0392b; }


/* ──────────────────────────────────────────────────────────────────────────
   9) LOGIN / SPLASH
   ────────────────────────────────────────────────────────────────────────── */
body.app-body {
  background:
    radial-gradient(ellipse at top left,  rgba(240,180,41,.08), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(10,22,40,.06), transparent 60%),
    var(--bg);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.1rem 2.2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: card-in .5s var(--t-slow) both;
}
.card-wide { max-width: 720px; }

.login-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: .75rem;
  margin-bottom: 1.6rem;
}
.login-hero img {
  height: 56px; width: auto;
  filter: drop-shadow(0 0 12px rgba(240,180,41,.4));
}
.login-hero h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: .02em;
}
.login-hero .login-sub {
  color: var(--text-muted);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-back {
  margin-top: 1.2rem;
  text-align: center;
  font-size: .9rem;
}


/* ──────────────────────────────────────────────────────────────────────────
   10) Ikona helper
   ────────────────────────────────────────────────────────────────────────── */
.et-ico {
  display: inline-block;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}


/* ──────────────────────────────────────────────────────────────────────────
   11) RESPONSIVE
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .app-infobar { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 80%; max-width: 320px;
    height: 100vh;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.is-open { transform: translateX(0); }
  .app-topbar .topbar-burger { display: inline-flex; }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(10,22,40,.5);
    z-index: 65;
    opacity: 0; pointer-events: none;
    transition: opacity var(--t-fast);
  }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .app-content { padding: 1.2rem 1rem 2.5rem; }
  .topbar-clock, .topbar-user .user-name { display: none; }
  .user-role { display: none; }
}

@media (max-width: 560px) {
  h1 { font-size: 1.45rem; }
  .panel { padding: 1.1rem; }
  .card  { padding: 1.4rem 1.2rem; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
}


/* ──────────────────────────────────────────────────────────────────────────
   12) ANIMACE
   ────────────────────────────────────────────────────────────────────────── */
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseEmergency {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.55); }
  50%      { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}


/* ──────────────────────────────────────────────────────────────────────────
   13) PŮVODNÍ "tech dashboard" + auth ergonomie (zachováno)
   ────────────────────────────────────────────────────────────────────────── */
.tech-dash { text-align: center; }
.tech-greeting { margin-bottom: 1.2rem; }
.tech-app-cta {
  display: inline-flex !important;
  font-size: 1.05rem;
  padding: .85rem 1.4rem;
  margin: 0 auto;
}
.tech-section-title {
  margin-top: 1.6rem;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: var(--font-body);
  font-weight: 600;
}
.tech-profile-link { margin-top: 1.4rem; }


/* ──────────────────────────────────────────────────────────────────────────
   14) ETAPA 2B — Topbar actions / Command palette / Notifikace / Toasty
   ────────────────────────────────────────────────────────────────────────── */

/* ── 14.1) Topbar action buttons (search + bell) ─────────────────────────── */
.tb-action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  height: 38px;
  padding: 0 .75rem;
  margin-right: .35rem;
  background: rgba(255,255,255,.05);
  color: #f6f7fb;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  font: 500 .9rem var(--font-body);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  position: relative;
}
.tb-action:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(240,180,41,.35);
}
.tb-action:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.tb-action svg { flex: 0 0 auto; }

.tb-search-trigger {
  min-width: 220px;
  justify-content: flex-start;
}
.tb-search-label {
  flex: 1;
  text-align: left;
  color: rgba(246,247,251,.7);
  font-weight: 400;
}
.tb-kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font: 600 .72rem var(--font-mono);
  color: rgba(246,247,251,.85);
  background: rgba(10,22,40,.55);
  border: 1px solid rgba(255,255,255,.12);
  border-bottom-width: 2px;
  border-radius: 4px;
  letter-spacing: .04em;
}

.tb-notif-trigger { padding: 0 .65rem; }
.tb-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--emergency);
  border: 2px solid var(--navy3);
  border-radius: 50%;
}

/* ── 14.2) Notifikace dropdown ──────────────────────────────────────────── */
.notif-menu { position: relative; }
.notif-pop {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  min-width: 340px;
  max-width: calc(100vw - 1.5rem);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 80;
}
.notif-menu.is-open .notif-pop {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.notif-head strong { font: 600 .95rem var(--font-head); letter-spacing: .02em; }
.notif-count { font-size: .78rem; color: var(--text-muted); }
.notif-body { max-height: 360px; overflow-y: auto; padding: .25rem 0; }
.notif-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: .25rem;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.notif-empty svg { opacity: .35; margin-bottom: .35rem; }
.notif-empty p { margin: 0; font-weight: 600; color: var(--text-soft); }
.notif-empty span { font-size: .8rem; }
.notif-foot {
  padding: .55rem 1rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-soft);
}
.notif-foot-hint { font-size: .76rem; color: var(--text-muted); }

/* ── 14.3) Command palette (dialog) ─────────────────────────────────────── */
html.cmd-open { overflow: hidden; }

.cmd-palette {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  animation: cmd-fade-in var(--t-fast);
}
.cmd-palette[hidden] { display: none; }

.cmd-palette-backdrop {
  position: absolute; inset: 0;
  background: rgba(6,16,33,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.cmd-palette-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 28px 64px rgba(6,16,33,.45);
  overflow: hidden;
  animation: cmd-pop-in var(--t-slow);
}
.cmd-palette-input-wrap {
  display: flex; align-items: center; gap: .65rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
}
.cmd-palette-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font: 500 1rem var(--font-body);
  color: var(--text);
}
.cmd-palette-input::placeholder { color: var(--text-muted); }
.cmd-palette-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.cmd-palette-close:hover { background: var(--bg); color: var(--text); }

.cmd-palette-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: .35rem 0;
}
.cmd-palette-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

.cmd-row {
  display: grid;
  grid-template-columns: 78px 1fr auto 14px;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  text-decoration: none;
  color: var(--text);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.cmd-row:hover { background: var(--bg); }
.cmd-row.is-active {
  background: var(--info-bg);
  border-left-color: var(--gold);
}
.cmd-row-type {
  font: 600 .68rem var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
}
.cmd-row-type-nav  { background: var(--info-bg);  color: var(--info-fg);  }
.cmd-row-type-user { background: var(--ok-bg);    color: var(--ok-fg);    }
.cmd-row-label {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmd-row-sub {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmd-row-arrow { color: var(--text-muted); opacity: .65; }
.cmd-row.is-active .cmd-row-arrow { color: var(--info-fg); opacity: 1; }

.cmd-palette-foot {
  display: flex; gap: 1.1rem;
  padding: .55rem 1rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-soft);
  font-size: .76rem;
  color: var(--text-muted);
}
.cmd-palette-foot kbd {
  display: inline-block;
  padding: 1px 5px;
  font: 600 .7rem var(--font-mono);
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  margin-right: 2px;
}

/* Skeleton řádky během načítání */
.cmd-skel-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
}
.cmd-skel-dot {
  width: 78px; height: 18px;
  background: linear-gradient(90deg, var(--border-soft) 0%, var(--bg) 50%, var(--border-soft) 100%);
  background-size: 200% 100%;
  border-radius: 999px;
  animation: skel-shimmer 1.2s linear infinite;
}
.cmd-skel-line {
  flex: 1; height: 14px;
  background: linear-gradient(90deg, var(--border-soft) 0%, var(--bg) 50%, var(--border-soft) 100%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: skel-shimmer 1.2s linear infinite;
}

@keyframes cmd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmd-pop-in  {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 14.4) Toast stack ─────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 300;
  display: flex; flex-direction: column;
  gap: .55rem;
  pointer-events: none;          /* host nezachytává; toasty samy ano */
  max-width: calc(100vw - 2rem);
  width: 360px;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: start;
  gap: .65rem;
  padding: .75rem .9rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  line-height: 1.35;
  transition: transform var(--t-base), opacity var(--t-base);
}
.toast.is-entering { opacity: 0; transform: translateX(20px); }
.toast.is-leaving  { opacity: 0; transform: translateX(20px); }
.toast-msg { word-wrap: break-word; }

.toast-info    { border-left-color: var(--info-fg);  }
.toast-info  svg:first-child { color: var(--info-fg); }
.toast-success { border-left-color: var(--ok-fg);    }
.toast-success svg:first-child { color: var(--ok-fg); }
.toast-warn    { border-left-color: var(--warn-fg);  background: #fffaef; }
.toast-warn  svg:first-child { color: var(--warn-fg); }
.toast-error   { border-left-color: var(--error-fg); background: #fff5f5; }
.toast-error svg:first-child { color: var(--error-fg); }

.toast-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.toast-close:hover { background: var(--bg); color: var(--text); }

/* ── 14.5) Mobile úpravy ────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .tb-search-label { display: none; }
  .tb-kbd { display: none; }
  .tb-search-trigger {
    min-width: 0;
    width: 38px;
    justify-content: center;
    padding: 0;
  }
}
@media (max-width: 560px) {
  .notif-pop { min-width: 280px; }
  .cmd-palette { padding: 6vh .75rem 1rem; }
  .cmd-row { grid-template-columns: 62px 1fr auto; }
  .cmd-row-arrow { display: none; }
  .cmd-palette-foot { flex-wrap: wrap; gap: .5rem 1rem; }
}

/* ──────────────────────────────────────────────────────────────────────────
   ETAPA 2C — CRM modul (klienti, kontakty, poznámky, projekty, ARES)
   ──────────────────────────────────────────────────────────────────────────
   Konvence: nepřepisujeme nic z předchozí etapy, jen rozšiřujeme.
   Třídy `table.data`, `.col-actions`, `.cell-name`, `.cell-email`, `.empty-row`,
   `.muted` a `.badge` jsou definovány výše (sekce 5/7/2) — POUZE rozšiřujeme
   o nové selektory (např. `.cell-note`), nikdy nepřepisujeme původní hodnoty.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Drobné utility ──────────────────────────────────────────────────── */
.small    { font-size: .8rem; }
.req      { color: var(--gold-dark); font-weight: 700; }

/* ── Form grid — span napříč dvěma sloupci pro dlouhé položky ───────── */
.form-grid-span-2 { grid-column: span 2; }
@media (max-width: 720px) {
  .form-grid-span-2 { grid-column: span 1; }
}

/* ── CRM tabulky — jen nové buňkové selektory ────────────────────────── */
table.data .cell-name a { color: var(--link); text-decoration: none; }
table.data .cell-name a:hover { text-decoration: underline; }
table.data .cell-note { color: var(--text-muted); font-size: .85rem; }
table.data tr.empty-row a { color: var(--link); }

/* ── Filter form layout ──────────────────────────────────────────────── */
.filter-grid {
  /* 3 vstupy + akce, na malých displejích na sloupce */
  grid-template-columns: 1.5fr 1fr 1fr auto;
}
@media (max-width: 980px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .filter-grid { grid-template-columns: 1fr; }
}
.filter-actions {
  display: flex;
  align-items: end;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ── Segment tag (b2b / b2c / statni / prumysl / jine) ───────────────── */
.segment-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: rgba(0,0,0,.06);
  color: var(--text-soft);
}
.segment-tag.segment-b2b      { background: rgba(45, 122, 200, .14); color: #1c4d80; }
.segment-tag.segment-b2c      { background: rgba(75, 175, 80, .16);  color: #2c6b30; }
.segment-tag.segment-statni   { background: rgba(170, 80, 200, .14); color: #6a2b85; }
.segment-tag.segment-prumysl  { background: rgba(240, 140, 0, .16);  color: #845200; }
.segment-tag.segment-jine     { background: rgba(0,0,0,.06);         color: var(--text-muted); }

/* ── Status tag pro projekty ─────────────────────────────────────────── */
.status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-tag.status-nabidka     { background: rgba(45, 122, 200, .14); color: #1c4d80; }
.status-tag.status-aktivni     { background: rgba(75, 175, 80, .18);  color: #2c6b30; }
.status-tag.status-pozastaveno { background: rgba(240, 140, 0, .16);  color: #845200; }
.status-tag.status-dokoncen    { background: rgba(0,0,0,.06);         color: var(--text-muted); }
.status-tag.status-zruseno     { background: rgba(192, 57, 43, .14);  color: #8a2a1f; }

/* ── Inline badge v buňce „cell-name" (např. „Primární kontakt") ────── */
.cell-name .badge {
  margin-left: .4rem;
  vertical-align: middle;
}

/* ── Tabs (detail klienta) ───────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .15rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  padding-bottom: 0;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
  border-radius: 6px 6px 0 0;
}
.tab:hover {
  color: var(--text);
  background: var(--surface-soft);
}
.tab.is-active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
  background: var(--surface-soft);
}
.tab svg { width: 16px; height: 16px; }
.tab.tab-danger { color: #8a2a1f; }
.tab.tab-danger.is-active { border-bottom-color: #c0392b; color: #c0392b; }
.tab-count {
  background: rgba(0,0,0,.08);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: .15rem;
}
.tab.is-active .tab-count {
  background: var(--gold);
  color: #6b4e00;
}

/* ── ARES lookup (IČO + tlačítko + status řádek) ─────────────────────── */
.ares-row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}
.ares-row input {
  flex: 1 1 auto;
  min-width: 0;
}
.ares-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ares-row .btn.is-busy {
  opacity: .7;
  cursor: progress;
}
.ares-row .btn.is-busy svg {
  animation: ares-spin 1s linear infinite;
}
@keyframes ares-spin { to { transform: rotate(360deg); } }

.ares-status {
  margin-top: .35rem;
  min-height: 1.1em;
  font-size: .82rem;
  color: var(--text-muted);
  transition: color .15s ease;
}
.ares-status[data-kind="busy"]  { color: var(--text-soft); }
.ares-status[data-kind="ok"]    { color: #2c6b30; }
.ares-status[data-kind="warn"]  { color: #845200; }
.ares-status[data-kind="error"] { color: #8a2a1f; }

/* Krátké zvýraznění právě vyplněného pole. */
.ares-filled {
  background: rgba(75, 175, 80, .12) !important;
  transition: background .8s ease;
}

/* ── Timeline (poznámky ke klientovi) ────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline-item {
  position: relative;
  padding: .85rem 0 .85rem 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1.3rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,180,41,.18);
}
.timeline-meta {
  font-size: .82rem;
  color: var(--text-soft);
  margin-bottom: .3rem;
}
.timeline-body {
  color: var(--text);
  font-size: .92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Empty state v záložkách / panelech ──────────────────────────────── */
.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Meta footer (vytvořil / upraveno) ──────────────────────────────── */
.meta-footer {
  margin-top: 1.25rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--border-soft);
  font-size: .78rem;
  color: var(--text-muted);
}

/* ── Danger panel (sekce „Nebezpečná zóna") ─────────────────────────── */
.panel-danger {
  border: 1px solid rgba(192, 57, 43, .4);
  background: linear-gradient(180deg, rgba(192,57,43,.04), var(--surface));
}
.panel-danger .panel-head {
  color: #8a2a1f;
  border-bottom-color: rgba(192, 57, 43, .25);
}
.panel-danger label strong { color: #8a2a1f; }

/* ── Checkbox label (nepřípustný stav: jen pro CRM kontakty) ─────────── */
label.checkbox {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 500;
  cursor: pointer;
}
label.checkbox input { margin: 0; }

/* ── Cmd palette: typ "client" — barevně odlišíme od user/nav ────────── */
.cmd-row-type-client {
  background: rgba(45, 122, 200, .14);
  color: #1c4d80;
}
.cmd-row-type-project {
  background: rgba(75, 175, 80, .18);
  color: #2c6b30;
}
.cmd-row-type-ticket {
  background: rgba(240, 140, 0, .16);
  color: #845200;
}

/* ════════════════════════════════════════════════════════════════════════
   2C-2 / 4-cherry  —  KPI, audit, pagination, project pages
   ════════════════════════════════════════════════════════════════════════ */

/* ── KPI mini-cards (Projekty, Audit) ─────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.kpi-label {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.kpi-value {
  font-family: "Exo 2", system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

/* ── Empty state icon (project_detail "Úkoly") ────────────────────────── */
.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--text-muted);
  opacity: .55;
}
.empty-state-icon svg { width: 48px; height: 48px; }
.empty-state h3 {
  margin: .5rem 0 .35rem;
  font-family: "Exo 2", system-ui, sans-serif;
  color: var(--text);
}

/* ── Audit log tabulka — fixní font pro action sloupec ───────────────── */
.audit-table td { vertical-align: top; }
.audit-table .cell-note {
  max-width: 480px;
  white-space: normal;
  word-break: break-word;
}
.audit-action {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .82rem;
  padding: .1rem .45rem;
  border-radius: 6px;
  background: rgba(0,0,0,.05);
  color: var(--text);
  white-space: nowrap;
}
.audit-action-link { text-decoration: none; }
.audit-action-link:hover .audit-action { background: rgba(212, 175, 55, .25); }

/* Akce s tečkou v názvu (např. client.create) — zvýrazněný prefix */
.audit-action::first-letter { font-weight: 600; }

/* Muted-link — dceřiný odkaz v audit tabulce a project_detail "Zpět k klientovi" */
.muted-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.muted-link:hover {
  color: var(--text);
  border-bottom-color: var(--gold);
}

/* ── Pagination (audit log) ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  justify-content: center;
}

/* ── Project status — doplnění chybějícího barevného tagu ────────────── */
.segment-tag {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  background: rgba(0,0,0,.06);
  color: var(--text-muted);
}
.segment-tag.segment-b2b      { background: rgba(45, 122, 200, .14); color: #1c4d80; }
.segment-tag.segment-b2c      { background: rgba(75, 175, 80, .18); color: #2c6b30; }
.segment-tag.segment-statni   { background: rgba(120, 80, 200, .14); color: #4b2c83; }
.segment-tag.segment-prumysl  { background: rgba(240, 140, 0, .16);  color: #845200; }
.segment-tag.segment-jine     { background: rgba(0,0,0,.06);         color: var(--text-muted); }


/* ════════════════════════════════════════════════════════════════════════
   ETAPA 3A — PWA install UI
   --------------------------------------------------------------------------
   Dvě komponenty:
     1) Položka v user-menu (button uvnitř `.user-menu-pop`)
     2) Spodní install banner (sticky, dismissable)
   Obě se ukazují jen když `beforeinstallprompt` event přišel (Chromium).
   ════════════════════════════════════════════════════════════════════════ */

/* 1) User-menu položka — vypadá jako ostatní <a> v dropdownu,
      jen je to <button> (kvůli `data-pwa-install` JS handleru). */
.user-menu-install {
  display: flex; align-items: center; gap: .6rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--text);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .9rem;
  cursor: pointer;
  transition: background var(--t-fast);
}
.user-menu-install:hover {
  background: var(--surface-soft);
}
.user-menu-install .et-ico { color: var(--gold-dark); }

/* 2) Bottom install banner — pozice nad toast stackem,
      neblokuje obsah (auto-hide na úzkých displejích). */
.pwa-install-banner {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 290;            /* pod toasty (300) → toast je důležitější */
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 480px;
  padding: .85rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: card-in .35s var(--t-slow) both;
}
.pwa-install-banner[hidden] { display: none; }

.pwa-install-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
  border-radius: 10px;
  box-shadow: var(--shadow-gold);
}

.pwa-install-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.pwa-install-body strong {
  font-family: var(--font-head);
  font-size: .98rem;
  letter-spacing: .01em;
}
.pwa-install-body span {
  color: var(--text-soft);
  font-size: .82rem;
  line-height: 1.4;
}

.pwa-install-actions {
  flex: 0 0 auto;
  display: flex;
  gap: .4rem;
  align-items: center;
}

/* Mobile — banner na celou šířku, akce pod textem */
@media (max-width: 560px) {
  .pwa-install-banner {
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    max-width: none;
    flex-wrap: wrap;
  }
  .pwa-install-icon { width: 36px; height: 36px; }
  .pwa-install-body { flex: 1 1 100%; order: 1; }
  .pwa-install-actions {
    flex: 1 1 100%;
    order: 2;
    justify-content: flex-end;
  }
  .pwa-install-icon { order: 0; }
}

/* Když je app spuštěná jako standalone PWA — schovat banner natvrdo
   pojistka pro případ, že by se JS dostal pozdě k `display-mode: standalone`. */
@media (display-mode: standalone) {
  .pwa-install-banner { display: none !important; }
  .user-menu-install  { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   ETAPA 2C-3 — RBAC Permissions UI
   --------------------------------------------------------------------------
   Matice rolí × oprávnění na stránce /admin/permissions.php.
   Komponenty:
     .perm-matrix-wrap   — horizontálně scrollovatelný kontejner
     .perm-matrix        — tabulka (rozšiřuje .data)
     .perm-col-slug      — sloupec se slugem oprávnění
     .perm-col-desc      — sloupec s popisem
     .perm-col-role      — sloupec pro každou roli (zarovnání na střed)
     .perm-col-check     — buňka s toggle tlačítkem
     .perm-role-head     — hlavička sloupce role (badge + název + počet)
     .perm-group-row     — řádek skupiny oprávnění (prefix)
     .perm-group-label   — buňka skupiny
     .perm-toggle-form   — inline form (bez marginu)
     .perm-toggle-btn    — tlačítko přepínání (✓/✗)
     .perm-check-always  — ikona pro admin (vždy povoleno)
   ════════════════════════════════════════════════════════════════════════ */

/* Horizontální scroll pro velké matice (mnoho rolí). */
.perm-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

/* Tabulka matice — rozšiřuje .data. */
.perm-matrix {
  min-width: 600px;
  border-collapse: collapse;
  width: 100%;
}

/* Sloupce šířky. */
.perm-col-slug  { width: 200px; min-width: 160px; }
.perm-col-desc  { min-width: 180px; color: var(--text-soft); font-size: .88rem; }
.perm-col-role  { width: 110px; min-width: 90px; text-align: center; }
.perm-col-check { text-align: center; vertical-align: middle; padding: .4rem .3rem; }

/* Hlavička sloupce role. */
.perm-role-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  padding: .3rem 0;
}
.perm-role-name {
  font-size: .78rem;
  color: var(--text-soft);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.perm-role-users {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Řádek skupiny oprávnění (prefix). */
.perm-group-row td.perm-group-label {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .45rem .8rem;
  border-top: 1px solid var(--border);
}
.perm-group-label .et-ico {
  color: var(--gold-dark);
  vertical-align: middle;
  margin-right: .3rem;
}

/* Toggle tlačítko — přepíná oprávnění. */
.perm-toggle-form {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.perm-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  font-size: 0;
  padding: 0;
}
.perm-toggle-btn.is-granted {
  background: rgba(39, 174, 96, .15);
  border-color: rgba(39, 174, 96, .4);
  color: #1e8449;
}
.perm-toggle-btn.is-granted:hover {
  background: rgba(192, 57, 43, .12);
  border-color: rgba(192, 57, 43, .4);
  color: #c0392b;
}
.perm-toggle-btn.is-denied {
  background: rgba(0, 0, 0, .04);
  border-color: var(--border);
  color: var(--text-muted);
}
.perm-toggle-btn.is-denied:hover {
  background: rgba(39, 174, 96, .12);
  border-color: rgba(39, 174, 96, .4);
  color: #1e8449;
}
.perm-toggle-btn:active {
  transform: scale(.9);
}

/* Admin — vždy povoleno (shield ikona). */
.perm-check-always {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--gold-dark);
  opacity: .7;
}

/* Hint v panel-head. */
.panel-head-hint {
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: .6rem;
}

/* Mobilní úpravy. */
@media (max-width: 720px) {
  .perm-col-desc { display: none; }
  .perm-col-slug { width: 140px; min-width: 120px; }
  .perm-col-role { width: 80px; min-width: 70px; }
  .perm-role-name { max-width: 70px; }
}

/* ════════════════════════════════════════════════════════════════════════
   ETAPA 2C-3b — Koš klientů + Bulk akce
   --------------------------------------------------------------------------
   Komponenty:
     .col-check          — sloupec s checkboxem (bulk výběr)
     .bulk-toolbar       — inline info v panel-head (N vybráno)
     .bulk-count-badge   — badge s počtem v odkazu na koš
     .bulk-action-bar    — sticky lišta s bulk akcemi (pod tabulkou)
     .bulk-action-label  — popis (N klientů vybráno)
     .bulk-action-btns   — skupina tlačítek
     .bulk-segment-wrap  — inline select + tlačítko pro změnu segmentu
     .bulk-segment-select— select pro výběr segmentu
     .trash-age          — věk záznamu v koši (normální)
     .trash-age-warn     — věk ≥ 30 dní (červeně)
     .trash-confirm-name — zvýrazněný název klienta v modalu
     .trash-actions      — buňka akcí v koši (flex)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Checkbox sloupec ────────────────────────────────────────────────── */
.col-check {
  width: 36px;
  min-width: 36px;
  text-align: center;
  padding: .4rem .3rem;
}
.col-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--gold-dark);
}

/* ── Bulk toolbar (v panel-head) ─────────────────────────────────────── */
.bulk-toolbar {
  font-size: .85rem;
  font-weight: 400;
  color: var(--gold-dark);
  margin-left: .5rem;
}

/* ── Badge s počtem v odkazu na koš ─────────────────────────────────── */
.bulk-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: .3rem;
  background: var(--emergency);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 999px;
  vertical-align: middle;
  line-height: 1;
}

/* ── Bulk action bar ─────────────────────────────────────────────────── */
.bulk-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  padding: .75rem 1.25rem;
  background: var(--info-bg);
  border-top: 1px solid var(--info-border, var(--border));
  border-radius: 0 0 var(--radius) var(--radius);
}
.bulk-action-bar[hidden] { display: none; }

.bulk-action-label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--info-fg);
  white-space: nowrap;
}

.bulk-action-btns {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ── Inline segment select v bulk baru ───────────────────────────────── */
.bulk-segment-wrap {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.bulk-segment-select {
  height: 32px;
  padding: 0 .5rem;
  font: inherit;
  font-size: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

/* ── Koš — věk záznamu ───────────────────────────────────────────────── */
.trash-age {
  font-size: .88rem;
  color: var(--text-soft);
}
.trash-age-warn {
  font-size: .88rem;
  color: var(--error-fg);
  font-weight: 600;
}

/* ── Koš — buňka akcí (dvě tlačítka vedle sebe) ─────────────────────── */
.trash-actions {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Zvýrazněný název klienta v purge modalu ─────────────────────────── */
.trash-confirm-name {
  display: inline-block;
  margin-top: .25rem;
  padding: .2rem .55rem;
  background: rgba(192, 57, 43, .1);
  border: 1px dashed rgba(192, 57, 43, .4);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .92rem;
  color: #8a2a1f;
  word-break: break-all;
}

/* ── Modal — form-group (pro purge confirm input) ────────────────────── */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: .35rem;
  color: var(--text-soft);
}
.form-group input {
  width: 100%;
}

/* ── Mobilní úpravy ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .bulk-action-bar { flex-direction: column; align-items: flex-start; }
  .bulk-action-btns { width: 100%; }
}
@media (max-width: 560px) {
  .col-check { width: 28px; min-width: 28px; }
  .trash-actions { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════════════════════════════════════════════
   ETAPA 2D-1 — Helpdesk (Tickets)
   --------------------------------------------------------------------------
   Vlastní status & priority tagy (prefix tk- aby se nemíchaly s projekty),
   hero panel detailu, KPI tlačítka, quick-action panel, timeline pro
   komentáře a aktivitu, řádky po termínu (zvýraznění).
   ════════════════════════════════════════════════════════════════════════ */

/* ── KPI karty (filter switch) ────────────────────────────────────────── */
.tk-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem;
  margin: 1rem 0 1.4rem;
}
.tk-kpi {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-bg, #fff);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tk-kpi:hover {
  border-color: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.tk-kpi.is-active {
  border-color: var(--gold);
  background: rgba(212, 175, 55, .07);
}
.tk-kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-strong, #111);
  line-height: 1;
}
.tk-kpi-label {
  font-size: .82rem;
  color: var(--text-muted);
}
.tk-kpi-danger .tk-kpi-value { color: #8a2a1f; }

/* ── Status tagy ──────────────────────────────────────────────────────── */
.tk-status-tag,
.tk-priority-tag {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .01em;
}
.tk-status-tag.tk-status-new      { background: rgba(45, 122, 200, .14); color: #1c4d80; }
.tk-status-tag.tk-status-open     { background: rgba(75, 175, 80, .18);  color: #2c6b30; }
.tk-status-tag.tk-status-waiting  { background: rgba(240, 140, 0, .16);  color: #845200; }
.tk-status-tag.tk-status-resolved { background: rgba(0, 150, 130, .14);  color: #056b5f; }
.tk-status-tag.tk-status-closed   { background: rgba(0,0,0,.06);         color: var(--text-muted); }
.tk-status-tag.tk-status-overdue  { background: rgba(192, 57, 43, .14);  color: #8a2a1f; }

/* ── Priority ─────────────────────────────────────────────────────────── */
.tk-priority-tag.tk-priority-low    { background: rgba(0,0,0,.05);       color: var(--text-muted); }
.tk-priority-tag.tk-priority-normal { background: rgba(45, 122, 200, .1); color: #1c4d80; }
.tk-priority-tag.tk-priority-high   { background: rgba(240, 140, 0, .14); color: #845200; }
.tk-priority-tag.tk-priority-urgent {
  background: rgba(192, 57, 43, .16);
  color: #8a2a1f;
  box-shadow: inset 0 0 0 1px rgba(192, 57, 43, .35);
}

/* ── Tabulka ticketů ──────────────────────────────────────────────────── */
.tk-table .tk-cell-no { width: 110px; }
.tk-table .tk-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: .85rem;
}
.tk-row-overdue { background: rgba(192, 57, 43, .035); }
.tk-due-overdue {
  color: #8a2a1f;
  font-weight: 600;
}

/* ── Hero panel detailu ───────────────────────────────────────────────── */
.tk-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  padding: .9rem 1rem;
  margin: 0 0 1rem;
  background: linear-gradient(180deg, rgba(212,175,55,.05), transparent);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tk-hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}
.tk-hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem 1.4rem;
  flex: 1 1 auto;
  margin: 0;
}
.tk-hero-meta dt {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .15rem;
}
.tk-hero-meta dd {
  margin: 0;
  font-size: .92rem;
}

/* ── Quick actions panel ──────────────────────────────────────────────── */
.tk-quick .tk-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  padding: 1rem;
}
.tk-quick-form {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.tk-quick-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.tk-quick-row select { flex: 1 1 auto; }
.tk-quick-note {
  font-size: .85rem;
}

/* ── Komentáře ────────────────────────────────────────────────────────── */
.tk-timeline .timeline-item.tk-internal {
  border-left: 3px solid var(--gold);
  background: rgba(212, 175, 55, .06);
  padding-left: .8rem;
}
.tk-internal-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, .2);
  color: var(--gold-dark);
  margin-left: .4rem;
}

/* Řádek pod komentářovým textem (checkbox + tlačítko) */
.tk-comment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
}

/* ── Aktivita ─────────────────────────────────────────────────────────── */
.tk-activity-note {
  margin-top: .25rem;
  padding: .35rem .55rem;
  background: rgba(0,0,0,.03);
  border-radius: 6px;
  font-style: italic;
}

/* ── Filtry nad seznamem ──────────────────────────────────────────────── */
.tk-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .6rem;
  padding: .8rem 1rem;
  background: rgba(0,0,0,.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
}
.tk-filters .tk-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .tk-hero { flex-direction: column; align-items: flex-start; }
  .tk-quick .tk-quick-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════
   ETAPA 2D-2 — Helpdesk přílohy + Modul oznámení
   ════════════════════════════════════════════════════════════════════════ */

/* Pozn.: Přílohy se renderují uvnitř .panel (světlé pozadí), proto všechny
   barvy používáme z palety navy/text — žádné rgba(255,255,255,…). */

/* ── Přílohy: badge u tab nadpisu ─────────────────────────────────────── */
.tk-tab-count {
  display: inline-block;
  min-width: 1.5em;
  padding: 1px 6px;
  margin-left: .4rem;
  border-radius: 999px;
  background: rgba(240,180,41,.18);
  color: var(--gold-dark);
  font-size: .72rem;
  font-weight: 600;
  vertical-align: middle;
}

/* ── Přílohy: hlavička karty s počtem souborů ─────────────────────────── */
.tk-att-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tk-att-head h3 { margin: 0; }
.tk-att-head .tk-att-summary {
  color: var(--text-muted);
  font-size: .85rem;
}

/* ── Přílohy: prázdný stav (žádné soubory) ────────────────────────────── */
.tk-att-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
}
.tk-att-empty svg { color: var(--gold-dark); opacity: .55; }
.tk-att-empty strong { color: var(--text); }
.tk-att-empty small { font-size: .8rem; color: var(--text-muted); }

/* ── Přílohy: tabulka uložených příloh ────────────────────────────────── */
.tk-att-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.tk-att-table th,
.tk-att-table td {
  padding: .65rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  font-size: .9rem;
  vertical-align: middle;
}
.tk-att-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tk-att-table tbody tr:hover { background: var(--surface-soft); }
.tk-att-name-cell {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.tk-att-name-cell:hover { color: var(--gold-dark); text-decoration: underline; }
.tk-att-name-cell svg { color: var(--gold-dark); flex-shrink: 0; }
.tk-att-mime {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.tk-att-size {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}
.tk-att-actions {
  display: flex;
  gap: .4rem;
  justify-content: flex-end;
}
.tk-att-actions .btn {
  padding: .25rem .55rem;
  font-size: .8rem;
}

/* ── Přílohy: upload formulář s drag-and-drop ─────────────────────────── */
.tk-att-upload {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}
.tk-att-upload-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.tk-att-upload-head h4 {
  margin: 0;
  font-size: .95rem;
  color: var(--text);
}
.tk-att-upload-hint {
  font-size: .78rem;
  color: var(--text-muted);
}

/* Drag-and-drop zóna jako klikací label. */
.tk-att-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.5rem 1rem;
  border: 2px dashed rgba(240,180,41,.45);
  border-radius: 10px;
  background: rgba(240,180,41,.04);
  cursor: pointer;
  transition: all .15s ease;
  color: var(--text-soft);
  font-size: .9rem;
}
.tk-att-dropzone:hover {
  border-color: var(--gold);
  background: rgba(240,180,41,.08);
}
.tk-att-dropzone.is-dragover {
  border-color: var(--gold);
  background: rgba(240,180,41,.16);
  color: var(--gold-dark);
  transform: scale(1.01);
}
.tk-att-dropzone svg { color: var(--gold-dark); }
.tk-att-dropzone strong { color: var(--text); }
.tk-att-dropzone small { color: var(--text-muted); font-size: .78rem; }
.tk-att-dropzone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Fronta vybraných souborů (před odesláním). */
.tk-att-queue {
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.tk-att-q-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .4rem .65rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: .82rem;
}
.tk-att-q-name {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.tk-att-q-meta {
  color: var(--text-muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.tk-att-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .9rem;
}

/* ── Pomocný read-only state pro accountant/viewer (zatím nevyužito) ──── */
.tk-att-readonly {
  padding: .75rem 1rem;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: .85rem;
  text-align: center;
}


/* ══════════════════════════════════════════════════════════════════════
   Modul oznámení — feed v topbar dropdownu (světlá karta v .notif-pop).
   Pozn.: .notif-pop má background: var(--surface) z sekce 14.2,
   takže pracujeme s tmavým textem na světlém pozadí.
   ══════════════════════════════════════════════════════════════════════ */

/* Tečka/badge s počítadlem na zvonku — překrývá .tb-notif-dot z 14.1,
   protože nyní má text (počet). Pozici sjednotíme. */
.tb-notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  width: auto;
  height: 16px;
  padding: 0 4px;
  background: var(--emergency);
  color: #fff;
  border-radius: 8px;
  border: 2px solid var(--navy3);
  font-size: .65rem;
  font-weight: 700;
  line-height: 12px;       /* 16 - 2*border */
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Feed list — používán jen když máme položky. */
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 360px;
  overflow-y: auto;
}
.notif-item {
  border-bottom: 1px solid var(--border-soft);
}
.notif-item:last-child { border-bottom: none; }
.notif-link {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .7rem .9rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s ease;
}
.notif-link:hover { background: var(--surface-soft); text-decoration: none; }
.notif-item.is-unread .notif-link {
  background: rgba(240,180,41,.07);
  border-left: 3px solid var(--gold);
  padding-left: calc(.9rem - 3px);
}
.notif-item.is-unread .notif-link:hover {
  background: rgba(240,180,41,.13);
}
.notif-title {
  font-weight: 500;
  color: var(--text);
  font-size: .88rem;
  line-height: 1.3;
}
.notif-item.is-unread .notif-title { font-weight: 600; }
.notif-detail {
  color: var(--text-soft);
  font-size: .8rem;
  line-height: 1.35;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-meta {
  color: var(--text-muted);
  font-size: .72rem;
}

/* Footer dropdownu — "Označit vše jako přečtené" tlačítko. */
.notif-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .6rem .9rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-soft);
  font-size: .72rem;
}
.notif-foot-action {
  background: none;
  border: none;
  color: var(--gold-dark);
  font-size: .78rem;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}
.notif-foot-action:hover { text-decoration: underline; }
.notif-foot-hint {
  color: var(--text-muted);
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════
 *  ETAPA 3C — TRUSTED DEVICE
 * ════════════════════════════════════════════════════════════════════
 *  Komponenty:
 *    1) `.login-remember`         — checkbox "Zapamatovat zařízení" na loginu
 *    2) `.devices-table` + `.device-row` — tabulka zařízení v admin/me_devices
 *    3) `.badge-current`          — bonus odlišení aktuálního prohlížeče
 *    4) `.hint-list`              — vysvětlující odrážky v panelu "Jak to funguje"
 *
 *  Designové rozhodnutí: Žádné nové barvy do design tokens nezavádíme —
 *  všechny stavy mapujeme na existující --ok-*, --error-*, --warn-*,
 *  --gold-* proměnné, ať dark/light theme funguje out of the box.
 * ──────────────────────────────────────────────────────────────────── */

/* ── Login: "Zapamatovat zařízení" checkbox ───────────────────────────
 *  Volání je z `<label class="checkbox login-remember">` v login.php
 *  (krok TOTP). Bázový label.checkbox je definován níže v CRM sekci,
 *  zde mu jen přidáme card-look — bg, padding, hover. */
.login-remember {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: 0;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.login-remember:hover {
  border-color: var(--gold);
  background: rgba(240,180,41,.07);
}
.login-remember input[type="checkbox"] {
  margin-top: 3px;
  width: 16px; height: 16px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.login-remember > span {
  display: block;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--text);
  font-weight: 500;
}
.login-remember small {
  display: block;
  margin-top: .2rem;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Admin: tabulka důvěryhodných zařízení ──────────────────────────── */
.devices-table th,
.devices-table td {
  vertical-align: middle;
}
.devices-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}
.devices-table .ua {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.devices-table .small {
  font-size: .78rem;
}

/* Stavové varianty řádků — barevné akcenty levou hranou.
 * Důležité: pravidlo musí přepsat řádkový hover z `table.data tbody tr:hover`,
 * proto u opacity používáme samostatný selektor a u border-left necháváme
 * .cell-actions intaktní (úzký pruh jen u prvního sloupce). */
.device-row { transition: background-color var(--t-fast); }

.device-row--current   td:first-child {
  border-left: 3px solid var(--ok-fg);
}
.device-row--active    td:first-child {
  border-left: 3px solid var(--gold);
}
.device-row--revoked td,
.device-row--expired td {
  color: var(--text-muted);
}
.device-row--revoked td:first-child,
.device-row--expired td:first-child {
  border-left: 3px solid var(--error-border);
}
.device-row--revoked .badge,
.device-row--expired .badge { opacity: .85; }

/* ── Bonus badge: "tento prohlížeč" ─────────────────────────────────── */
.badge-current {
  margin-left: .35rem;
  background: var(--info-bg);
  color:      var(--info-fg);
  border: 1px solid var(--info-border);
  font-size: .68rem;
  letter-spacing: .02em;
  text-transform: lowercase;
}

/* ── Vysvětlující odrážky v "Jak to funguje" panelu ─────────────────── */
.hint-list {
  margin: .5rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-soft);
  font-size: .9rem;
  line-height: 1.55;
}
.hint-list li { margin: .25rem 0; }
.hint-list strong { color: var(--text); }

/* Tabulka na úzkém viewportu — povolíme horizontální scroll uvnitř .table-wrap.
 * (.table-wrap už projekt používá pro většinu admin tabulek; pokud chybí styl,
 *  přidáme defenzivně overflow-x: auto.) */
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .devices-table th:nth-child(3),
  .devices-table td:nth-child(3),
  .devices-table th:nth-child(4),
  .devices-table td:nth-child(4) {
    display: none; /* skryjeme IP a "Vytvořeno" — důležité je Stav + Akce */
  }
  .devices-table .ua { max-width: 14rem; }
}


/* =========================================================================
   ETAPA 3D — RELEASES (Update Engine) & DASHBOARD WIDGET „NOVINKY"
   -------------------------------------------------------------------------
   Sloty:
     .news-widget                  — dashboard widget (panel + zlatý akcent)
     .news-widget-breaking         — varianta s červeným pruhem (breaking)
     .news-changelog               — render Markdown changelogu (h1-h4, ul…)
     .releases-layout              — 2-sloupcový grid (list + editor) v adminu
     .releases-list / -item        — left rail seznamu releasů
     .releases-meta-grid           — meta-info publikovaného releasu (4 dlaždice)
     .check-row, .code-textarea    — drobné form helpery použité v editoru
   ========================================================================= */

/* ── Dashboard widget — „🆕 Novinky" ─────────────────────────────────────── */
.news-widget {
  border-left: 4px solid var(--gold);
  background: linear-gradient(180deg,
              rgba(240, 180, 41, .06) 0%,
              rgba(240, 180, 41, .02) 60%,
              transparent 100%);
}
.news-widget.news-widget-breaking {
  border-left-color: var(--emergency, #c0392b);
  background: linear-gradient(180deg,
              rgba(192, 57, 43, .08) 0%,
              rgba(192, 57, 43, .02) 60%,
              transparent 100%);
}
.news-widget .panel-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.news-widget .panel-head > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.news-changelog {
  padding: .25rem 1rem .25rem;
  font-size: .95rem;
  line-height: 1.55;
  color: var(--text);
}
.news-changelog h1,
.news-changelog h2,
.news-changelog h3,
.news-changelog h4 {
  font-family: var(--font-head);
  margin: .9rem 0 .35rem;
  color: var(--navy);
}
.news-changelog h1 { font-size: 1.25rem; }
.news-changelog h2 { font-size: 1.10rem; }
.news-changelog h3 { font-size: 1.00rem; }
.news-changelog h4 { font-size: .92rem; color: var(--gold-dark, #8a5a00); }
.news-changelog p { margin: .35rem 0; }
.news-changelog ul,
.news-changelog ol { margin: .35rem 0 .6rem 1.2rem; }
.news-changelog li { margin: .2rem 0; }
.news-changelog code {
  background: rgba(10, 22, 40, .06);
  border-radius: 4px;
  padding: .08rem .35rem;
  font-size: .85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.news-changelog blockquote {
  border-left: 3px solid rgba(10, 22, 40, .15);
  margin: .5rem 0;
  padding: .1rem 0 .1rem .75rem;
  color: var(--muted);
  font-style: italic;
}
.news-changelog hr {
  border: 0;
  border-top: 1px dashed rgba(10, 22, 40, .15);
  margin: .8rem 0;
}
.news-changelog a {
  color: var(--gold-dark, #8a5a00);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.news-changelog a:hover { color: var(--gold); }

.news-widget-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .5rem 1rem 1rem;
  flex-wrap: wrap;
}
.news-widget-hint {
  font-size: .82rem;
  color: var(--muted);
  flex: 1 1 14rem;
  min-width: 0;
}


/* ── Admin: katalog releasů — 2-sloupcový grid ──────────────────────────── */
.releases-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  align-items: start;
}
.releases-list-panel { position: sticky; top: 1rem; }

.releases-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}
.releases-item {
  border-bottom: 1px solid rgba(10, 22, 40, .06);
}
.releases-item:last-child { border-bottom: 0; }
.releases-item a {
  display: block;
  padding: .65rem .85rem;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.releases-item a:hover {
  background: rgba(10, 22, 40, .03);
}
.releases-item.is-active a {
  background: rgba(240, 180, 41, .08);
  border-left-color: var(--gold);
}
.releases-item-head {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.releases-item-head strong { font-size: .98rem; }
.releases-item-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .2rem;
  font-size: .78rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.releases-item-meta svg { vertical-align: -2px; }

.releases-editor-wrap > .panel { padding-bottom: 1rem; }

.releases-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .5rem;
  padding: .5rem 1rem .25rem;
}
.releases-meta-grid > div {
  background: rgba(10, 22, 40, .04);
  border-radius: 6px;
  padding: .5rem .65rem;
}
.releases-meta-grid span.muted {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .15rem;
}
.releases-meta-grid strong { font-size: .95rem; color: var(--navy); }

.changelog-rendered {
  padding: .25rem 1rem 1rem;
  font-size: .92rem;
  line-height: 1.55;
}
/* recyklujeme nadpisové styly z .news-changelog */
.changelog-rendered h1,
.changelog-rendered h2,
.changelog-rendered h3,
.changelog-rendered h4 { font-family: var(--font-head); margin: .9rem 0 .35rem; color: var(--navy); }
.changelog-rendered h1 { font-size: 1.25rem; }
.changelog-rendered h2 { font-size: 1.10rem; }
.changelog-rendered h3 { font-size: 1.00rem; }
.changelog-rendered h4 { font-size: .92rem; color: var(--gold-dark, #8a5a00); }
.changelog-rendered ul,
.changelog-rendered ol { margin: .35rem 0 .6rem 1.2rem; }
.changelog-rendered code {
  background: rgba(10, 22, 40, .06);
  border-radius: 4px;
  padding: .08rem .35rem;
  font-size: .85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Editor: Markdown textarea (monospace + větší kapacita). */
.code-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  line-height: 1.45;
  tab-size: 2;
}

/* Checkboxový řádek (require_reload / breaking). */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem .65rem;
  border: 1px solid rgba(10, 22, 40, .08);
  border-radius: 6px;
  background: rgba(10, 22, 40, .02);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.check-row:hover { background: rgba(240, 180, 41, .05); border-color: rgba(240, 180, 41, .25); }
.check-row input[type="checkbox"] { margin-top: .15rem; }
.check-row span strong { display: block; margin-bottom: .1rem; }
.check-row .field-hint { display: block; font-size: .78rem; }

/* Mobilní layout — list nad editorem. */
@media (max-width: 900px) {
  .releases-layout { grid-template-columns: 1fr; }
  .releases-list-panel { position: static; }
  .releases-list { max-height: 320px; }
}


/* ════════════════════════════════════════════════════════════════════════
   ETAPA 3E — Offline form drafts & Background Sync
   --------------------------------------------------------------------------
   Komponenty:
     .sync-indicator          — topbar sync status indikátor (vedle hodin)
     .sync-indicator-pop      — dropdown přehled draftů
     .draft-micro             — per-formulář mikro-indikátor
     .draft-restore-banner    — banner "Máte rozdělaný koncept, obnovit?"
     .merge-modal             — overlay merge UI (conflict resolution)
     .merge-modal-card        — dialog karta
     .merge-table             — tabulka pole po poli (3 sloupce)
     .merge-col-draft         — sloupec "Tvoje verze"
     .merge-col-server        — sloupec "Verze na serveru"
     .merge-col-pick          — sloupec "Použít"
   ════════════════════════════════════════════════════════════════════════ */

/* ── Sync status indikátor v topbaru ─────────────────────────────────────── */
.sync-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 38px;
  padding: 0 .75rem;
  background: rgba(255,255,255,.05);
  color: rgba(246,247,251,.85);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  font: 500 .82rem var(--font-body);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.sync-indicator:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(240,180,41,.35);
}
.sync-indicator[hidden] { display: none; }

/* Stavové varianty */
.sync-indicator[data-sync-state="saved"]    { color: rgba(246,247,251,.7); }
.sync-indicator[data-sync-state="pending"]  { color: #f5c84b; border-color: rgba(240,180,41,.3); }
.sync-indicator[data-sync-state="syncing"]  { color: #f5c84b; }
.sync-indicator[data-sync-state="synced"]   { color: #6ee7a0; }
.sync-indicator[data-sync-state="conflict"] { color: #fca5a5; border-color: rgba(192,57,43,.4); }
.sync-indicator[data-sync-state="quota"]    { color: #fca5a5; }

/* Animace pro syncing stav */
.sync-indicator[data-sync-state="syncing"] .sync-spinner {
  display: inline-block;
  animation: sync-spin .9s linear infinite;
}
@keyframes sync-spin { to { transform: rotate(360deg); } }
.sync-spinner { display: none; }

/* ── Dropdown přehled draftů ─────────────────────────────────────────────── */
.sync-indicator-pop {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  min-width: 300px;
  max-width: calc(100vw - 1.5rem);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 80;
}
.sync-indicator.is-open .sync-indicator-pop {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sync-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font: 600 .9rem var(--font-head);
}
.sync-pop-body {
  max-height: 280px;
  overflow-y: auto;
  padding: .25rem 0;
}
.sync-pop-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}
.sync-draft-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: .85rem;
}
.sync-draft-item:last-child { border-bottom: none; }
.sync-draft-key {
  flex: 1;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-draft-status {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 999px;
}
.sync-draft-status[data-status="dirty"]    { background: rgba(240,180,41,.18); color: #845200; }
.sync-draft-status[data-status="syncing"]  { background: rgba(45,122,200,.14); color: #1c4d80; }
.sync-draft-status[data-status="synced"]   { background: rgba(75,175,80,.18);  color: #2c6b30; }
.sync-draft-status[data-status="conflict"] { background: rgba(192,57,43,.14);  color: #8a2a1f; }
.sync-pop-foot {
  padding: .55rem 1rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-soft);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

/* ── Per-formulář mikro-indikátor ────────────────────────────────────────── */
.draft-micro {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .35rem;
  transition: color var(--t-fast);
}
.draft-micro[data-draft-state="saved"]    { color: var(--text-muted); }
.draft-micro[data-draft-state="saving"]   { color: var(--gold-dark); }
.draft-micro[data-draft-state="conflict"] { color: var(--error-fg); font-weight: 600; }
.draft-micro[hidden] { display: none; }

/* ── Banner "Máte rozdělaný koncept, obnovit?" ───────────────────────────── */
.draft-restore-banner {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  background: rgba(240,180,41,.1);
  border: 1px solid rgba(240,180,41,.4);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  animation: card-in .25s ease both;
}
.draft-restore-banner[hidden] { display: none; }
.draft-restore-text {
  flex: 1;
  color: var(--text);
}
.draft-restore-text strong { display: block; margin-bottom: .15rem; }
.draft-restore-text small  { color: var(--text-soft); font-size: .8rem; }
.draft-restore-actions {
  display: flex;
  gap: .4rem;
  flex-shrink: 0;
}

/* ── Merge modal (conflict resolution) ───────────────────────────────────── */
.merge-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10,22,40,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.merge-modal[hidden] { display: none; }

.merge-modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 64px rgba(6,16,33,.45);
  animation: card-in .3s var(--t-slow) both;
}
.merge-modal-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.merge-modal-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--error-fg);
}
.merge-modal-head .merge-modal-sub {
  font-size: .82rem;
  color: var(--text-soft);
  margin-top: .15rem;
}
.merge-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.4rem;
}
.merge-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
  padding: .85rem 1.4rem;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-soft);
  flex-shrink: 0;
}

/* ── Merge tabulka (pole po poli) ────────────────────────────────────────── */
.merge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.merge-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .5rem .75rem;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.merge-table td {
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.merge-table tr:last-child td { border-bottom: none; }
.merge-table tr:hover td { background: rgba(0,0,0,.015); }

.merge-col-field  { width: 130px; font-weight: 600; color: var(--text-soft); font-size: .82rem; }
.merge-col-draft  { width: 33%; }
.merge-col-server { width: 33%; }
.merge-col-pick   { width: 90px; text-align: center; }

/* Zvýraznění rozdílných hodnot */
.merge-val-diff-draft  { background: rgba(240,180,41,.12); border-radius: 4px; padding: .1rem .3rem; }
.merge-val-diff-server { background: rgba(45,122,200,.1);  border-radius: 4px; padding: .1rem .3rem; }
.merge-val-same        { color: var(--text-muted); font-style: italic; }

/* Radio přepínač "Použít" */
.merge-pick-radio {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  align-items: center;
}
.merge-pick-radio label {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  margin: 0;
}
.merge-pick-radio input[type="radio"] {
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
  margin: 0;
}

/* Mobilní layout merge modalu */
@media (max-width: 720px) {
  .merge-modal-card { max-width: 100%; max-height: 95vh; }
  .merge-col-field  { width: 80px; }
  .merge-col-draft,
  .merge-col-server { width: auto; }
  .merge-table th:nth-child(3),
  .merge-table td:nth-child(3) { display: none; } /* server sloupec na mobilu skryjeme */
  .merge-col-pick { width: 70px; }
}

/* Mobilní sync indikátor — zkrátit text */
@media (max-width: 980px) {
  .sync-indicator .sync-label-long { display: none; }
}


/* ══════════════════════════════════════════════════════════════════════════
   ===== ETAPA 4.5 SPRINT A — WebAuthn / Passkeys / Záložní kódy =====
   ══════════════════════════════════════════════════════════════════════════
   Drží stávající design system (proměnné, pojmenování tříd, typografie).
   Nové třídy mají prefix `passkey-` nebo `backup-` pro jasnou identifikaci.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Login stránka — passkey divider + tlačítko ─────────────────────────── */
.passkey-login-wrap {
  margin-top: .75rem;
}

.passkey-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: .85rem 0 .75rem;
  color: var(--text-muted);
  font-size: .82rem;
}
.passkey-divider::before,
.passkey-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.passkey-login-btn {
  width: 100%;
  justify-content: center;
  gap: .55rem;
}

/* ── Status zprávy (login + me_security) ─────────────────────────────────── */
.passkey-status {
  margin-top: .6rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  animation: card-in .2s ease both;
}
.passkey-status[hidden] { display: none; }

.passkey-status-info {
  background: var(--info-bg);
  color: var(--info-fg);
  border: 1px solid var(--info-border);
}
.passkey-status-error {
  background: var(--error-bg);
  color: var(--error-fg);
  border: 1px solid var(--error-border);
}
.passkey-status-success {
  background: var(--ok-bg);
  color: var(--ok-fg);
  border: 1px solid var(--ok-border);
}

/* ── me_security.php — step-up banner ───────────────────────────────────── */
.passkey-stepup-banner {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-border);
  margin-bottom: 1rem;
  animation: card-in .25s ease both;
}
.passkey-stepup-banner .et-ico { flex-shrink: 0; margin-top: 2px; }

/* ── Passkey přidání — inline formulář ──────────────────────────────────── */
.passkey-add-form {
  margin-bottom: 1rem;
  animation: card-in .2s ease both;
}
.passkey-add-form[hidden] { display: none; }

.passkey-add-inner {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.passkey-add-inner label {
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
.passkey-add-inner input[type="text"] {
  margin-bottom: .6rem;
}

/* ── Passkeys tabulka ────────────────────────────────────────────────────── */
.passkeys-table .passkey-label-display {
  font-weight: 500;
}
.passkeys-table .passkey-rename-form {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.passkeys-table .passkey-rename-form[hidden] { display: none; }

.passkey-rename-input {
  width: auto;
  min-width: 160px;
  max-width: 240px;
  padding: .35rem .6rem;
  font-size: .88rem;
}

.passkey-rename-inline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin: 0;
}

/* ── Záložní kódy — jednorázové zobrazení ───────────────────────────────── */
.passkey-backup-reveal {
  border-left: 4px solid var(--gold);
  animation: card-in .3s var(--t-slow) both;
}

/* Hint list (sdílený s me_devices.php) */
.hint-list {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
}
.hint-list li {
  padding: .3rem 0 .3rem 1.4rem;
  position: relative;
  font-size: .9rem;
  color: var(--text-soft);
}
.hint-list li::before {
  content: '•';
  position: absolute;
  left: .4rem;
  color: var(--gold);
  font-weight: 700;
}

/* ── Empty state (sdílený vzor) ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state p {
  margin: 0;
  font-weight: 600;
  color: var(--text-soft);
}
.empty-state span {
  font-size: .88rem;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .passkeys-table .passkey-rename-input {
    min-width: 120px;
    max-width: 180px;
  }
  .passkey-add-inner {
    padding: .75rem .85rem;
  }
}


/* =========================================================================
   ETAPA 4.5 SPRINT B — FEATURE FLAGS ADMIN
   -------------------------------------------------------------------------
   Sloty:
     .ff-info                  — info panel s vysvětlením + warning
     .ff-table                 — tabulka aktivních flagů (extends .data)
     .ff-col-key, -desc,
     .ff-col-rollout,
     .ff-col-targets, -meta    — sloupcové specifika
     .ff-col-center            — sloupec se zarovnáním na střed
     .ff-toggle-form,
     .ff-inline-form           — inline form bez margin (master toggle / smazat)
     .ff-master-toggle         — vlastní toggle button (pill ON/OFF)
     .ff-rollout-bar           — mini progress bar 0-100 %
     .ff-targets-list          — badge výpis rolí + user_ids
     .badge-user               — varianta badge pro user ID
     .ff-editor                — panel editoru
     .ff-editor-grid           — 2-sloupcový form-grid
     .ff-check-row             — checkbox s víceříádkovým popisem
     .ff-range-row             — range slider + number input
   ========================================================================= */

/* ── Info panel — co to vůbec je ────────────────────────────────────────── */
.ff-info .hint {
  margin: .6rem 0 0;
  line-height: 1.55;
}
.ff-info .hint-warn {
  margin-top: .6rem;
  padding: .55rem .75rem;
  background: rgba(192, 57, 43, .06);
  border-left: 3px solid var(--emergency, #c0392b);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.ff-info .hint-warn .et-ico {
  vertical-align: -2px;
  color: var(--emergency, #c0392b);
}

/* ── Tabulka flagů ──────────────────────────────────────────────────────── */
.ff-table .ff-col-center {
  text-align: center;
  vertical-align: middle;
}
.ff-table .ff-col-key code {
  white-space: nowrap;
}
.ff-table .ff-col-desc {
  max-width: 22rem;
  color: var(--text-soft);
  font-size: .92rem;
}
.ff-table .ff-col-rollout {
  width: 11rem;
  white-space: nowrap;
  vertical-align: middle;
}
.ff-table .ff-col-targets {
  max-width: 22rem;
}
.ff-table .ff-col-meta {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

/* Inline forms (toggle / delete) — nesmí dělat margin v buňce. */
.ff-toggle-form,
.ff-inline-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

/* ── Master toggle — pill button ON/OFF ────────────────────────────────── */
.ff-master-toggle {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .55rem .25rem .3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  cursor: pointer;
  font: 600 .78rem/1 var(--font-body, system-ui);
  letter-spacing: .03em;
  transition: background var(--t-fast), border-color var(--t-fast),
              box-shadow var(--t-fast);
}
.ff-master-toggle .ff-master-pill {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: inset 0 0 0 2px var(--surface);
  transition: background var(--t-fast);
}
.ff-master-toggle .ff-master-label {
  color: var(--text-soft);
}
.ff-master-toggle.is-on {
  background: rgba(31, 93, 51, .10);
  border-color: var(--ok-border);
}
.ff-master-toggle.is-on .ff-master-pill {
  background: var(--ok-fg, #1f5d33);
}
.ff-master-toggle.is-on .ff-master-label {
  color: var(--ok-fg, #1f5d33);
}
.ff-master-toggle.is-off {
  background: var(--surface-soft);
}
.ff-master-toggle:hover {
  box-shadow: var(--shadow-xs);
}
.ff-master-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Rollout bar — mini progress bar ────────────────────────────────────── */
.ff-rollout-bar {
  display: inline-block;
  width: 6.5rem;
  height: 8px;
  border-radius: 4px;
  background: var(--border-soft);
  overflow: hidden;
  vertical-align: middle;
  margin-right: .5rem;
}
.ff-rollout-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width var(--t-base);
}
.ff-rollout-num {
  display: inline-block;
  min-width: 2.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-soft);
  font-size: .88rem;
  vertical-align: middle;
}

/* ── Targets list — badge výpis rolí + user_ids ─────────────────────────── */
.ff-targets-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.ff-targets-list .badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .78rem;
}
.badge-user {
  background: rgba(29, 78, 216, .08);
  color: var(--link, #1d4ed8);
  border: 1px solid rgba(29, 78, 216, .25);
  padding: .12rem .45rem;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Editor flagu ───────────────────────────────────────────────────────── */
.ff-editor {
  border-left: 4px solid var(--gold);
  animation: card-in .3s var(--t-slow) both;
}
.ff-editor .panel-head a.panel-head-hint {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.ff-editor .panel-head a.panel-head-hint:hover {
  color: var(--gold-dark);
}
.ff-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.2rem;
  align-items: start;
}
.ff-editor-grid > .ff-field-key,
.ff-editor-grid > .ff-field-desc {
  grid-column: span 1;
}
.ff-editor-grid > .ff-field-enabled,
.ff-editor-grid > .ff-field-rollout,
.ff-editor-grid > .ff-field-roles,
.ff-editor-grid > .ff-field-users {
  grid-column: span 1;
}

/* Klíč v read-only stavu při editaci. */
.ff-editor-grid input[readonly] {
  background: var(--surface-soft);
  color: var(--text-soft);
  cursor: not-allowed;
}

/* ── Checkbox s víceříádkovým popisem (master toggle v editoru) ─────────── */
.ff-check-row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .55rem .65rem;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.ff-check-row:hover {
  background: var(--surface);
  border-color: var(--border);
}
.ff-check-row input[type="checkbox"] {
  margin-top: .25rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.ff-check-row .ff-check-label {
  font-size: .92rem;
  line-height: 1.4;
}
.ff-check-row .field-hint {
  margin: .15rem 0 0;
}

/* ── Range slider + number input ────────────────────────────────────────── */
.ff-range-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.ff-range-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--gold);
  height: 6px;
}
.ff-range-row input[type="number"] {
  width: 5rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ff-range-row .muted {
  font-weight: 600;
}

/* ── Multi-select pro role ──────────────────────────────────────────────── */
.ff-field-roles select[multiple] {
  width: 100%;
  min-height: 6rem;
  padding: .35rem .4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: .9rem;
}
.ff-field-roles select[multiple]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

/* ── Textarea pro user IDs ──────────────────────────────────────────────── */
.ff-field-users textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  resize: vertical;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ff-editor-grid {
    grid-template-columns: 1fr;
  }
  .ff-editor-grid > .ff-field-key,
  .ff-editor-grid > .ff-field-desc,
  .ff-editor-grid > .ff-field-enabled,
  .ff-editor-grid > .ff-field-rollout,
  .ff-editor-grid > .ff-field-roles,
  .ff-editor-grid > .ff-field-users {
    grid-column: span 1;
  }
}
@media (max-width: 720px) {
  .ff-table .ff-col-desc,
  .ff-table .ff-col-meta {
    display: none;  /* mobil: skryjeme popis a čas — důležité je klíč + stav */
  }
  .ff-rollout-bar { width: 4.5rem; }
}

/* ==========================================================================
   ETAPA 6 / T4 — ZAKÁZKY (Orders Engine UI)
   --------------------------------------------------------------------------
   Pouze NOVÉ komponenty. Existující třídy (.panel, .kpi-row, .status-tag,
   .btn*, .form-grid, .data, .breadcrumb) zachovány a znovupoužity.
   Barvy stavů přicházejí inline přes --tag-color / --col-accent
   (whitelist hex v PHP) — žádné natvrdo zapsané stavy.
   ========================================================================== */

/* ── Dynamický status-tag (barva ze state_statuses) ─────────────────────── */
.status-tag[style*="--tag-color"] {
  background: color-mix(in srgb, var(--tag-color) 16%, transparent);
  color: color-mix(in srgb, var(--tag-color) 72%, #000);
}
.status-tag-lg {
  font-size: .82rem;
  padding: 5px 14px;
}

/* ── Přepínač Tabulka/Kanban + filtr ────────────────────────────────────── */
.order-view-switch { display: inline-flex; gap: .4rem; margin-left: auto; }
.panel-head { display: flex; align-items: center; gap: .75rem; }
.filter-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.filter-actions { display: flex; align-items: flex-end; gap: .5rem; }

/* ── Záruční semafor ────────────────────────────────────────────────────── */
.warranty-dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
.warranty-dot.is-ok      { background: #4caf50; }
.warranty-dot.is-soon    { background: #f08c00; animation: warrantyPulse 1.8s ease-in-out infinite; }
.warranty-dot.is-expired { background: #c0392b; }
.warranty-dot.is-none    { background: #c4ccda; }
@keyframes warrantyPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
  50%      { box-shadow: 0 0 0 4px rgba(240,140,0,.28); }
}

/* ── Kanban board ───────────────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: .25rem .25rem 1rem;
  scroll-snap-type: x proximity;
}
.kanban-col {
  flex: 0 0 280px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-top: 3px solid var(--col-accent, var(--gold));
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem .9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
}
.kanban-col-title { font-size: .9rem; }
.kanban-col-count {
  background: var(--col-accent, var(--gold));
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
}
.kanban-col-body {
  flex: 1;
  min-height: 80px;
  padding: .6rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: background .15s ease;
}
.kanban-col-body.is-over { background: rgba(240,180,41,.10); }

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .75rem;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  animation: cardIn .25s ease both;
  transition: box-shadow .15s ease, transform .15s ease, opacity .15s ease;
}
.kanban-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kanban-card.is-dragging { opacity: .45; cursor: grabbing; }
.kanban-card.is-pending  { opacity: .6; pointer-events: none; }
.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.kanban-card-code { font-weight: 700; font-size: .82rem; color: var(--link); text-decoration: none; }
.kanban-card-code:hover { text-decoration: underline; }
.kanban-card-name { font-size: .9rem; margin: .25rem 0; }
.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  font-size: .78rem;
}
.kanban-hint { margin-top: .5rem; font-size: .82rem; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Detail zakázky — hlavička + přechody ───────────────────────────────── */
.order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.order-head-main { display: flex; align-items: center; gap: 1rem; }
.order-head-code { font-weight: 700; font-size: 1.05rem; }
.order-head-name { font-size: .95rem; color: var(--text-soft); }
.order-transitions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.order-transitions-label { font-size: .8rem; }
.order-transition-form { margin: 0; }
.order-transition-btn {
  background: color-mix(in srgb, var(--tag-color, var(--gold)) 16%, transparent);
  color: color-mix(in srgb, var(--tag-color, var(--gold)) 70%, #000);
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--gold)) 40%, transparent);
}
.order-transition-btn:hover {
  background: color-mix(in srgb, var(--tag-color, var(--gold)) 26%, transparent);
}

/* ── Záložky ────────────────────────────────────────────────────────────── */
.order-tabs {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin: 1rem 0;
}
.order-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .6rem .9rem;
  font: inherit;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.order-tab:hover { color: var(--text); }
.order-tab.is-active { color: var(--link); border-bottom-color: var(--gold); }
.order-tabpane { display: none; animation: fadeIn .2s ease both; }
.order-tabpane.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.panel-subhead { font-weight: 600; margin: 1rem 0 .5rem; color: var(--text-soft); }
.order-cf-block { border-top: 1px solid var(--border-soft); margin-top: 1rem; padding-top: .5rem; }
.order-form-foot { margin-top: 1rem; display: flex; justify-content: flex-end; }
.order-assign-form { margin-top: 1rem; border-top: 1px solid var(--border-soft); padding-top: 1rem; }

/* Přepínač (custom field bool / requires_inspection) */
.order-switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.order-switch input { width: 1.1rem; height: 1.1rem; }
.order-insp-field { justify-content: flex-end; }

/* ── Checklist ──────────────────────────────────────────────────────────── */
.order-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.order-checklist-item { display: flex; align-items: center; gap: .65rem; }
.order-checklist-form { margin: 0; }
.order-checklist-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.order-checklist-check:active { transform: scale(.9); }
.order-checklist-item.is-done .order-checklist-check { background: #4caf50; border-color: #4caf50; }
.order-checklist-item.is-done .order-checklist-label { text-decoration: line-through; color: var(--text-muted); }

/* ── Časová osa (scoped .order-timeline — nekoliduje s CRM .timeline) ────── */
.order-timeline { list-style: none; margin: 0; padding: 0 0 0 .5rem; position: relative; }
.order-timeline .timeline-item { position: relative; padding: 0 0 1.1rem 1.4rem; border-left: 2px solid var(--border); }
.order-timeline .timeline-item::before { content: none; }
.order-timeline .timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.order-timeline .timeline-dot {
  position: absolute;
  left: -7px; top: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--surface);
  animation: dotPop .3s ease both;
}
@keyframes dotPop { from { transform: scale(0); } to { transform: scale(1); } }
.order-timeline .timeline-title { font-weight: 600; font-size: .9rem; }
.order-timeline .timeline-meta { font-size: .8rem; margin-top: .15rem; }


/* ── Modal „Nová zakázka" ───────────────────────────────────────────────── */
.order-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.order-modal[hidden] { display: none; }
.order-modal-backdrop { position: absolute; inset: 0; background: rgba(10,22,40,.55); backdrop-filter: blur(2px); }
.order-modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(720px, 94vw);
  max-height: 90vh;
  overflow: auto;
  animation: modalIn .22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.order-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}
.order-modal-head h2 { margin: 0; font-size: 1.1rem; }
.order-modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-soft); }
.order-modal-body { padding: 1.25rem; }
.order-modal-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
body.modal-open { overflow: hidden; }

/* ── Lock banner (order_detail) ──────────────────────────────────────────── */
.order-locked-banner {
  background: #b91c1c; color: #fff; padding: .75rem 1.25rem;
  border-radius: .5rem; margin-bottom: 1rem; font-size: .95rem;
  box-shadow: 0 2px 8px rgba(185,28,28,.25);
}
.order-detail-link {
  color: #2e7fd4; text-decoration: none; font-weight: 500;
}
.order-detail-link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .kanban-col { flex-basis: 84vw; }
  .order-head { flex-direction: column; }
}


/* ════════════════════════════════════════════════════════════════════════
   ETAPA 6.5 / MP5 — Projekty (ramce) UI
   ════════════════════════════════════════════════════════════════════════ */
.proj-detail-head { position: relative; }
.proj-head-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.proj-head-main { display: flex; align-items: center; gap: .5rem; }
.proj-head-code { font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; color: var(--gold); }
.proj-head-name { margin: .35rem 0 .5rem; font-size: 1.35rem; font-weight: 600; }
.proj-head-meta { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; font-size: .92rem; color: #555; margin-bottom: .5rem; }
.proj-head-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.proj-head-note { margin: .5rem 0; padding: .6rem .8rem; background: #fafaf7; border-radius: 8px; font-size: .93rem; color: #444; border-left: 3px solid var(--gold); }
.proj-code-link { font-weight: 600; color: var(--gold); text-decoration: none; }
.proj-code-link:hover { text-decoration: underline; }
.status-tag-lg { font-size: .95rem; padding: .25rem .7rem; }
.kpi-card--running { border-left: 3px solid var(--gold); }
/* ============================================================================
   MENU POLISH — Etapa 19 / navigace
   Přidej na ÚPLNÝ KONEC souboru assets/style.css (pozdější pravidla přebíjejí).
   Pouze aditivní mikroanimace a oddělení sekcí; nic se nepřepisuje.
   ============================================================================ */

/* Jemný posun + zvýraznění ikony při hoveru (mikroanimace) */
.app-sidebar .sb-item {
  transition: background var(--t-fast), color var(--t-fast),
              transform var(--t-fast), box-shadow var(--t-fast);
}
.app-sidebar .sb-item:hover {
  transform: translateX(3px);
}
.app-sidebar .sb-item .et-ico {
  transition: transform var(--t-fast), color var(--t-fast);
}
.app-sidebar .sb-item:hover .et-ico {
  transform: scale(1.12);
  color: var(--gold-light);
}

/* Aktivní položka — jemný zlatý glow navíc k existujícímu pruhu */
.app-sidebar .sb-item.is-active {
  box-shadow: inset 0 0 0 1px rgba(240, 180, 41, .25);
}

/* Vizuální oddělení sekcí (teď jich je 8) — tenká linka nad nadpisem,
   kromě první sekce */
.app-sidebar .sb-group + .sb-group {
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding-top: .9rem;
}

/* „Brzy" badge: decentní pulz, ať je jasné, že na tom pracuje se */
@keyframes sb-soon-pulse {
  0%, 100% { opacity: .65; }
  50%      { opacity: 1; }
}
.app-sidebar .sb-item.is-disabled .sb-badge {
  animation: sb-soon-pulse 2.4s ease-in-out infinite;
}

/* Respektuj uživatele, kteří nechtějí animace */
@media (prefers-reduced-motion: reduce) {
  .app-sidebar .sb-item,
  .app-sidebar .sb-item:hover,
  .app-sidebar .sb-item .et-ico,
  .app-sidebar .sb-item:hover .et-ico,
  .app-sidebar .sb-item.is-disabled .sb-badge {
    transition: none;
    transform: none;
    animation: none;
  }
}
