/* =====================================================
   Pohledávky — design systém
   Barvy, typografie a rádiusy převzaté z dodané grafiky.
   Fonty jsou hostované lokálně (CSP blokuje externí zdroje).
   ===================================================== */

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/manrope-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('../fonts/manrope-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: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/jetbrains-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/jetbrains-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 {
    --bg: #f2f5f1;
    --surface: #ffffff;
    --border: #dfe6df;
    --border-soft: #e2e8e2;
    --border-card: #dde5dd;
    --border-input: #d5ded5;

    --ink: #171e1a;
    --ink-2: #3b4740;
    --ink-3: #4c5851;
    --muted: #5c675f;
    --muted-2: #67736b;
    --gray: #9aa79c;

    --primary: #14624f;
    --primary-dark: #0d4638;
    --primary-bg: #e2efe9;
    --primary-bg-2: #d3e7dd;
    --primary-bd: #b9d8ca;

    --green: #1f7a4d;
    --green-bg: #e8f3ec;
    --red: #b03a2b;
    --red-bg: #fbeae6;
    --red-bd: #f0cfc8;
    --amber: #8a5c10;
    --amber-bg: #fbf0da;
    --amber-strong: #c07a10;
    --mute-bg: #edf1ec;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(23, 30, 26, .04);
    --shadow-lg: 0 12px 34px rgba(23, 30, 26, .13);
    --sidebar-w: 268px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font-family: Manrope, system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
input, select, button, textarea { font-family: inherit; font-size: inherit; }
.icon { flex: 0 0 auto; }
.num { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #e3e7ee; }
::-webkit-scrollbar-thumb { background: #b8c3ba; border-radius: 8px; }

@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ Layout ============ */
.app { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 20px 16px; display: flex; flex-direction: column; gap: 20px;
    position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
}
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { padding: 24px 30px 48px; animation: riseIn 260ms ease both; }

/* ---- Sidebar ---- */
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.sb-logo {
    width: 32px; height: 32px; border-radius: 10px; background: var(--primary);
    color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: 0 0 auto;
}
.sb-brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.sb-brand:hover { text-decoration: none; }

.sb-firm { display: flex; flex-direction: column; gap: 6px; }
.sb-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); padding: 0 6px; }
.sb-firm-box {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--mute-bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--ink);
}

.sb-nav { display: flex; flex-direction: column; gap: 18px; }
.sb-group { display: flex; flex-direction: column; gap: 3px; }
.sb-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600; color: var(--ink-2);
    border-left: 3px solid transparent; transition: background 140ms ease, color 140ms ease;
}
.sb-item:hover { background: var(--mute-bg); color: var(--ink); text-decoration: none; }
.sb-item.is-active { background: var(--primary-bg); color: var(--primary-dark); border-left-color: var(--primary); }
.sb-item .icon { color: currentColor; opacity: .8; }
.sb-item-text { flex: 1; min-width: 0; }
.sb-count {
    font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
    background: var(--mute-bg); color: var(--muted-2);
}
.sb-item.is-active .sb-count { background: var(--primary-bg-2); color: var(--primary-dark); }
.sb-count.is-alert { background: var(--red-bg); color: var(--red); }

.sb-deadline {
    margin-top: auto; border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 13px 14px; display: flex; flex-direction: column; gap: 5px; background: var(--surface);
}
.sb-deadline-label { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.sb-deadline-rel { font-size: 15px; font-weight: 800; }
.sb-deadline-title { font-size: 12px; color: var(--ink-3); line-height: 1.4; }

.sb-user { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.avatar {
    width: 34px; height: 34px; border-radius: 999px; flex: 0 0 auto;
    background: var(--primary-bg); color: var(--primary-dark);
    display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.sb-user-meta { flex: 1; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 700; color: var(--ink); display: block; }
.sb-user-role { font-size: 11.5px; color: var(--muted); }
.sb-logout { color: var(--muted); display: grid; place-items: center; padding: 6px; border-radius: 8px; }
.sb-logout:hover { background: var(--mute-bg); color: var(--red); text-decoration: none; }

/* ---- Topbar ---- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px;
    padding: 14px 30px; background: rgba(242, 245, 241, .92);
    backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.tb-crumb { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tb-crumb b { color: var(--ink); font-weight: 700; }
.tb-search { flex: 1; max-width: 420px; position: relative; display: flex; align-items: center; }
.tb-search .icon { position: absolute; left: 12px; color: var(--muted); }
.tb-search input {
    width: 100%; padding: 9px 12px 9px 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-input); background: var(--surface); color: var(--ink);
}
.tb-search input:focus { outline: none; border-color: var(--primary-bd); box-shadow: 0 0 0 3px var(--primary-bg); }
.tb-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.tb-toggle { display: none; background: none; border: 1px solid var(--border-input); border-radius: 9px; padding: 7px; color: var(--ink-2); cursor: pointer; }

/* ============ Stránka ============ */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
    flex-wrap: wrap; margin-bottom: 20px;
}
.page-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin: 0 0 6px; }
.page-title { font-size: 26px; }
.page-sub { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ============ Karty ============ */
.card {
    background: var(--surface); border: 1px solid var(--border-card);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 15px 20px; border-bottom: 1px solid var(--border-soft);
}
.card-title { font-size: 15px; font-weight: 800; }
.card-note { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-body { padding: 18px 20px; }
.card-body.is-flush { padding: 0; }
.card.is-danger { border-color: var(--red-bd); }

/* Klikatelná karta (dlaždice nemovitosti apod.) */
.card-link { display: block; color: inherit; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(23, 30, 26, .09); border-color: var(--primary-bd); }

/* ---- Statistické dlaždice ---- */
.stat {
    background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
}
.stat-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-value small { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat.is-red .stat-value { color: var(--red); }
.stat.is-green .stat-value { color: var(--green); }
.stat.is-amber .stat-value { color: var(--amber-strong); }

/* Banner portfolia */
.hero {
    background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius);
    padding: 20px 22px; box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.hero-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.hero-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 2px; }
.hero-sub { font-size: 13px; color: var(--muted); }

/* ---- Pilulky ---- */
.chip {
    display: inline-block; padding: 4px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap; line-height: 1.35;
}
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-red   { background: var(--red-bg);   color: var(--red); }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-blue  { background: var(--primary-bg); color: var(--primary); }
.chip-mute  { background: var(--mute-bg);  color: var(--muted); }
.chip-gray  { background: var(--mute-bg);  color: var(--gray); }

/* ---- Tlačítka ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 17px; border-radius: var(--radius-sm); border: 1px solid var(--border-input);
    background: var(--surface); color: var(--ink-2);
    font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: all 160ms ease; text-decoration: none;
}
.btn:hover { border-color: var(--primary-bd); background: var(--primary-bg); color: var(--primary-dark); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; border-color: #000; color: #fff; }
.btn-danger { color: var(--red); border-color: var(--red-bd); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--mute-bg); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 6px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Filtry ---- */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
    padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-input);
    background: var(--surface); color: var(--ink-3); font-size: 13px; font-weight: 600; cursor: pointer;
}
.filter-chip:hover { border-color: var(--primary-bd); text-decoration: none; color: var(--primary-dark); }
.filter-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ Tabulky ============ */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; padding: 11px 20px; font-size: 10.5px; font-weight: 700;
    letter-spacing: .1em; color: var(--muted); text-transform: uppercase;
    border-bottom: 1px solid var(--border-soft); background: #fafcfa; white-space: nowrap;
}
.table td { padding: 13px 20px; border-bottom: 1px solid #eef2ee; font-size: 13.5px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafcfa; }
.table .t-right { text-align: right; }
.table .t-strong { font-weight: 700; color: var(--ink); }
.table .t-sub { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.table-wrap { overflow-x: auto; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 5px; }

/* ---- Klíč–hodnota ---- */
.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid #eef2ee; font-size: 13.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row dt { flex: 0 0 42%; color: var(--muted); margin: 0; }
.kv-row dd { flex: 1; margin: 0; font-weight: 600; color: var(--ink); word-break: break-word; }

/* ---- Ukazatel podílu ---- */
.bar { height: 7px; border-radius: 999px; background: var(--mute-bg); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bucket { display: flex; flex-direction: column; gap: 7px; padding: 11px 0; border-bottom: 1px solid #eef2ee; }
.bucket:last-child { border-bottom: none; }
.bucket-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.bucket-label { color: var(--ink-3); font-weight: 600; }

/* ---- Lhůty ---- */
.dl-row {
    display: flex; align-items: center; gap: 14px; padding: 13px 20px;
    border-bottom: 1px solid #eef2ee; color: inherit;
}
.dl-row:last-child { border-bottom: none; }
.dl-row:hover { background: #fafcfa; text-decoration: none; }
.dl-when { flex: 0 0 96px; }
.dl-rel { font-size: 12.5px; font-weight: 700; }
.dl-date { font-size: 11.5px; color: var(--muted); }
.dl-main { flex: 1; min-width: 0; }
.dl-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.dl-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dl-amount { font-size: 13.5px; font-weight: 700; white-space: nowrap; }

/* ---- Časová osa ---- */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before {
    content: ''; position: absolute; left: 7px; top: 20px; bottom: 0; width: 2px; background: var(--border-soft);
}
.tl-dot { width: 16px; height: 16px; border-radius: 999px; flex: 0 0 auto; margin-top: 2px; border: 4px solid var(--mute-bg); background: var(--gray); }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 13.5px; font-weight: 700; }
.tl-date { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl-note { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* ---- Nástěnka úkolů ---- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-col { background: var(--surface); border: 1px solid var(--border-card); border-radius: var(--radius); box-shadow: var(--shadow); }
.board-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
.board-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.board-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.board-card {
    display: block; border: 1px solid var(--border-soft); border-radius: 12px;
    padding: 12px 14px; color: inherit; background: var(--surface);
}
.board-card:hover { text-decoration: none; border-color: var(--primary-bd); background: #fafcfa; }
.board-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.board-card-title { font-size: 13px; font-weight: 700; line-height: 1.35; }
.board-card-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ---- Přílohy ---- */
.file-row {
    display: flex; align-items: center; gap: 11px; padding: 10px 12px;
    border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface);
}
.file-row + .file-row { margin-top: 7px; }
.file-name { flex: 1; font-weight: 600; font-size: 13px; min-width: 0; word-break: break-word; }
.file-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ============ Formuláře ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.is-wide { grid-column: 1 / -1; }
.form-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.form-label .req { color: var(--red); }
.form-control {
    width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-input); background: var(--surface); color: var(--ink);
}
.form-control:focus { outline: none; border-color: var(--primary-bd); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-control[readonly], .form-control:disabled { background: var(--mute-bg); color: var(--muted); }
textarea.form-control { min-height: 92px; resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--muted); }
.form-check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; }
.form-check input { margin-top: 3px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.fieldset-title {
    grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .12em;
    color: var(--muted); padding-top: 8px; border-top: 1px solid var(--border-soft);
}
.fieldset-title:first-child { border-top: none; padding-top: 0; }

/* ---- Přepínač ---- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 40px; height: 22px; border-radius: 999px; background: #ccd6cc; position: relative; transition: background 160ms ease; flex: 0 0 auto; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: transform 160ms ease; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }

/* ---- Záložky ---- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab {
    padding: 10px 15px; font-size: 13.5px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* ---- Hlášky ---- */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px;
    margin-bottom: 16px; border: 1px solid transparent;
}
.alert-success { background: var(--green-bg); border-color: #c6e2d1; color: #14532d; }
.alert-error   { background: var(--red-bg);   border-color: var(--red-bd); color: #7f2418; }
.alert-info    { background: var(--primary-bg); border-color: var(--primary-bd); color: var(--primary-dark); }
.alert-warning { background: var(--amber-bg); border-color: #e8d2a0; color: var(--amber); }

/* Výrazné varování (riziko) */
.warn-card {
    background: var(--red-bg); border: 1px solid var(--red-bd); border-radius: var(--radius); padding: 18px 20px;
    display: flex; flex-direction: column; gap: 8px;
}
.warn-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--red); }
.warn-text { font-size: 13px; color: #7f2418; line-height: 1.5; }

.text-muted { color: var(--muted); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber-strong); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ============ Přihlášení ============ */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden;
    background: var(--primary); color: #fff; padding: 44px 48px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
/* Jemné prosvětlení, aby plocha nebyla plochá jednobarevná */
.auth-brand::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(120% 90% at 78% 18%, rgba(255, 255, 255, .10), transparent 62%);
    pointer-events: none;
}
.auth-logo, .auth-foot { position: relative; z-index: 1; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo-mark {
    width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .16);
    display: grid; place-items: center; font-weight: 800; font-size: 17px;
}
.auth-logo-text b { display: block; font-size: 17px; font-weight: 800; }
.auth-logo-text small { font-size: 12.5px; opacity: .78; }

/* Vlny výnosové křivky — dekorace u spodní hrany, záměrně bez kontrastu */
.auth-art {
    position: absolute; inset: 0;
    pointer-events: none; z-index: 0;
}
.auth-art svg { width: 100%; height: 100%; display: block; }

.auth-foot { font-size: 12px; opacity: .72; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 32px; background: var(--bg); min-width: 0; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; }
.auth-card h2 { font-size: 25px; margin-bottom: 8px; }
.auth-card .sub { font-size: 13.5px; color: var(--muted); margin: 0 0 22px; }
.auth-card .form-group { margin-bottom: 15px; }
.auth-links { margin-top: 18px; font-size: 12.5px; text-align: center; color: var(--muted); }

/* ============ Responzivita ============ */
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-side { grid-template-columns: minmax(0, 1fr); }
    .board { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    /* Na mobilu se z brandového panelu stane úzký pruh — jen logo. */
    .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .auth-brand { padding: 20px 24px; gap: 0; justify-content: flex-start; }
    .auth-art, .auth-foot { display: none; }
    .auth-form-side { padding: 32px 20px; }
}

@media (max-width: 780px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%);
        transition: transform 220ms ease; box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: none; }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(23, 30, 26, .4); z-index: 55; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
    .sidebar-backdrop.is-shown { opacity: 1; pointer-events: auto; }
    .tb-toggle { display: inline-flex; }
    .topbar { padding: 12px 16px; }
    .tb-crumb, .tb-meta { display: none; }
    .page { padding: 18px 16px 40px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .page-head { align-items: flex-start; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }

    /* Tabulky se mění na karty */
    .rtable thead { display: none; }
    .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
    .rtable tr {
        border: 1px solid var(--border-soft); border-radius: 12px;
        margin: 0 12px 10px; padding: 4px 0; background: var(--surface);
    }
    .rtable tr:hover { background: var(--surface); }
    .rtable td { border: none; padding: 7px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: right; }
    .rtable td::before {
        content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .06em;
        text-transform: uppercase; color: var(--muted); text-align: left; flex: 0 0 auto;
    }
    .rtable td.rt-block { flex-direction: column; align-items: flex-start; text-align: left; gap: 3px; }
    .rtable td.rt-actions { justify-content: flex-end; }
    .rtable td.rt-actions::before { display: none; }
    .rtable .t-right { text-align: right; }
    .dl-row { flex-wrap: wrap; }
    .dl-when { flex-basis: 100%; display: flex; gap: 8px; align-items: baseline; }
}

@media print {
    .sidebar, .topbar, .page-actions, .toolbar, .row-actions { display: none !important; }
    .page { padding: 0; }
    .card { break-inside: avoid; box-shadow: none; }
}
