/* MySalesX1 Pro — sdílené styly */

:root {
  --bg: #fafaf7;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #6b6962;
  --ink-soft: #888780;
  --accent: #c5402b;
  --accent-soft: #e8674f;
  --line: #e8e6df;
  --line-soft: #f0eee7;
  --pill-bg: #f1efe8;
  --green: #0f6e56;
  --green-bg: #e1f5ee;
  --red: #993c1d;
  --red-bg: #fae9e2;
  --orange: #b56028;
  --orange-bg: #fde7d4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- TOP BAR ---------- */

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-block { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { font-weight: 500; font-size: 15px; text-decoration: none; color: var(--ink); }
.brand .accent { color: var(--accent); }
nav { display: flex; gap: 22px; font-size: 13px; flex-wrap: wrap; }
nav a { color: var(--ink-muted); text-decoration: none; padding: 4px 0; }
nav a.active { color: var(--accent); font-weight: 500; }
nav a .count { color: var(--ink-soft); font-size: 11px; margin-left: 4px; }
.admin-badge { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 10px; margin-left: 6px; font-weight: 600; }
.user-block { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-muted); flex-wrap: wrap; }
.pill { background: var(--pill-bg); padding: 4px 10px; border-radius: 6px; }
.user-block a { color: var(--ink-muted); text-decoration: none; }
.user-block a:hover { color: var(--accent); }
.search-bar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  width: 280px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  position: relative;
}
.search-wrap { position: relative; }
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  z-index: 50;
  max-height: 360px;
  overflow-y: auto;
}
.search-result-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); color: var(--accent); }
.search-result-item .ico { color: var(--ink-soft); font-family: monospace; font-size: 11px; }

/* ---------- BUTTONS ---------- */

.button-primary, .button-secondary, .button-danger {
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  padding: 9px 14px;
  border: 1px solid transparent;
  transition: opacity 0.1s;
}
.button-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  border-color: var(--accent);
}
.button-primary:hover { opacity: 0.92; }
.button-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.button-secondary {
  background: var(--paper);
  color: #444;
  border-color: var(--line);
}
.button-secondary:hover { border-color: var(--accent); color: var(--accent); }
.button-danger {
  background: var(--paper);
  color: var(--red);
  border-color: #f5c1c1;
  padding: 6px 10px;
  font-size: 11px;
}
.button-danger:hover { background: var(--red-bg); }

/* ---------- FORMS ---------- */

label {
  display: block;
  font-size: 11px;
  color: #444;
  margin-bottom: 4px;
  font-weight: 500;
}
label .required { color: var(--accent); margin-left: 2px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="date"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: -1px;
}
textarea { resize: vertical; min-height: 80px; }
.checkbox-row { display: flex; align-items: center; font-size: 13px; padding: 4px 0; }
.checkbox-row input { width: auto; margin-right: 6px; }
.checkbox-row label { margin-bottom: 0; }

/* ---------- CARDS / SECTIONS ---------- */

.container { max-width: 1280px; margin: 0 auto; padding: 32px 40px; }
.section-tag {
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--ink-soft); text-transform: uppercase; margin-bottom: 8px;
}
.section-num { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; margin-bottom: 16px; }
h1 { font-size: 26px; font-weight: 500; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 500; }
h3 { font-size: 15px; font-weight: 500; }

/* ---------- BADGES ---------- */

.badge { padding: 3px 12px; border-radius: 12px; font-weight: 500; font-size: 12px; display: inline-block; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-neutral { background: var(--pill-bg); color: var(--ink-muted); }

/* ---------- TOASTS ---------- */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}
.toast {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-size: 13px;
  color: var(--ink);
  animation: slideIn 0.2s ease-out;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--orange); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------- MODALS ---------- */

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--paper);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.modal h2 { font-size: 19px; font-weight: 500; margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.char-count { font-size: 11px; color: var(--ink-soft); text-align: right; margin-top: 2px; }

/* ---------- PROGRESS MODAL (reports) ---------- */

.progress-modal { max-width: 480px; padding: 32px; text-align: center; }
.progress-modal h2 { font-size: 18px; margin-bottom: 8px; }
.progress-meta { font-size: 13px; color: var(--ink-muted); margin-bottom: 22px; }
.progress-phase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  text-align: left;
}
.progress-phase .icon { width: 20px; text-align: center; color: var(--ink-soft); }
.progress-phase.done .icon { color: var(--green); }
.progress-phase.active .icon { color: var(--accent); }
.progress-phase.active { color: var(--ink); font-weight: 500; }
.progress-phase.pending { color: var(--ink-soft); }
.progress-meta-elapsed { font-size: 11px; color: var(--ink-soft); margin-top: 18px; }

/* ---------- TABLE BASIC ---------- */

.table-card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.table-card-header { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.table-card-title { font-size: 15px; font-weight: 500; }
.table-card-meta { font-size: 12px; color: var(--ink-soft); }
table.std { width: 100%; border-collapse: collapse; font-size: 13px; }
table.std th { background: #f9f8f4; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 500; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
table.std td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.std tr:last-child td { border-bottom: none; }
table.std tr:hover { background: #fbfaf6; }
table.std .num { text-align: right; font-variant-numeric: tabular-nums; }
table.std a { color: var(--accent); text-decoration: none; }
table.std a:hover { text-decoration: underline; }

/* ---------- EMPTY STATES ---------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-state .icon { font-size: 32px; margin-bottom: 12px; }
.empty-state .title { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty-state .desc { font-size: 13px; margin-bottom: 18px; }

/* ---------- DROPDOWN ---------- */

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  min-width: 240px;
  z-index: 100;
  padding: 6px 0;
}
.dropdown-menu button, .dropdown-menu a {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--bg); color: var(--accent); }
.dropdown-menu button:disabled { color: var(--ink-soft); cursor: not-allowed; }
.dropdown-menu button:disabled:hover { background: none; color: var(--ink-soft); }
.dropdown-menu .hint { font-size: 11px; color: var(--ink-soft); padding: 4px 14px 8px; font-style: italic; }
.dropdown-arrow { font-size: 10px; margin-left: 4px; }

/* ---------- LOADING ---------- */

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- PAGE LAYOUT (login/auth) ---------- */

.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.auth-page main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
}
.auth-card h1 { font-size: 26px; margin-bottom: 8px; line-height: 1.2; }
.auth-card .lede { color: var(--ink-muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.auth-card .eyebrow {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  color: var(--accent); text-transform: uppercase; margin-bottom: 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--accent); display: inline-block;
}
.app-footer {
  text-align: center;
  padding: 32px 24px 24px;
  color: var(--ink-soft);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}
.app-footer .credit {
  margin-bottom: 6px;
}
.app-footer .credit a {
  color: var(--accent);
  text-decoration: none;
}
.app-footer .credit a:hover {
  text-decoration: underline;
}
.app-footer .copyright {
  color: var(--ink-soft);
  font-size: 11px;
  opacity: 0.8;
}

/* =============================================================================
 * SOURCE TAGS — drobné značky [API], [MCP], [MŮJ], [RR], … u jednotlivých polí
 * Označují, odkud konkrétní hodnota přišla. Zobrazují se jen pro adminy
 * (logiku skrývání řeší helper window.field()/window.tag() v config.js).
 *
 * Generický styl bez barev — všechny zdroje vypadají stejně. Při přidání
 * nového zdroje (RR, ARES, JUSTICE, …) není potřeba nic v CSS přidávat.
 * =============================================================================
 */
.source-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.04em;
  vertical-align: middle;
  white-space: nowrap;
  user-select: none;
}
.source-tag-row {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  vertical-align: middle;
}
/* Verze tagu pro nadpis sekce — drobně větší a sladěná s jiným textem nadpisu */
.source-tag.in-heading {
  margin-left: 10px;
  vertical-align: baseline;
}
/* Wrapper pro buňku tabulky kv, který zajistí, že tagy plavou napravo */
td .source-tag-row {
  float: right;
  margin-left: 12px;
}

/* =============================================================================
 * ADMIN LEGEND — proužek nahoře jen pro adminy, vysvětluje význam tagů
 * =============================================================================
 */
.admin-legend {
  background: var(--pill-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-legend strong {
  color: var(--ink);
  font-weight: 500;
}
.admin-legend .source-tag {
  margin: 0 2px;
}

/* =============================================================================
 * WORKLIST BAR — pruh "Pracovní seznam" pod hlavním topbarem
 *
 * Vždy viditelný (i prázdný) — uživatel objeví funkci. Po horizontálním
 * přetečení se aktivuje scroll (overflow-x: auto).
 * =============================================================================
 */
.worklist-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 8px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  min-height: 38px;
}
.worklist-label {
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.worklist-empty {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 11px;
}
.worklist-items {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  /* Skrýt scrollbar v Chrome/Safari, ponechat funkčnost */
  scrollbar-width: thin;
}
.worklist-items::-webkit-scrollbar {
  height: 4px;
}
.worklist-items::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}
.worklist-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.1s;
}
.worklist-item:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.worklist-item.active {
  border-color: var(--accent);
  background: var(--paper);
  color: var(--accent);
  font-weight: 500;
}
.worklist-item-name {
  cursor: pointer;
  padding: 2px 0;
}
.worklist-close {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 3px;
  font-family: inherit;
  transition: all 0.1s;
}
.worklist-close:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .container { padding: 24px 18px; }
  nav { gap: 14px; }
  .search-bar { width: 100%; }
}

/* =============================================================================
   FIRMA-PAGE — Detail firmy v2 (kategorizace, masonry, status, source tagy)
   ============================================================================= */

:root {
  --c-firma: #5b7a96;
  --c-firma-bg: #eef3f8;
  --c-lide: #5a8a6e;
  --c-lide-bg: #ecf3ee;
  --c-line: #e8e6df;
  --c-line-soft: #f0eee7;
  --c-ink: #1a1a1a;
  --c-ink-muted: #6b6962;
  --c-ink-soft: #888780;
  --c-bg: #fafaf7;
}

.firma-page { max-width: 1200px; margin: 0 auto; padding: 20px; }

.firma-page .header-card {
  background: #fff;
  padding: 24px 28px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  margin-bottom: 14px;
}
.firma-page .header-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.firma-page .firma-h2 { font-size: 26px; font-weight: 500; margin-bottom: 12px; line-height: 1.2; }
.firma-page .header-badges { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.firma-page .badge { font-size: 11px; padding: 3px 9px; border-radius: 10px; font-weight: 500; }
.firma-page .badge-green { background: #e1f5ee; color: #0f6e56; }
.firma-page .badge-blue { background: #e0e9f0; color: #2d4a6a; }
.firma-page .badge-red { background: #fae9e2; color: #993c1d; }
.firma-page .header-meta { font-size: 13px; color: var(--c-ink-muted); margin-bottom: 16px; }
.firma-page .header-meta strong { color: var(--c-ink); font-weight: 500; }
.firma-page .header-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--c-line-soft); }
.firma-page .btn {
  font-family: inherit; font-size: 13px; padding: 7px 14px;
  background: #fff; color: var(--c-ink); border: 1px solid var(--c-line);
  border-radius: 5px; cursor: pointer; transition: border-color 0.1s, color 0.1s;
  text-decoration: none; display: inline-block;
}
.firma-page .btn:hover { border-color: var(--accent); color: var(--accent); }

/* Masonry 2 sloupce */
.firma-page .masonry { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; margin-bottom: 14px; }
.firma-page .masonry-col { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) { .firma-page .masonry { grid-template-columns: 1fr; } }

/* Sekce */
.firma-page .sec {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 18px 22px;
  position: relative;
}
.firma-page .sec.firma { border-left: 4px solid var(--c-firma); }
.firma-page .sec.lide  { border-left: 4px solid var(--c-lide); }
.firma-page .sec-muted { opacity: 0.6; }
.firma-page .sec-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 10px; }
.firma-page .sec-title { font-size: 18px; font-weight: 500; color: var(--c-ink); letter-spacing: -0.01em; }
.firma-page .sec-cat {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px;
}
.firma-page .sec-cat.firma { background: var(--c-firma-bg); color: var(--c-firma); }
.firma-page .sec-cat.lide  { background: var(--c-lide-bg);  color: var(--c-lide); }
.firma-page .sec-intro { font-size: 12px; color: var(--c-ink-soft); margin-bottom: 14px; }

/* Tabulka klíč-hodnota */
.firma-page table.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.firma-page table.kv tr { border-bottom: 1px solid var(--c-line-soft); }
.firma-page table.kv tr:last-child { border-bottom: none; }
.firma-page table.kv td { padding: 10px 0; vertical-align: top; }
.firma-page table.kv td:first-child { color: var(--c-ink-soft); width: 42%; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.firma-page table.kv td:last-child { color: var(--c-ink); }

/* Metriky (finance) */
.firma-page .metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.firma-page .metric { padding: 12px 14px; background: var(--c-bg); border-radius: 5px; }
.firma-page .metric-label { font-size: 10px; font-weight: 500; color: var(--c-ink-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.firma-page .metric-value { font-size: 17px; font-weight: 500; color: var(--c-ink); }
.firma-page .metric-trend { font-size: 11px; color: var(--c-ink-muted); margin-top: 2px; }

/* Tlačítka v sekcích */
.firma-page .btn-action {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit; font-size: 12px; padding: 7px 14px;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 5px; cursor: pointer;
}
.firma-page .btn-action:hover { background: #b03a26; border-color: #b03a26; }
.firma-page .btn-action.ghost { background: #fff; color: var(--accent); }
.firma-page .btn-action.ghost:hover { background: var(--accent); color: #fff; }
.firma-page .btn-action.small { font-size: 11px; padding: 4px 10px; }
.firma-page .btn-action:disabled { opacity: 0.5; cursor: not-allowed; }
.firma-page .btn-ai-ind { display: inline-block; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; vertical-align: middle; margin-right: 2px; }

/* Risk rows */
.firma-page .risk-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--c-line-soft); font-size: 13px; }
.firma-page .risk-row:last-child { border-bottom: none; }
.firma-page .risk-row-note { font-size: 11px; color: var(--c-ink-soft); margin-top: 2px; font-style: italic; padding-bottom: 6px; }
.firma-page .risk-ok { color: #0f6e56; font-size: 12px; }
.firma-page .risk-bad { color: #993c1d; font-size: 12px; font-weight: 500; }

/* Active risks (MCP) */
.firma-page .ar-item { padding: 10px 12px; border-radius: 5px; margin-bottom: 8px; }
.firma-page .ar-item:last-child { margin-bottom: 0; }
.firma-page .ar-red { background: #fae9e2; border-left: 3px solid #993c1d; }
.firma-page .ar-orange { background: #fde7d4; border-left: 3px solid #b56028; }
.firma-page .ar-prio { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.firma-page .ar-red .ar-prio { color: #993c1d; }
.firma-page .ar-orange .ar-prio { color: #b56028; }
.firma-page .ar-text { font-size: 13px; color: var(--c-ink); }

/* Statutáři */
.firma-page .jednani-block { padding: 10px 14px; background: var(--c-bg); border-left: 3px solid var(--c-lide); border-radius: 4px; font-size: 13px; font-style: italic; margin-bottom: 14px; color: var(--c-ink); }
.firma-page .person-line { padding: 10px 0; border-bottom: 1px solid var(--c-line-soft); font-size: 13px; }
.firma-page .person-line:last-child { border-bottom: none; }

/* Karty osob (RR + Mé kontakty) */
.firma-page .person-card {
  padding: 14px 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-line-soft);
  border-radius: 6px;
  margin-bottom: 10px;
}
.firma-page .person-card:last-child { margin-bottom: 0; }
.firma-page .person-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.firma-page .person-name { font-size: 14px; font-weight: 500; }
.firma-page .person-role { font-size: 12px; color: var(--c-ink-muted); }
.firma-page .person-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.firma-page .person-fields { font-size: 12px; color: var(--c-ink-muted); margin-top: 8px; line-height: 1.6; }
.firma-page .person-fields strong { color: var(--c-ink); font-weight: 500; }

/* RR karty */
.firma-page .rr-actions { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.firma-page .rr-card { padding: 10px 12px; background: var(--c-bg); border-radius: 5px; margin-bottom: 8px; font-size: 13px; }
.firma-page .rr-card:last-child { margin-bottom: 0; }
.firma-page .rr-name { font-weight: 500; margin-bottom: 4px; }
.firma-page .rr-fields { color: var(--c-ink-muted); font-size: 12px; line-height: 1.6; }
.firma-page .rr-fields strong { color: var(--c-ink); }
.firma-page .rr-empty-line { font-size: 11px; color: var(--c-ink-soft); font-style: italic; }
.firma-page .btn-cost { font-size: 11px; color: var(--c-ink-soft); }

/* Veřejná stopa — prose + collapse */
.firma-page .stopa-prose { font-size: 13px; line-height: 1.7; color: var(--c-ink); margin-top: 8px; }
.firma-page .stopa-prose p { margin-bottom: 10px; }
.firma-page .stopa-prose p:last-child { margin-bottom: 0; }
.firma-page .stopa-collapsed { max-height: 70px; overflow: hidden; position: relative; }
.firma-page .stopa-collapsed::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 30px; background: linear-gradient(transparent, #fff);
}
.firma-page .stopa-toggle {
  margin-top: 8px; font-size: 12px; color: var(--accent);
  cursor: pointer; background: none; border: none; padding: 4px 0;
  font-family: inherit;
}
.firma-page .action-row { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Poznámky */
.firma-page .note-label { font-size: 10px; font-weight: 600; color: var(--c-firma); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.firma-page .note-textarea {
  width: 100%; min-height: 60px; padding: 10px 12px;
  border: 1px solid var(--c-line); border-radius: 5px;
  font-family: inherit; font-size: 13px; line-height: 1.5;
  background: var(--c-bg); resize: vertical; color: var(--c-ink);
  box-sizing: border-box;
}
.firma-page .note-textarea:focus { outline: none; border-color: var(--c-firma); background: #fff; }
.firma-page .note-actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.firma-page .note-saved-info { font-size: 11px; color: var(--c-ink-soft); }

/* Status systém */
.firma-page .status-block { padding: 12px 14px; background: var(--c-bg); border-radius: 5px; margin-bottom: 14px; }
.firma-page .status-block-label { font-size: 10px; font-weight: 600; color: var(--c-firma); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.firma-page .status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.firma-page .status-select { font-family: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--c-line); border-radius: 5px; background: #fff; color: var(--c-ink); cursor: pointer; min-width: 200px; }
.firma-page .status-select:disabled { opacity: 0.6; cursor: not-allowed; }
.firma-page .status-meta { font-size: 11px; color: var(--c-ink-soft); }

.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 10px; border-radius: 10px; font-weight: 500; }
.status-pill.status-nezpracovano { background: #f1efe8; color: #6b6962; }
.status-pill.status-k_osloveni { background: #fff8e7; color: #b8730d; }
.status-pill.status-oslovena_cekam { background: #fde7d4; color: #b56028; }
.status-pill.status-v_jednani { background: #e1f5ee; color: #0f6e56; }
.status-pill.status-klient { background: #d4f0e0; color: #0a5c40; }
.status-pill.status-odlozeno { background: #e0e9f0; color: #2d4a6a; }
.status-pill.status-nezajima { background: #ebe8e2; color: #888; text-decoration: line-through; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.status-dot.nezpracovano { background: #888; }
.status-dot.k_osloveni { background: #f0a020; }
.status-dot.oslovena_cekam { background: #b56028; }
.status-dot.v_jednani { background: #0f6e56; }
.status-dot.klient { background: #0a5c40; }
.status-dot.odlozeno { background: #2d4a6a; }
.status-dot.nezajima { background: #ccc; }

/* Web status */
.firma-page .web-status { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.firma-page .web-status.verified { background: #e1f5ee; color: #0f6e56; }
.firma-page .web-status.unverified { background: var(--c-bg); color: var(--c-ink-soft); border: 1px solid var(--c-line); }

/* Empty state */
.firma-page .empty-line { font-size: 12px; color: var(--c-ink-soft); font-style: italic; padding: 8px 0; }

/* Externí odkazy */
.firma-page .ext-links { font-size: 13px; }
.firma-page .ext-links a { color: var(--accent); text-decoration: none; margin-right: 14px; }

/* Admin sekce */
.firma-page .admin-divider { text-align: center; margin: 30px 0 14px; font-size: 11px; letter-spacing: 0.15em; color: var(--c-ink-soft); text-transform: uppercase; }
.firma-page .admin-sec { background: #fff; border: 1px solid var(--c-line); border-radius: 8px; padding: 16px 20px; margin-bottom: 12px; }
.firma-page .admin-label { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; color: #2d4a6a; text-transform: uppercase; background: #e0e9f0; padding: 2px 8px; border-radius: 3px; display: inline-block; margin-bottom: 6px; }
.firma-page .config-display { background: var(--c-bg); border-radius: 5px; padding: 12px; font-family: monospace; font-size: 11px; white-space: pre-wrap; line-height: 1.5; max-height: 400px; overflow-y: auto; }

/* Source tagy */
.source-tags { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: 2px; }
.source-tag { font-size: 9px; font-weight: 600; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 3px; background: #f1efe8; color: #6b6962; border: 1px solid #e8e6df; text-transform: uppercase; }
.source-tag.chr { background: #f0f7f4; color: #0f6e56; border-color: #c8e8d8; }
.source-tag.ares { background: #e0e9f0; color: #2d4a6a; border-color: #b8c8d8; }
.source-tag.claude { background: #fae9e2; color: #993c1d; border-color: #f0c0a8; }
.source-tag.rr { background: #fff8e7; color: #b8730d; border-color: #f0d8a0; }
.source-tag.muj { background: #f3eff8; color: #6a4a8a; border-color: #d8c8e8; }
.source-tag.mujdb { background: #e0e9f0; color: #6a4a8a; border-color: #b8c8d8; }
body:not(.show-admin) .source-tags { display: none; }
body:not(.show-admin) .api-info { display: none; }
body:not(.show-admin) .admin-divider { display: none; }
body:not(.show-admin) .admin-sec { display: none; }

.firma-page .api-info { font-size: 11px; padding: 8px 12px; background: #f0f7f4; border-left: 3px solid #0f6e56; border-radius: 4px; margin-top: 12px; color: var(--c-ink-muted); line-height: 1.55; }
.firma-page .api-info strong { color: #0f6e56; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 2px; }
.firma-page .api-info code { background: #fff; padding: 1px 4px; border-radius: 3px; font-size: 11px; font-family: monospace; color: var(--c-ink); }

/* Filtrovací chips (sdíleno mezi firma + uložené-firmy) */
.filter-bar { background: #fff; padding: 14px 18px; border: 1px solid var(--c-line); border-radius: 8px; margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { font-family: inherit; font-size: 12px; padding: 6px 12px; background: #fff; color: var(--c-ink-muted); border: 1px solid var(--c-line); border-radius: 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-chip-count { font-size: 10px; opacity: 0.8; }
