/**
 * Portál odečtů – styly
 * Umístění: /www/domains/portalodectu.cz/styly.css
 */

/* ===================== PROMĚNNÉ & RESET ===================== */

:root {
    --bg: #f5f3ef;
    --bg-card: #ffffff;
    --bg-section: #faf9f7;
    --text: #1a1a1a;
    --text-muted: #6b6560;
    --text-light: #9a948e;
    --border: #e8e4de;
    --border-light: #f0ece6;
    --accent: #c8553d;
    --accent-hover: #a8432f;
    --accent-light: #fdf0ed;
    --header-from: #2c2420;
    --header-to: #3d322c;
    --header-text: #ffffff;
    --header-overlay: 255, 255, 255;
    --warn: #b7950b;
    --warn-bg: #fef9e7;
    --tep: #b8860b;
    --tep-bg: #fdf6e3;
    --tv: #c0392b;
    --tv-bg: #fce8e6;
    --sv: #2471a3;
    --sv-bg: #e8f1fa;
    --ok: #2e7d32;
    --ok-bg: #edf7ee;
    --error: #c43e3e;
    --error-bg: #fdeeed;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --radius: 10px;
    --radius-sm: 6px;
    --text-secondary: #4a4540;
    --warning: #d97706;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
input, select, textarea, button { font-family: inherit; }

/* Utility */
.link-inherit { color: inherit; text-decoration: none; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.d-contents { display: contents; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===================== HEADER (admin + přehled) ===================== */

.page-header {
    background: linear-gradient(135deg, var(--header-from) 0%, var(--header-to) 100%);
    color: var(--header-text);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.68rem 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.header-top h1 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.header-title-area {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.header-dum-select {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 30px 8px 14px;
    background-color: rgba(var(--header-overlay),0.1);
    color: var(--header-text);
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    background-image: var(--header-arrow, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E"));
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    transition: border-color 0.2s, background 0.2s;
}
.header-dum-select:hover,
.header-dum-select:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.header-dum-select option { color: var(--text); background: var(--bg-card); }
.header-top .subtitle {
    color: rgba(var(--header-overlay),0.55);
    font-size: 0.88rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-role-badge {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: rgba(var(--header-overlay),0.12);
    color: rgba(var(--header-overlay),0.55);
}
.btn-logout {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(var(--header-overlay),0.6);
    background: rgba(var(--header-overlay),0.08);
    border: 1px solid rgba(var(--header-overlay),0.12);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.btn-logout:hover {
    background: rgba(var(--header-overlay),0.15);
    color: var(--header-text);
}

/* ===================== TABS (admin) ===================== */

.tab-bar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0rem 2rem 0.55rem;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(var(--header-overlay),0.75);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}
.tab-link:hover {
    color: var(--header-text);
    background: rgba(var(--header-overlay),0.1);
}
.tab-link.active {
    color: var(--header-from);
    background: var(--header-text);
    font-weight: 600;
}
.tab-link .tab-count {
    font-size: 0.72rem;
    background: rgba(var(--header-overlay),0.18);
    color: rgba(var(--header-overlay),0.75);
    padding: 0.05rem 0.4rem;
    border-radius: 10px;
    font-weight: 500;
}
.tab-link.active .tab-count {
    background: rgba(0,0,0,0.08);
    color: var(--header-from);
}
.tab-group-first {
    margin-left: auto;
}
.tab-admin {
    color: rgba(var(--header-overlay),0.55);
    font-size: 0.9rem;
}
.tab-admin:hover {
    color: rgba(var(--header-overlay),0.8);
    background: rgba(var(--header-overlay),0.06);
}
.tab-admin .tab-count {
    font-size: 0.68rem;
    background: rgba(var(--header-overlay),0.12);
    color: rgba(var(--header-overlay),0.6);
}
.tab-admin.active .tab-count {
    background: var(--border-light);
    color: var(--text-muted);
}

/* ===================== HAMBURGER MENU ===================== */

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: rgba(var(--header-overlay),0.08);
    border: 1px solid rgba(var(--header-overlay),0.12);
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--header-text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
.hamburger--open .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hamburger--open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger--open .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ===================== CONTAINER ===================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem 0;
}

/* ===================== FLASH MESSAGE ===================== */

.flash {
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--accent-light); color: var(--accent); }

/* ===================== SVG ICONS ===================== */

.icon { display: inline-block; vertical-align: middle; }
.icon-tep { color: var(--tep); }
.icon-drop-tv { color: var(--tv); }
.icon-drop-sv { color: var(--sv); }

/* ===================== BADGES ===================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.badge-tep { background: var(--tep-bg); color: var(--tep); }
.badge-tv { background: var(--tv-bg); color: var(--tv); }
.badge-sv { background: var(--sv-bg); color: var(--sv); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.sigma { text-transform: none; }

/* ===================== PILLS ===================== */

.pill {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}
.pill-admin { background: #e8d5f5; color: #7b2ea8; }
.pill-spravce { background: #d5e8f5; color: #2e6ea8; }
.pill-user { background: var(--border); color: var(--text-muted); }
.pill-active { background: var(--ok-bg); color: var(--ok); }
.pill-inactive { background: var(--accent-light); color: var(--accent); }

/* Log pills */
.pill-login { background: #e8f5e9; color: #2e7d32; }
.pill-logout { background: #e3f2fd; color: #1565c0; }
.pill-fail { background: var(--accent-light); color: var(--accent); }
.pill-edit { background: #fff3e0; color: #e65100; }
.pill-prijem { background: #f0f0f0; color: #616161; }
.pill-error { background: #ffebee; color: #c62828; }
.pill-export { background: #e0f2f1; color: #00695c; }

/* ===================== BUTTONS ===================== */

.btn {
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-section);
    color: var(--text-muted);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { font-size: 0.7rem; padding: 0.2rem 0.5rem; }
.td-actions {
    white-space: nowrap;
    text-align: right;
    width: 1%;
}
.td-actions .btn-sm { margin-left: 0.35rem; }
.td-actions .btn-sm:first-child { margin-left: 0; }
.btn-new { margin-bottom: 1rem; }
.btn-danger { color: var(--accent); border-color: var(--accent-light); }
.btn-danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===================== FILTER BAR ===================== */

.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.search-wrap {
    position: relative;
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
}
.search-wrap input[type="text"] {
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 3.2rem 0.45rem 0.75rem;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}
.search-wrap input[type="text"]:focus { border-color: var(--accent); }
.search-wrap .search-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1.7rem;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 0;
    transition: color 0.15s;
}
.search-wrap .search-btn:hover { color: var(--accent); }
.search-wrap .search-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.search-wrap .search-clear {
    position: absolute;
    right: 1.7rem;
    top: 0;
    bottom: 0;
    width: 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s;
}
.search-wrap .search-clear:hover { color: var(--text); }
.search-wrap .search-clear.visible { display: flex; }
.filter-bar input[type="text"] {
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    outline: none;
    flex: 1;
    min-width: 140px;
    transition: border-color 0.2s;
}
.filter-bar input[type="text"]:focus { border-color: var(--accent); }
.filter-btn {
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-section);
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.filter-btn:hover,
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-sep {
    width: 1px;
    height: 1.4rem;
    background: var(--border);
    align-self: center;
}
.filter-select {
    font-size: 0.82rem;
    line-height: 1.25;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.65rem;
    background-color: var(--bg-section);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    min-width: 7.5rem;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.8rem;
}
.filter-select:hover,
.filter-select:focus { border-color: var(--accent); outline: none; }
.btn-reset-filters {
    font-size: 0.75rem;
    font-weight: 500;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-decoration: none;
    margin-left: auto;
}
.btn-reset-filters:hover { color: var(--text); border-color: var(--text-muted); }
.filter-count {
    font-size: 0.78rem;
    color: var(--text-light);
    white-space: nowrap;
}
.filter-date {
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.38rem 0.5rem;
    background: var(--bg-section);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    width: 8.5rem;
}
.filter-date:focus { border-color: var(--accent); }
.filter-date-dash {
    color: var(--text-muted);
    font-size: 0.85rem;
    user-select: none;
}
.btn-expand-all {
    font-size: 0.75rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===================== ADMIN TABLE ===================== */

.admin-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.admin-table th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border);
    background: var(--bg-section);
    white-space: nowrap;
}
.admin-table td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-section); }
.admin-table .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
}
.admin-table .muted {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* ===================== EDIT PANEL ===================== */

.edit-panel {
    display: none;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 0.5rem 0 1rem;
    box-shadow: var(--shadow-sm);
}
.edit-panel.open { display: block; }
.edit-panel h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    color: var(--text);
}
.edit-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    align-items: center;
}
.edit-row label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 7rem;
    padding-top: 0.3rem;
}
.edit-row input,
.edit-row select,
.edit-row textarea {
    font-size: 0.82rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-card);
}
.edit-row input:focus,
.edit-row select:focus { border-color: var(--accent); }
.edit-row input[type="text"],
.edit-row input[type="password"],
.edit-row input[type="date"],
.edit-row select { width: 220px; }
.edit-row select.select-wide,
.edit-row input.input-wide { width: 440px; max-width: 100%; }
.edit-row textarea {
    width: 100%;
    max-width: 500px;
    min-height: 50px;
    resize: vertical;
}
.input-with-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.input-with-btn input { flex: 0 0 220px; }
.btn-gen-pass {
    white-space: nowrap;
    font-size: 0.75rem;
}
.edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* ===================== VAZBY TABLE ===================== */

.vazby-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}
.vazby-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}
.vazby-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border);
}
.vazby-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.vazby-table tr:last-child td { border-bottom: none; }
.vazby-table input[type="date"] {
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.4rem;
    outline: none;
    width: 140px;
    background: var(--bg-card);
    transition: border-color 0.2s;
}
.vazby-table input[type="date"]:focus { border-color: var(--accent); }
.vazby-inline-form { display: contents; }
.vazby-empty {
    font-size: 0.78rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 0.5rem;
}
.vazby-empty--block {
    padding: 2rem;
    text-align: center;
}
.hidden-submit { display: none; }
.edit-collapse-cell { padding: 0; border: none; }
.user-edit-row,
.byt-edit-row,
.dum-edit-row,
.meridlo-edit-row,
.odecet-edit-row { display: none; }
.user-edit-row:has(.edit-panel.open),
.byt-edit-row:has(.edit-panel.open),
.dum-edit-row:has(.edit-panel.open),
.meridlo-edit-row:has(.edit-panel.open),
.odecet-edit-row:has(.edit-panel.open) { display: table-row; }
.inline-form { display: inline; }
.nowrap { white-space: nowrap; }
.edit-separator {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: .75rem 0;
}
.vazby-add-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}
.vazby-add-form select {
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    outline: none;
    min-width: 160px;
    background: var(--bg-card);
}
.vazby-add-form select:focus { border-color: var(--accent); }
.vazby-add-form input[type="date"] {
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.4rem;
    outline: none;
    width: 140px;
    background: var(--bg-card);
}
.vazby-add-form input[type="date"]:focus { border-color: var(--accent); }

/* ===================== BYT CARD (sdílené admin + přehled) ===================== */

.byt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.byt-card:hover { box-shadow: var(--shadow-md); }
.byt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.1rem;
    cursor: pointer;
    user-select: none;
    gap: 0.75rem;
}
.byt-header:hover { background: var(--bg-section); }
.byt-header--static { cursor: default; }
.byt-header--static:hover { background: transparent; }
.byt-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}
.byt-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 3.2rem;
}
.byt-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-light);
    transition: transform 0.25s;
    font-size: 0.85rem;
}
.byt-card.open .byt-toggle { transform: rotate(180deg); }
.byt-body {
    display: none;
    border-top: 1px solid var(--border-light);
}
.byt-card.open .byt-body { display: block; }

/* Export bar uvnitř byt karty */
.byt-export-bar {
    border-top: 1px solid var(--border-light);
    padding: 0.6rem 1.1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.byt-export-note {
    flex: 1 1 320px;
    margin-right: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.byt-export-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 0.1rem;
}
.byt-export-inline {
    display: inline-block;
    margin-top: -2px;
}
.dropdown-wrap {
    position: relative;
    display: inline-block;
}
.btn-dropdown {
    cursor: pointer;
}
.dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    bottom: 100%;
    margin-bottom: 0.3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 50;
    min-width: 70px;
    overflow: hidden;
}
.dropdown-wrap.open .dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
    color: var(--text);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}
.dropdown-item:hover { background: var(--bg-section); }
.dropdown-item + .dropdown-item { border-top: 1px solid var(--border-light); }

/* ===================== MĚŘIDLO ROW ===================== */

.meridlo {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
}
.meridlo:last-child { border-bottom: none; }

/* ===================== ODEČTY TABLE ===================== */

.no-odecty {
    font-size: 0.78rem;
    color: var(--text-light);
    font-style: italic;
    padding: 0.25rem 0;
}

/* ===================== BYT FILTER (přehled – uživatel s více byty) ===================== */

.byt-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.byt-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.byt-filter-select {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background-color: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%236b6560' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.2rem;
}
.byt-filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ===================== DŘÍVE VLASTNĚNÉ BYTY ===================== */

/* Sdílený styl oddělovačů */
.dum-group-divider,
.former-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem 0;
}
.dum-group-divider:first-child {
    margin-top: 0;
}
.dum-group-divider::after,
.former-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.former-divider::after {
    background: var(--text-light);
}
.dum-group-divider-label,
.former-divider-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-light);
    white-space: nowrap;
}
.former-divider-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}


/* ===================== LOGIN PAGE ===================== */

body.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem 1.5rem 0;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem 2rem;
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--header-from) 0%, var(--header-to) 100%);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.login-icon svg { color: var(--header-text); }
.login-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.login-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.form-group input {
    width: 100%;
    font-size: 0.92rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg);
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-card);
}
.form-group input::placeholder { color: var(--text-light); }
.login-input-icon { position: relative; }
.login-input-icon input { padding-left: 2.6rem; }
.login-input-icon .input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
}
.error-msg {
    background: var(--error-bg);
    color: var(--error);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.error-msg svg { flex-shrink: 0; }
.btn-login {
    width: 100%;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.7rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}
.btn-login:hover { background: var(--accent-hover); }
.btn-login:active { transform: scale(0.98); }
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.72rem;
    color: var(--text-light);
}

/* ===================== STRÁNKOVÁNÍ ===================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    font-size: 0.78rem;
}
.pagination-links {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.pagination-link:hover {
    background: var(--bg-section);
    color: var(--text);
}
.pagination-link.active {
    background: var(--accent);
    color: #fff;
}
.pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.pagination-arrow:hover {
    background: var(--bg-section);
}
.pagination-arrow::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 1.5px solid var(--text);
    border-right: 1.5px solid var(--text);
}
.pagination-prev::after {
    transform: rotate(-135deg);
    margin-left: 2px;
}
.pagination-next::after {
    transform: rotate(45deg);
    margin-right: 2px;
}
.pagination-dots {
    color: var(--text-light);
    padding: 0 0.25rem;
}

/* ===================== PAGE FOOTER ===================== */

.page-footer {
    text-align: center;
    padding: 1rem 1rem 1.5rem;
    font-size: 0.65rem;
    color: var(--text-light);
}

/* ===================== SCROLL TO TOP ===================== */

.scroll-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.15s;
    z-index: 900;
}
.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top:hover {
    background: var(--accent-hover);
}

/* ===================== PROFIL ===================== */

.profil-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.profil-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}
.profil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.profil-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.profil-card h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-light);
}

/* Info list (read-only) */
.profil-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.profil-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-light);
}
.profil-info-row:last-child { border-bottom: none; }
.profil-info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.profil-info-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}

/* Profile form */
.profil-form-group {
    margin-bottom: 0.85rem;
}
.profil-form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}
.profil-form-group input {
    width: 100%;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-card);
}
.profil-form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.profil-form-group input::placeholder { color: var(--text-light); }
.profil-form-group select {
    width: 100%;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-card);
    cursor: pointer;
}
.profil-form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.profil-form-actions {
    margin-top: 1rem;
}

/* ===================== DESIGN SWITCHER ===================== */

.design-switcher {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.1rem;
}
.design-option {
    display: block;
    cursor: pointer;
}
.design-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.design-option-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    height: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.design-option:hover .design-option-card {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.design-option.is-active .design-option-card,
.design-option input:checked + .design-option-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), var(--shadow-md);
}
.design-option-preview {
    position: relative;
    display: block;
    min-height: 138px;
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.design-option-preview--classic {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0)) 0 0 / 100% 44px no-repeat,
        linear-gradient(135deg, #2c2420 0%, #3d322c 100%);
}
.design-option-preview--glass {
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,0.9), rgba(255,255,255,0) 30%),
        radial-gradient(circle at 78% 18%, rgba(120, 189, 255, 0.5), rgba(120, 189, 255, 0) 34%),
        linear-gradient(135deg, #0f2238 0%, #1e4f75 52%, #b4684d 100%);
}
.design-option-preview-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 34px;
    background: rgba(255, 255, 255, 0.14);
}
.design-option-preview-chip {
    position: absolute;
    top: 9px;
    right: 12px;
    width: 52px;
    height: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
}
.design-option-preview-panel {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 62px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.16);
}
.design-option-preview-panel--small {
    left: 12px;
    right: auto;
    bottom: 86px;
    width: 44%;
    height: 26px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
}
.design-option-copy {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.design-option-copy strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}
.design-option-copy span {
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ===================== RESPONSIVE ===================== */

@media (max-width: 640px) {
    /* Admin */
    .header-top { padding: 0.5rem 1rem; row-gap: 0.35rem; }
    .container { padding: 1rem 0.75rem 1rem; }
    .edit-row { flex-direction: column; gap: 0.25rem; }
    .edit-row input,
    .edit-row select { width: 100%; }
    .vazby-add-form { flex-direction: column; align-items: stretch; }
    .vazby-add-form select,
    .vazby-add-form input[type="date"] { width: 100%; }
    .vazby-table input[type="date"] { width: 120px; }

    .header-title-area { display: contents; }
    .header-dum-select {
        font-size: 0.82rem;
        padding: 6px 26px 6px 10px;
        margin-bottom: 6px;
    }

    /* Hamburger menu */
    .hamburger { display: flex; }
    .tab-bar {
        display: none;
        flex-direction: column;
        padding: 0.5rem 1rem 0.75rem;
        gap: 0.15rem;
    }
    .tab-bar--open { display: flex; }
    .tab-link {
        padding: 0.55rem 1rem;
        font-size: 0.88rem;
        border-radius: var(--radius-sm);
        white-space: nowrap;
    }
    .tab-link.active {
        background: rgba(var(--header-overlay),0.15);
        color: var(--header-text);
    }
    .tab-group-first { margin-left: 0; }

    /* User info - hide labels on very small screens */
    .user-role-badge { display: none; }

    /* Profil */
    .profil-grid { grid-template-columns: 1fr; }
    .profil-header { flex-wrap: wrap; gap: 0.5rem; }

    /* Přehled */
    .byt-header { padding: 0.6rem 0.85rem; }
    .meridlo { padding: 0.75rem 0.85rem; }
}

@media (max-width: 440px) {
    .login-wrapper { padding: 1rem 1rem 0; }
    .login-card { padding: 2rem 1.5rem 1.5rem; }
}

/* ===================== METER CARD – nový redesign přehledu ===================== */

.meter-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0.85rem 1rem;
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.meter-card:first-child {
    margin-top: 1rem;
}
.meter-card:last-child {
    margin-bottom: 1rem;
}

/* --- Dvousloupcový layout: (displej + graf) | historie --- */
.meter-layout {
    display: flex;
    gap: 0;
    min-height: 180px;
}

/* Levy sloupec: displej + graf pod sebou */
.meter-left {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
}

/* === LEVÁ STRANA: Vizuální displej měřidla (50%) === */
.meter-display {
    padding: 1rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Barevné pozadí podle typu */
.meter-card--tep .meter-display { background: var(--tep-bg); }
.meter-card--tv  .meter-display { background: var(--tv-bg); }
.meter-card--sv  .meter-display { background: var(--sv-bg); }

/* Typ měřidla – výrazný label */
.meter-type-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}
.meter-card--tep .meter-type-label { color: var(--tep); }
.meter-card--tv  .meter-type-label { color: var(--tv); }
.meter-card--sv  .meter-type-label { color: var(--sv); }

/* Vizuální „přístroj" – rámeček */
.meter-device-inner {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 0.65rem 0.85rem 0.55rem;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
}

/* Dekorativní okraj nahoře podle typu */
.meter-card--tep .meter-device-inner { border-top: 3px solid var(--tep); }
.meter-card--tv  .meter-device-inner { border-top: 3px solid var(--tv); }
.meter-card--sv  .meter-device-inner { border-top: 3px solid var(--sv); }

/* Vizuální „přístroj" – dvousloupcový řádek */
.meter-device-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.meter-device-left {
    flex: 0 1 auto;
    min-width: 0;
}
.meter-device-right {
    flex: 0 0 auto;
    text-align: right;
}
.meter-device-label {
    margin-bottom: 0.1rem;
}
.meter-device-right .meter-device-group + .meter-device-group {
    margin-top: 0.45rem;
}
.meter-device-right .meter-device-group .meter-device-label {
    margin-top: 0;
}
.meter-device-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

/* LCD displej s hodnotou – styl vodoměru */
.meter-device-screen {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
}
.meter-digits {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.meter-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 2.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.meter-digit--dec {
    color: var(--accent);
    background: var(--accent-light);
    border-color: rgba(200, 85, 61, 0.25);
}
.meter-digit-sep {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0;
    margin: 0 -2px -10px -2px;
}
.meter-digits-unit {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 0.4rem;
}
.meter-value--empty {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-light);
}

/* === PRAVÁ STRANA: Tabulka historie (~65%) === */
.meter-history {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1.1rem 0.65rem;
}
.meter-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}
.meter-history-year-select {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-section);
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' stroke='%236b6560' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
    min-width: 5.5rem;
}
.meter-history-year-select:focus {
    border-color: var(--accent);
}
.meter-history-year-select:hover {
    border-color: var(--text-light);
}
/* Sdílený styl pro malé uppercase labely */
.meter-history-title,
.meter-chart-title,
.meter-device-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}
.meter-history-title {
    margin-bottom: 0;
}

/* Scrollovatelný kontejner */
.meter-history-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 24rem; /* cca 10 řádků + hlavička */
    /* Tenký scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.meter-history-scroll::-webkit-scrollbar {
    width: 5px;
}
.meter-history-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.meter-history-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
.meter-history-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Panel historie (odečty / spotřeby) */
.meter-history-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.history-toggle {
    flex-shrink: 0;
}
.spotreba-odhad {
    color: var(--text-light);
    font-size: 0.7rem;
    cursor: help;
}
.spotreba-total td {
    border-top: 2px solid var(--border);
}

/* Tabulka historie */
.meter-history-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}
.meter-history-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.meter-history-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
}
.meter-history-table th.text-right {
    text-align: right;
}
.meter-history-table th.text-center {
    text-align: center;
}
.meter-history-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
}
.meter-history-table tr:last-child td {
    border-bottom: none;
}
.meter-history-table tr:hover td {
    background: var(--bg-section);
}
.meter-history-table .stav {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.82rem;
    white-space: nowrap;
}
.meter-history-table .cas {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    text-align: right;
}
/* Měřidlo + Způsob: shrinkable when space is tight */
.meter-history-table .td-shrink {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 5rem;
}

/* === SPODNÍ ČÁST: Graf přes celou šířku === */
.meter-chart {
    border-top: 1px solid var(--border-light);
    padding: 0.85rem 1.1rem 0.65rem;
    background: var(--bg-section);
    height: 250px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.meter-chart-title {
    flex-shrink: 0;
}
.meter-unit-inline {
    text-transform: none;
}
.meter-chart canvas {
    width: 100% !important;
    flex: 1;
    min-height: 0;
}
.meter-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}
.meter-chart-header .meter-chart-title {
    margin-bottom: 0;
}
.chart-toggle {
    display: flex;
    gap: 2px;
    background: var(--border-light);
    border-radius: 6px;
    padding: 2px;
}
.chart-toggle-btn {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 3px 10px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}
.chart-toggle-btn:hover {
    color: var(--text);
}
.chart-toggle-btn.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.chart-canvas-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.chart-estimate-note {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1;
}
.chart-estimate-swatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 2px,
        rgba(120, 110, 100, 0.35) 2px,
        rgba(120, 110, 100, 0.35) 4px
    );
    border: 1px solid rgba(120, 110, 100, 0.3);
}
.meter-comparison {
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 8px 12px;
}
.meter-comparison--neutral {
    background: var(--bg-section);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}
.meter-comparison--ok {
    background: var(--ok-bg);
    color: var(--ok);
}
.meter-comparison--caution {
    background: var(--warn-bg);
    color: var(--warn);
}
.meter-comparison--alert {
    background: var(--error-bg);
    color: var(--error);
}
.comparison-icon {
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1.25;
}
.comparison-text {
    color: var(--text);
}
.comparison-text strong {
    font-weight: 600;
}

/* ===================== ANALÝZA ===================== */

.analyza-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}
.analyza-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.analyza-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.analyza-section + .analyza-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}
.analyza-result {
    margin-top: 1.25rem;
}
.analyza-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}
.analyza-result-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
}
.analyza-output-wrap {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: max-height 0.3s ease;
}
.analyza-output-wrap.collapsed {
    max-height: 0;
    overflow: hidden;
    border-color: transparent;
    box-shadow: none;
}
.analyza-output {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-card);
    padding: 1rem 1.25rem;
    white-space: pre;
    margin: 0;
}

/* ===================== EXPORT FORMULÁŘE ===================== */

.export-form {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.export-fields {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.export-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.export-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.export-field input[type="date"],
.export-field input[type="number"],
.export-field input[type="text"],
.export-field select {
    font-size: 0.82rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
}
.export-field input[type="date"]:focus,
.export-field input[type="number"]:focus,
.export-field input[type="text"]:focus,
.export-field select:focus {
    border-color: var(--accent);
    outline: none;
}
.export-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-light);
}

/* ===================== RESPONSIVE – meter cards ===================== */

@media (max-width: 700px) {
    .meter-layout {
        flex-direction: column;
    }
    .meter-left {
        flex: none;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .meter-display {
        padding: 1rem 0.85rem 0.85rem;
    }
    .meter-history {
        padding: 0.75rem 0.85rem;
    }
    .meter-history-scroll {
        max-height: 260px;
    }
    .meter-chart {
        padding: 0.65rem 0.85rem;
        height: 200px;
    }
    .meter-digit {
        width: 1.45rem;
        height: 1.85rem;
        font-size: 1.15rem;
    }
    .meter-digit-sep {
        font-size: 1.15rem;
    }
    .meter-device-left {
        flex: 1 1 100%;
    }
    .meter-device-right {
        flex: 1 1 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border-top: 1px dashed var(--border-light);
        padding-top: 0.5rem;
    }
    .meter-device-right .meter-device-group:last-child {
        text-align: right;
    }
    .meter-device-right .meter-device-group + .meter-device-group {
        margin-top: 0;
    }
}

/* ===== Způsob odečtu – ikony s tooltipem ===== */
.zpusob-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    font-size: 0.85rem;
    line-height: 1;
    cursor: default;
    color: var(--text-muted);
}
.zpusob-icon[title] {
    cursor: default;
}
.zpusob-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Lupa odkaz v meter-history */
.meter-history-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.15s;
}
.meter-history-link:hover {
    opacity: 1;
    color: var(--primary);
}
.meter-history-link svg {
    width: 14px;
    height: 14px;
}
.meter-history-table th.th-link,
.meter-history-table td.td-link {
    width: 1.8rem;
    padding-left: 0.2rem;
    padding-right: 0.4rem;
    text-align: center;
}

/* Zpusob icon in admin table */
.admin-table .zpusob-icon {
    vertical-align: middle;
}

/* ===================== THEME SELECTOR (admin – vzhled) ===================== */

/* Sync form */
.sync-form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.sync-form-row label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.sync-form-row input[type="date"] {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
}

/* ===================== NÁSTĚNKA ===================== */

.nastenka-header {
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name badge"
        "addr badge";
    align-items: flex-start;
    gap: 0.2rem;
}
.nastenka-header-left {
    grid-area: name;
    min-width: 0;
}
.nastenka-dum-addr-wrap {
    grid-area: addr;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Série 100 % – styl "dny bez nehody" */
.streak-badge {
    grid-area: badge;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 0.65rem 0.85rem 0.55rem;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.8);
    position: relative;
    overflow: hidden;
    min-width: 210px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.streak-badge--ok {
    border-top: 3px solid #16a34a;
}
.streak-badge--zero {
    border-top: 3px solid #dc2626;
}
.streak-badge--pending {
    border-top: 3px solid var(--warn);
}
.streak-badge-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 0.2rem;
}
.streak-badge-number .meter-digit {
    width: 2rem;
    font-size: 2.6rem;
}
.streak-badge--ok .meter-digit {
    color: #16a34a;
    background: #f0fdf4;
    border-color: rgba(22, 163, 74, 0.25);
}
.streak-badge--zero .meter-digit {
    color: #dc2626;
    background: #fef2f2;
    border-color: rgba(220, 38, 38, 0.25);
}
.streak-badge--pending .meter-digit {
    color: var(--warn);
    background: var(--warn-bg);
    border-color: rgba(183, 149, 11, 0.25);
}
.streak-badge-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    line-height: 1.25;
    padding-right: 0;
}

.nastenka-dum-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.nastenka-dum-addr {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Souhrnné karty */
.nastenka-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.nastenka-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    transition: box-shadow 0.2s;
}
.nastenka-card:hover {
    box-shadow: var(--shadow-md);
}
.nastenka-card-icon {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.nastenka-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    font-family: 'JetBrains Mono', monospace;
}
.nastenka-card-value--sm {
    font-size: 1.05rem;
}
.nastenka-card-frac {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.nastenka-card-sub {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
}
.nastenka-card-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Denní navigátor */
.nastenka-card--day {
    display: block;
    margin-bottom: 1.5rem;
}
.nastenka-day-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.nastenka-day-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.nastenka-day-btn:hover {
    background: var(--bg-section);
    border-color: var(--accent);
    color: var(--accent);
}
.nastenka-day-btn--disabled {
    opacity: 0.25;
    pointer-events: none;
}
.nastenka-day-label {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.nastenka-day-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--accent);
    color: #fff;
    padding: 0.1em 0.45em;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.25rem;
    position: relative;
    top: -1px;
}
.nastenka-day-nav .nastenka-day-btn--today {
    width: 30px;
    height: 30px;
}
.nastenka-day-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.nastenka-day-stats + .nastenka-day-stats {
    margin-top: 1rem;
}
.nastenka-day-stats--3col {
    grid-template-columns: repeat(3, 1fr);
}
.nastenka-day-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--bg);
    border-radius: calc(var(--radius) - 2px);
    padding: 0.9rem 1rem;
}
.nastenka-day-stat-icon {
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 0.1rem;
    opacity: 0.8;
}
.nastenka-day-stat-body {
    flex: 1;
    width: 100%;
}
.nastenka-day-stat--hero {
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
}
.nastenka-day-stat--hero-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}
.nastenka-day-stat--hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.nastenka-day-stat-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}
.nastenka-day-stat-val {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    line-height: 1.2;
}
.nastenka-day-stat-val--ok    { color: var(--ok); }
.nastenka-day-stat-val--alert { color: var(--error); }
.nastenka-day-stat-val--muted {
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 500;
}
.nastenka-day-stat-val .nastenka-card-frac {
    font-size: 0.85rem;
}
.nastenka-day-stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}
/* Kroužky pokrytí podle typu */
.nastenka-coverage-rings {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.coverage-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--border-light) 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.coverage-ring::before {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--bg);
}
.coverage-ring-icon,
.coverage-ring-val {
    position: relative;
    z-index: 1;
    line-height: 1;
}
.coverage-ring-icon {
    font-size: 0;
}
.coverage-ring-val {
    font-size: 0.65rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    margin-top: 1px;
}
.coverage-ring--ok    { --ring-color: var(--ok); }
.coverage-ring--caution { --ring-color: var(--warn); }
.coverage-ring--alert { --ring-color: var(--error); }
.coverage-ring--tep .coverage-ring-icon { color: var(--tep); }
.coverage-ring--sv  .coverage-ring-icon { color: var(--sv); }
.coverage-ring--tv  .coverage-ring-icon { color: var(--tv); }
/* Vnitřní sekce denní karty */
.nastenka-day-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
@media (max-width: 1100px) {
    .nastenka-day-stats--3col {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .nastenka-header {
        grid-template-areas:
            "name badge"
            "addr addr";
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .streak-badge {
        justify-self: end;
        min-width: 0;
        padding: 0;
        background: transparent;
        border-top: 0;
        box-shadow: none;
        overflow: visible;
    }
    .streak-badge-label {
        display: none;
    }
    .streak-badge-number {
        margin-bottom: 0;
    }
    .streak-badge-number .meter-digit {
        width: 2rem;
        height: 2rem;
        font-size: 1.45rem;
    }
    .nastenka-dum-addr-wrap {
        gap: 0;
    }
    .nastenka-day-stats,
    .nastenka-day-stats--3col {
        grid-template-columns: 1fr;
    }
    .nastenka-day-stat--hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .nastenka-day-label {
        font-size: 0.85rem;
    }
}

/* Gateway přiřazení v editaci domu */
.gw-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}
.gw-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
.gw-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Gateway monitoring */
.nastenka-gw-list {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0rem 1.5rem;
    align-items: center;
    width: 100%;
}
.nastenka-gw-list--3col { grid-template-columns: 1.5fr 1.5fr 1fr; }
.nastenka-gw-list--3col > .nastenka-gw-row > :nth-child(3) { text-align: right; }
.nastenka-gw-list--4col { grid-template-columns: 1.2fr 1.1fr 0.5fr 1.2fr; }
.nastenka-gw-list--5col { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
.nastenka-gw-list--5col > .nastenka-gw-row > :nth-child(5) { text-align: right; }
.nastenka-gw-list--scroll {
    max-height: 7.5em;
    overflow-y: auto;
}
.nastenka-gw-row {
    display: contents;
    font-size: 0.82rem;
}
.nastenka-gw-row--muted { opacity: 0.6; }
.nastenka-gw-name {
    color: var(--text-secondary);
    font-weight: 500;
}
.nastenka-gw-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
/* Signal bars */
.nastenka-signal-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}
.nastenka-signal-bar {
    width: 5px;
    border-radius: 1px;
    background: var(--border);
}
.nastenka-signal-bar--1 { height: 5px; }
.nastenka-signal-bar--2 { height: 8px; }
.nastenka-signal-bar--3 { height: 11px; }
.nastenka-signal-bar--4 { height: 15px; }
.nastenka-signal-bars--ok .nastenka-signal-bar--active       { background: var(--ok); }
.nastenka-signal-bars--caution .nastenka-signal-bar--active  { background: var(--warning, #d97706); }
.nastenka-signal-bars--alert .nastenka-signal-bar--active    { background: var(--error); }
.nastenka-signal-bars--muted .nastenka-signal-bar--active    { background: var(--text-muted); }
.nastenka-gw-operator {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-align: right;
}
.nastenka-gw-val--ok      { color: var(--ok); }
.nastenka-gw-val--caution  { color: var(--warning, #d97706); }
.nastenka-gw-val--alert    { color: var(--error); }
.nastenka-gw-val--muted    { color: var(--text-muted); }
/* Battery icon */
.nastenka-battery {
    display: inline-flex;
    align-items: center;
    cursor: default;
}
.nastenka-battery-body {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border: 1.5px solid var(--border);
    border-radius: 3px;
    padding: 1.5px;
    height: 14px;
    box-sizing: border-box;
}
.nastenka-battery-seg {
    width: 4px;
    height: 100%;
    border-radius: 1px;
    background: var(--border);
}
.nastenka-battery-tip {
    width: 3px;
    height: 7px;
    background: var(--border);
    border-radius: 0 2px 2px 0;
    margin-left: -0.5px;
}
.nastenka-battery--ok .nastenka-battery-body    { border-color: var(--ok); }
.nastenka-battery--ok .nastenka-battery-tip     { background: var(--ok); }
.nastenka-battery--ok .nastenka-battery-seg--active { background: var(--ok); }
.nastenka-battery--caution .nastenka-battery-body    { border-color: var(--warning, #d97706); }
.nastenka-battery--caution .nastenka-battery-tip     { background: var(--warning, #d97706); }
.nastenka-battery--caution .nastenka-battery-seg--active { background: var(--warning, #d97706); }
.nastenka-battery--alert .nastenka-battery-body    { border-color: var(--error); }
.nastenka-battery--alert .nastenka-battery-tip     { background: var(--error); }
.nastenka-battery--alert .nastenka-battery-seg--active { background: var(--error); }
.nastenka-battery--muted .nastenka-battery-body    { border-color: var(--text-muted); }
.nastenka-battery--muted .nastenka-battery-tip     { background: var(--text-muted); }
.nastenka-gw-missing {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-top: 0.35rem;
}
.nastenka-gw-missing-item {
    font-size: 0.75rem;
    color: var(--error);
    font-weight: 500;
}

/* Sekce */
.nastenka-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.nastenka-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.nastenka-section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}
.nastenka-subsection-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nastenka-subsection-title + .nastenka-section-desc {
    margin-top: -0.25rem;
}

/* Typy měřidel */
.nastenka-typ-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.nastenka-typ-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    min-width: 160px;
}
.nastenka-typ-item--sv { border-left: 3px solid var(--sv); }
.nastenka-typ-item--tv { border-left: 3px solid var(--tv); }
.nastenka-typ-item--tep { border-left: 3px solid var(--tep); }
.nastenka-typ-icon {
    flex-shrink: 0;
}
.nastenka-typ-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    flex: 1;
}
.nastenka-typ-count {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}

/* OK zpráva (měřidla v pořádku) */
.nastenka-ok-msg {
    background: var(--ok-bg);
    color: var(--ok);
    border: 1px solid var(--ok);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Alert count (měřidla bez odečtu) */
.nastenka-alert-count {
    background: var(--warn-bg);
    color: var(--warn);
    border: 1px solid var(--warn);
    border-radius: var(--radius-sm);
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Badge – BEM pill varianty (nástěnka) */
.badge--caution,
.badge--alert,
.badge--ok,
.badge--muted {
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
}
.badge--caution {
    background: var(--warn-bg);
    color: var(--warn);
}
.badge--alert {
    background: var(--error-bg);
    color: var(--error);
}
.badge--ok {
    background: var(--ok-bg);
    color: var(--ok);
}
.badge--muted {
    background: var(--bg-section);
    color: var(--text-muted);
}

/* Vadná měřidla – collapsed section */
.nastenka-vadne-summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.92rem;
}
.nastenka-vadne-summary:hover {
    color: var(--text);
}
/* Spotřeby – zkumavky */
.nastenka-tubes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
.nastenka-tubes-section {
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.6rem 0.6rem;
}
.nastenka-tubes-section--tep { border-left: 3px solid var(--tep); }
.nastenka-tubes-section--sv  { border-left: 3px solid var(--sv); }
.nastenka-tubes-section--tv  { border-left: 3px solid var(--tv); }
.nastenka-tubes-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.nastenka-tubes-type-name {
    font-weight: 700;
}
.nastenka-tubes-unit {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.72rem;
}
.nastenka-tubes-summary {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}
.nastenka-tubes-diff--up {
    color: var(--error);
    font-weight: 600;
}
.nastenka-tubes-diff--down {
    color: var(--ok);
    font-weight: 600;
}
/* Legenda pod zkumavkami */
.nastenka-tubes-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.nastenka-tubes-legend-marker {
    display: inline-block;
    width: 22px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 3px rgba(200, 85, 61, 0.3);
    border-radius: 1px;
    flex-shrink: 0;
}
.nastenka-tubes-row {
    display: flex;
    align-items: flex-end;
    gap: 3px;
}
.nastenka-tube-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* Kapky – aktuální měsíc */
.nastenka-tube-drops {
    height: 18px;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.nastenka-tube-drops i {
    position: absolute;
    width: 3px;
    height: 5px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0;
    animation: dropFall 2s ease-in infinite;
}
.nastenka-tube-drops i:nth-child(1) { left: 25%; animation-delay: 0s; }
.nastenka-tube-drops i:nth-child(2) { left: 50%; animation-delay: 0.7s; }
.nastenka-tube-drops i:nth-child(3) { left: 68%; animation-delay: 1.4s; }
.nastenka-tube-drops--sv i  { background: var(--sv); }
.nastenka-tube-drops--tv i  { background: var(--tv); }
.nastenka-tube-drops--tep i { background: var(--tep); }
@keyframes dropFall {
    0%   { top: 0; opacity: 0; transform: scale(0.6); }
    15%  { opacity: 0.9; transform: scale(1); }
    85%  { opacity: 0.6; }
    100% { top: 100%; opacity: 0; transform: scale(0.4); }
}

/* Zkumavka – sklo */
.nastenka-tube-outer {
    position: relative;
    width: 100%;
    border-radius: 3px 3px 14px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}
.nastenka-tube-col:hover .nastenka-tube-outer {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), inset 0 2px 4px rgba(0,0,0,0.05);
}
.nastenka-tube-col.future .nastenka-tube-outer {
    background: var(--bg-section);
    border-style: dashed;
    border-color: var(--border-light);
    box-shadow: none;
}
.nastenka-tube-col.current .nastenka-tube-outer {
    border-color: rgba(0,0,0,0.15);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08), inset 0 2px 4px rgba(0,0,0,0.05);
}
/* Odlesk skla */
.nastenka-tube-outer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 25%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.12) 50%, transparent);
    z-index: 5;
    pointer-events: none;
}
.nastenka-tube-outer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 18%;
    height: 100%;
    background: linear-gradient(270deg, rgba(0,0,0,0.06), transparent);
    z-index: 5;
    pointer-events: none;
}

/* Výplň – kapalina */
.nastenka-tube-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 13px 13px;
    z-index: 2;
    animation: tubeReveal 1s ease-out;
    transform-origin: bottom;
}
.nastenka-tube-col.current .nastenka-tube-fill {
    animation: tubeReveal 1s ease-out, tubeWave 2.5s ease-in-out 1s infinite alternate;
    transform-origin: bottom;
}
@keyframes tubeReveal {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}
@keyframes tubeWave {
    from { transform: scaleY(1); }
    to   { transform: scaleY(1.012); }
}
/* Hladina */
.nastenka-tube-fill::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.4) 25%, rgba(255,255,255,0.65) 50%, rgba(255,255,255,0.4) 75%, transparent 95%);
    border-radius: 50%;
    z-index: 3;
}
/* Odlesk na kapalině */
.nastenka-tube-fill::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 40%;
    background: radial-gradient(ellipse at center bottom, rgba(255,255,255,0.1), transparent 70%);
    z-index: 1;
}
.nastenka-tube-fill--sv {
    background: linear-gradient(180deg, #7bbde6 0%, #2471a3 45%, #1a5276 100%);
}
.nastenka-tube-fill--tv {
    background: linear-gradient(180deg, #e88a82 0%, #c0392b 45%, #922b21 100%);
}
.nastenka-tube-fill--tep {
    background: linear-gradient(180deg, #f0c040 0%, #b8860b 45%, #8b6914 100%);
}

/* Ryska předchozího roku */
.nastenka-tube-marker {
    position: absolute;
    left: -1px;
    right: -1px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 4px rgba(200, 85, 61, 0.3);
    z-index: 6;
}
.nastenka-tube-marker::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -2.5px;
    width: 0;
    height: 0;
    border-top: 3.5px solid transparent;
    border-bottom: 3.5px solid transparent;
    border-left: 4px solid var(--accent);
}

/* Popisek měsíce */
.nastenka-tube-month {
    margin-top: 4px;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.nastenka-tube-col.current .nastenka-tube-month {
    color: var(--accent);
    font-weight: 700;
}

/* Tabulky uvnitř nastenka-section – zrušit vnější rámeček */
.nastenka-section .admin-table-wrap {
    border: 1px solid var(--border-light);
    box-shadow: none;
    margin-bottom: 0;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

/* Top nárůsty spotřeby – sloupcový layout */
.nastenka-top-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}
.nastenka-top-col {
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}
.nastenka-top-heading {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.nastenka-top-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}
.nastenka-top-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0;
    font-size: 0.82rem;
}
.nastenka-top-item + .nastenka-top-item {
    border-top: 1px solid var(--border-light);
}
.nastenka-top-rank {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 1.2rem;
}
.nastenka-top-byt {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.nastenka-top-byt:hover {
    text-decoration: underline;
}
.nastenka-top-val {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text);
}

/* Logy na nástěnce – scrollovatelný kontejner */
.nastenka-logy-scroll {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}
.nastenka-logy-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .nastenka-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nastenka-tubes-grid {
        grid-template-columns: 1fr;
    }
    .nastenka-tubes-row { gap: 4px; }
    .nastenka-tube-month { font-size: 0.65rem; }
}
@media (max-width: 550px) {
    .nastenka-typ-grid {
        flex-direction: column;
    }
    .nastenka-tube-month { font-size: 0.58rem; }
}

/* ===================== GDPR PAGE ===================== */

.gdpr-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
}
.gdpr-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}
.gdpr-back:hover { color: var(--accent); }
.gdpr-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2.5rem 2rem;
}
.gdpr-card h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
    color: var(--text);
}
.gdpr-card .gdpr-subtitle {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}
.gdpr-card h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-light);
}
.gdpr-card h2:first-of-type {
    margin-top: 0;
}
.gdpr-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.gdpr-card ul {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0.5rem 0 0.75rem 1.25rem;
}
.gdpr-card li {
    margin-bottom: 0.25rem;
}
.gdpr-card strong {
    color: var(--text);
    font-weight: 600;
}
.gdpr-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
}
.gdpr-table th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.5rem 0.65rem;
    border-bottom: 2px solid var(--border);
    background: var(--bg-section);
}
.gdpr-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    vertical-align: top;
}
.gdpr-table tr:last-child td { border-bottom: none; }
.gdpr-note {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    line-height: 1.6;
}
.gdpr-updated {
    font-size: 0.7rem;
    color: var(--text-light);
    text-align: right;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 640px) {
    .gdpr-wrapper { padding: 1rem 0.75rem 1rem; }
    .gdpr-card { padding: 1.5rem 1.25rem 1.25rem; }
    .gdpr-table { font-size: 0.75rem; }
    .gdpr-table th, .gdpr-table td { padding: 0.4rem 0.5rem; }
}
