/* ============================================================
   Klientský portál Solvio - vizuálně navazuje na web solvio.cz
   (02_SolvioWebV2): akcent #65b46b, Poppins (nadpisy) + Inter (text),
   hero foto se zeleným překryvem, tmavá patička. Jen světlý režim jako web.
   Fonty jsou lokálně (CSP Strict nepovoluje Google Fonts).
   ============================================================ */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/poppins-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/poppins-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/poppins-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/poppins-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/poppins-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/poppins-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  /* Barvy webu solvio.cz */
  --green: #65b46b;
  --green-dark: #549a5a;
  --green-ink: #2f6b39;
  --green-tint: #eaf7ec;
  --heading: #2b2f33;
  --text: #5f6368;
  --line: #ececec;
  --field-line: #dcdcdc;
  --bg: #fafafa;
  --surface: #ffffff;
  --footer: #2b2f31;
  --header-h: 76px;
  --font-head: "Poppins", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(30, 45, 35, .06);
  /* Stavy */
  --ok: #2f6b39;   --ok-bg: #eaf7ec;
  --warn: #8a5a00; --warn-bg: #fdf1d8;
  --bad: #a32020;  --bad-bg: #fbe3e3;
  --done: #245a8c; --done-bg: #e2ecf7;
  /* Zpětná kompatibilita pro starší třídy */
  --accent: var(--green);
  --accent-ink: var(--green-ink);
  --ink: var(--heading);
  --muted: #7a7f84;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--heading); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 1.25rem; }
h1::after { content: ""; display: block; width: 46px; height: 3px; background: var(--green); border-radius: 2px; margin-top: .6rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 .5rem; }
strong { color: var(--heading); }
a { color: var(--green-dark); text-decoration: none; }
a:hover { color: var(--green-ink); text-decoration: underline; }
img { max-width: 100%; height: auto; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1001; background: var(--green); color: #fff; padding: 10px 16px; }
.skip-link:focus { left: 0; }

/* ============================================================
   Hlavička (jako sticky stav webu: bílá, zelené logo)
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 100; height: var(--header-h); display: flex; align-items: center;
  background: var(--surface); box-shadow: 0 1px 10px rgba(0,0,0,.08); }
.header-inner { display: flex; align-items: center; gap: 2rem; width: 100%; max-width: 1600px; margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { height: 42px; width: auto; display: block; }
.brand .logo-white { display: none; }
.brand-label { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); padding-left: 14px; border-left: 1px solid var(--line); line-height: 1.2; }

.nav { display: flex; gap: 28px; flex: 1; }
.nav a { font-family: var(--font-head); font-weight: 600; font-size: 13.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--heading); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--green); text-decoration: none; }
.nav a.active { color: var(--green); border-color: var(--green); }
.user { display: flex; align-items: center; gap: .9rem; font-size: .88rem; margin: 0 0 0 auto; }
.user-name { color: var(--text); }
button.link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--green-dark); font-weight: 600; }
button.link:hover { color: var(--green-ink); text-decoration: underline; }

/* Na stránkách s hero je hlavička průhledná přes foto a logo bílé (jako web nahoře) */
.has-hero .site-header { position: absolute; left: 0; right: 0; background: transparent; box-shadow: none; }
.has-hero .brand .logo-green { display: none; }
.has-hero .brand .logo-white { display: block; }
.has-hero .brand-label { color: rgba(255,255,255,.9); border-color: rgba(255,255,255,.35); }
.has-hero .page { max-width: none; padding: 0; display: flex; flex-direction: column; }
.has-hero .page > .hero { flex: 1; }

/* ============================================================
   Hero (foto + zelený překryv, stejné vrstvy jako web)
   ============================================================ */
.hero {
  position: relative; min-height: 64vh; display: flex; align-items: center; color: #fff; text-align: center;
  background-color: #5aa460;
  background-image:
    linear-gradient(180deg, rgba(24,52,29,.42) 0%, rgba(24,52,29,0) 24%),
    linear-gradient(rgba(72,140,80,.30), rgba(58,118,66,.36)),
    url("/images/hero.jpg");
  background-image:
    linear-gradient(180deg, rgba(24,52,29,.42) 0%, rgba(24,52,29,0) 24%),
    linear-gradient(rgba(72,140,80,.30), rgba(58,118,66,.36)),
    image-set(url("/images/hero.webp") type("image/webp"), url("/images/hero.jpg") type("image/jpeg"));
  background-size: cover; background-position: center;
}
.hero-inner { width: 100%; max-width: 1180px; margin: 0 auto; padding: calc(var(--header-h) + 40px) 24px 60px; }
.hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 48px); margin-bottom: 22px; text-shadow: 0 2px 16px rgba(15,35,20,.55); }
.hero h1::after { display: none; }
.hero-sub { font-size: clamp(18px, 2.1vw, 23px); margin: 0 auto 14px; max-width: 760px; text-shadow: 0 2px 12px rgba(15,35,20,.5); }
.hero-note { margin: 0 auto 30px; opacity: .9; text-shadow: 0 1px 8px rgba(15,35,20,.5); }
.auth-card { max-width: 440px; margin: 0 auto; text-align: left; padding: 36px 38px; color: var(--text);
  box-shadow: 0 14px 40px rgba(15,35,20,.25); border: 0; }
.hero .auth-card h1 { color: var(--heading); font-size: 1.45rem; text-shadow: none; margin-bottom: 1rem; }
.hero .auth-card h1::after { display: block; }
.auth-card p { margin: 0 0 .9rem; }
.auth-who { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .25rem 0 .9rem;
  padding: .55rem .8rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.auth-who a { font-weight: 600; font-size: .88rem; white-space: nowrap; }
.auth-foot { margin: 1rem 0 0 !important; }

/* ============================================================
   Obsah
   ============================================================ */
.page { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 24px 2.5rem; }
.page.with-panel { max-width: 1600px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.lead { font-size: 1.15rem; }

/* Tlačítka jako na webu: Poppins, verzálky, malý radius */
.button {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  font-family: var(--font-head); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  padding: 10px 20px; border-radius: 3px; border: 1px solid var(--green);
  background: var(--green); color: #fff; transition: background .2s, color .2s, border-color .2s;
}
.button:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; text-decoration: none; }
.button.secondary { background: var(--surface); color: var(--heading); border-color: var(--field-line); }
.button.secondary:hover { border-color: var(--green); color: var(--green-dark); background: var(--surface); }
.button-light { background: #fff; color: var(--green-dark); border-color: #fff; padding: 14px 28px; font-size: 14px; }
.button-light:hover { background: rgba(255,255,255,.88); border-color: transparent; color: var(--green-dark); }
.button-block { display: block; width: 100%; margin-top: 1.25rem; padding: 13px 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; margin: 3rem auto; }
.card label { display: block; margin: .75rem 0; }
label { color: var(--heading); font-weight: 600; font-size: .92rem; }

input[type=email], input[type=text], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=datetime-local], select {
  display: block; width: 100%; margin-top: .3rem; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--heading);
  background: #fff; border: 1px solid var(--field-line); border-radius: 6px; transition: border-color .2s, box-shadow .2s;
}
textarea {
  display: block; width: 100%; margin-top: .3rem; padding: 10px 12px; color: var(--heading);
  background: #fff; border: 1px solid var(--field-line); border-radius: 6px;
  font: 13px/1.45 ui-monospace, Consolas, monospace; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(101,180,107,.15); }
input[type=radio], input[type=checkbox] { accent-color: var(--green); }

/* Dlaždice na přehledu */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.tile:hover { text-decoration: none; color: var(--text); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30,45,35,.1); }
.tile-value { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--heading); line-height: 1.15; }
.tile-label { font-size: .9rem; }
.tile.tone-ok, .tile.tone-warn, .tile.tone-bad, .tile.tone-done, .tile.tone-muted { background: var(--surface); }
.tile.tone-warn { border-top-color: #e0a526; }
.tile.tone-bad { border-top-color: #d64545; }
.tile.tone-done { border-top-color: #4a83bd; }
.tile.tone-muted { border-top-color: #c4c8cc; border-color: var(--line); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; color: var(--heading); }

/* Filtry stavů */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }
.tabs a { color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .8rem; font-size: .86rem; background: var(--surface); }
.tabs a:hover { border-color: var(--green); color: var(--green-dark); text-decoration: none; }
.tabs a.active { color: #fff; background: var(--green); border-color: var(--green); }

/* Tabulky */
.split { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.with-panel .split { grid-template-columns: minmax(0, 1fr) minmax(380px, 560px); }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.grid th, .grid td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid th { font-family: var(--font-head); font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text); background: var(--bg); }
.grid td { color: var(--heading); }
.grid tbody tr { cursor: pointer; transition: background .12s; }
.grid tbody tr:hover { background: #f4f8f4; }
.grid tr.selected { background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green); }
.grid td a { font-weight: 600; color: var(--green-dark); }
.num { text-align: right !important; white-space: nowrap; }
.grid.compact th, .grid.compact td { padding: .4rem .6rem; font-size: .88rem; }
.grid.compact tbody tr { cursor: default; }
.grid.compact tbody tr:hover { background: transparent; }

.badge { display: inline-block; border-radius: 999px; padding: .08rem .6rem; font-size: .78rem; font-weight: 600; }
.tone-ok { color: var(--ok); background: var(--ok-bg); }
.tone-warn { color: var(--warn); background: var(--warn-bg); }
.tone-bad { color: var(--bad); background: var(--bad-bg); }
.tone-done { color: var(--done); background: var(--done-bg); }
.tone-muted { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }

/* Detailový panel */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem;
  position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto; box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.panel label { display: block; margin: .5rem 0; }
.close { font-size: 1.7rem; line-height: 1; color: var(--muted); }
.close:hover { color: var(--heading); text-decoration: none; }
.note { background: var(--warn-bg); color: var(--heading); border-left: 3px solid #e0a526; border-radius: 6px; padding: .65rem .85rem; font-size: .9rem; }
.pdf { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; margin-top: 1rem; background: #fff; }
.history { padding-left: 1.1rem; margin: 0; }
.history li { margin-bottom: .35rem; }
.history li::marker { color: var(--green); }

/* Akce, formuláře, náhled e-mailu */
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; }
.actions form { margin: 0; }
.actions form.confirm { display: flex; align-items: center; gap: .5rem; border: 1px dashed var(--field-line); border-radius: 6px; padding: .25rem .25rem .25rem .7rem; }
.actions form.confirm label { margin: 0; font-size: .86rem; }
.flash { border-radius: 6px; padding: .6rem .85rem; font-size: .9rem; }
.flash.ok { background: var(--green-tint); color: var(--ok); border-left: 3px solid var(--green); }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-left: 3px solid #d64545; }
.card.inset { background: var(--bg); margin: 1rem 0; box-shadow: none; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; align-items: end; }
label.check { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
.toolbar { display: flex; gap: .5rem; margin-bottom: 1rem; align-items: center; }
.toolbar input { margin: 0; max-width: 320px; }
.mail { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; background: var(--bg); font-size: .92rem; color: var(--heading); }
.mail-body { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .5rem; }
.mail-frame { display: block; width: 100%; height: 420px; margin: .6rem 0 .4rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.modes { display: grid; gap: .5rem; }
.modes > .button { justify-self: start; margin-top: .5rem; }
.mode { display: grid !important; grid-template-columns: auto 1fr; column-gap: .6rem; align-items: baseline; }
.mode .muted { grid-column: 2; font-weight: 400; }
/* Správa klientů a uživatelů */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head .badge { margin-top: .45rem; }
.page-head h1 { margin-bottom: 1rem; }
.crumbs { margin: 0 0 .35rem; font-size: .88rem; }
.lead-small { margin: -.25rem 0 1.25rem; max-width: 780px; }
.filters { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem 1.5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.filters .toolbar { margin-bottom: 1.1rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 1.25rem; align-items: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.count { display: inline-block; min-width: 1.6em; padding: 0 .45em; margin-left: .35rem; border-radius: 999px; background: var(--green-tint);
  color: var(--green-ink); font-size: .78rem; text-align: center; vertical-align: middle; }
.checks { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: .25rem 0 .9rem; }
.checks label.check, .inline-roles label.check { margin: 0; }
.inline-roles { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; }
.grid.roles td { vertical-align: middle; }
.grid.roles form { margin: 0; }
textarea.plain-text { font: inherit; font-weight: 400; }
button.link.danger { color: var(--bad); }
.button.danger { background: #c0392b; border-color: #c0392b; }
.button.danger:hover { background: #a93226; border-color: #a93226; }
.danger-zone { border-color: #f1d4d4; }
.danger-zone .actions { align-items: center; }
#novy-klient, #novy-uzivatel { margin-top: 1.5rem; }
select { appearance: auto; }

/* Klientské přihlášení a pozvánka */
.auth-card.wide { max-width: 620px; }
.steps { display: flex; gap: .4rem; list-style: none; padding: 0; margin: -.25rem 0 1.1rem; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; font-size: .8rem; color: var(--muted); padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; }
.steps li::before { content: counter(s) ". "; }
.steps li.current { color: #fff; background: var(--green); border-color: var(--green); }
.steps li.done { color: var(--green-ink); background: var(--green-tint); border-color: transparent; }
.totp-setup { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; line-height: 0; }
.qr-box svg { width: 190px; height: 190px; }
.secret { font: 600 .95rem/1.5 ui-monospace, Consolas, monospace; letter-spacing: .04em; color: var(--heading); background: var(--bg);
  border: 1px dashed var(--field-line); border-radius: 6px; padding: .4rem .6rem; overflow-wrap: anywhere; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1rem; list-style: none; padding: .8rem 1rem; margin: 0 0 1rem;
  background: var(--bg); border: 1px dashed var(--field-line); border-radius: 8px; font: 600 1rem/1.6 ui-monospace, Consolas, monospace; color: var(--heading); }
.auth-card code { font-family: ui-monospace, Consolas, monospace; }
/* Přepínač firem v hlavičce (klient s více firmami) */
.company-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--green-tint); color: var(--green-ink); font: 700 .95rem/1 var(--font-head); letter-spacing: .02em; }
.company-avatar.small { width: 28px; height: 28px; border-radius: 7px; font-size: .72rem; }
.company-switch { position: relative; margin-left: auto; }
.company-switch summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .35rem .6rem .35rem .4rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); max-width: 300px; user-select: none; }
.company-switch summary::-webkit-details-marker { display: none; }
.company-switch summary:hover, .company-switch[open] summary { border-color: var(--green); }
.company-switch-name { font-weight: 600; color: var(--heading); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caret { width: 8px; height: 8px; border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: rotate(45deg) translateY(-2px); flex: none; margin: 0 .2rem; }
.company-switch[open] .caret { transform: rotate(-135deg) translate(-2px, 0); }
.company-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 200; width: 340px; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 40px rgba(30,45,35,.16); padding: .4rem; }
.company-menu-title { margin: .35rem .6rem .45rem; font: 600 .72rem/1 var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.company-menu a { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 8px; color: var(--heading); }
.company-menu a:hover { background: #f4f8f4; text-decoration: none; }
.company-menu a.current { background: var(--green-tint); }
.company-menu a > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.company-menu a strong { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-menu .tick { color: var(--green-ink); font-weight: 700; }
.company-menu a.company-menu-all { justify-content: center; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: .3rem;
  font-size: .86rem; font-weight: 600; color: var(--green-dark); }
.company-single { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; font-weight: 600; color: var(--heading); font-size: .9rem; }
.is-client .user { margin-left: 1rem; }

/* Moje firmy */
.company-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.company-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.company-card:hover { text-decoration: none; color: var(--text); transform: translateY(-2px); border-color: var(--green); box-shadow: 0 10px 28px rgba(30,45,35,.1); }
.company-card.current { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green), var(--shadow); }
.company-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.company-body strong { color: var(--heading); font-family: var(--font-head); font-weight: 600; }
.narrow-codes { max-width: 420px; }
/* Dvoukolové mazání + koš */
.confirm-delete { max-width: 720px; }
.impacts { margin: .5rem 0 1.25rem; padding-left: 1.2rem; }
.impacts li { margin-bottom: .35rem; }
.confirm-target { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: 4px; background: var(--bad-bg); color: var(--bad);
  font-family: ui-monospace, Consolas, monospace; font-weight: 600; user-select: all; }
.confirm-delete label input { max-width: 420px; }
.nav a.nav-quiet { color: var(--muted); }
.pick-filter { max-width: 360px; margin: .25rem 0 .6rem; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem 1rem; max-height: 260px; overflow: auto;
  padding: .6rem .75rem; margin-bottom: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.pick-item { margin: 0 !important; padding: .2rem 0; }
.pick-item[hidden] { display: none !important; }
.inline-form { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.inline-form label { margin: 0; min-width: 260px; }
.small-button { padding: 6px 12px; font-size: 11.5px; }
.client-invoices td { vertical-align: middle; }
.invite-box { border: 1px solid var(--green); background: var(--green-tint); border-radius: 8px; padding: .8rem 1rem; margin: .5rem 0 1rem; }
.invite-box .secret { background: #fff; font-size: .82rem; }
@media (max-width: 560px) {
  .totp-setup { grid-template-columns: 1fr; justify-items: center; }
  .recovery-codes { grid-template-columns: 1fr; }
}
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .25rem 0; }

/* ============================================================
   Patička (jako web)
   ============================================================ */
.site-footer { background: var(--footer); color: #b9c0c2; font-size: 14px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  max-width: 1600px; margin: 0 auto; padding: 22px 24px; }
.site-footer p { margin: 0; }
.site-footer a { color: #dfe4e5; margin: 0 4px; }
.site-footer a:hover { color: var(--green); text-decoration: none; }
.footer-tag { display: inline-block; margin-left: .35rem; padding: 0 .5rem; border: 1px solid #4a5053; border-radius: 999px; font-size: 12px; }

/* ============================================================
   Responzivita
   ============================================================ */
@media (max-width: 1100px) {
  .nav { gap: 18px; }
  .user-name { display: none; }
}
@media (max-width: 900px) {
  .with-panel .split { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .site-header { height: auto; }
  .is-staff .header-inner { flex-wrap: wrap; gap: .5rem 1.25rem; padding-top: 10px; padding-bottom: 10px; }
  .is-staff .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .has-hero .site-header { height: var(--header-h); }
}
@media (max-width: 560px) {
  .cols { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .brand-label { display: none; }
  .auth-card { padding: 26px 22px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .page { padding: 1.5rem 16px 2rem; }
}
