/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* Family paleta 123Soft: navy #16233F + teal #0E98A8 */
    --color-primary: #0E98A8;       /* teal – akce, odkazy, aktivní prvky */
    --color-primary-dark: #0C7F8C;  /* tmavší teal – hover */
    --color-navy: #16233F;          /* navy – nadpisy, navbar accent */
    --color-success: #0E98A8;  /* teal – žádná zelená jako success (pravidlo 123soft) */
    --color-warning: #ca8a04;
    --color-danger: #dc2626;
    --color-info: #0E98A8;

    --color-bg: #f6f8fa;
    --color-surface: #ffffff;
    --color-text: #16233F;
    --color-text-muted: #5C6B80;
    --color-border: #e2e8f0;

    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === NAVBAR === */
.navbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    border-top: 3px solid var(--color-navy);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform .28s ease;
}
.navbar.nav-hidden {
    transform: translateY(-100%);
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 60px;
}

.nav-brand a {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text);
    text-decoration: none;
    line-height: 0;
    display: block;
}

.nav-brand img {
    height: 32px;
    width: auto;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    margin-left: 2rem;
    flex: 1;
}

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.nav-admin {
    color: var(--color-primary);
    font-weight: 500;
}

.nav-separator {
    color: var(--color-border);
    padding: 0 0.25rem;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* === CONTAINER === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

.container-narrow {
    max-width: 500px;
}

/* === CARDS === */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* === ALERTS === */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #e6f6f8;
    color: #0A6570;
    border: 1px solid #b8e6ea;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input {
    width: 1rem;
    height: 1rem;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--color-primary-dark);
    color: white;
}

.btn-primary:hover {
    background: #0A6570;
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ikona uvnitř tlačítka má pevnou velikost (jinak se SVG bez rozměrů roztáhne) */
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* === TABLES === */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg);
}

.table tbody tr:hover {
    background: var(--color-bg);
}

/* === BADGES / STATUS === */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* status badge – family paleta (navy/teal), žádná zelená jako success */
.badge-new { background: rgba(14,152,168,.13); color: #0A6570; }
.badge-in_progress { background: rgba(224,165,0,.16); color: #946400; }
.badge-waiting { background: #eef1f5; color: #5a6b86; }
.badge-resolved { background: rgba(22,35,63,.08); color: #16233F; }
.badge-closed { background: #f1f3f6; color: #9aa5b5; }
/* obecné badge utility (role, ověření, stav účtu) – family paleta */
.badge-teal { background: rgba(14,152,168,.13); color: #0A6570; }
.badge-amber { background: rgba(224,165,0,.16); color: #946400; }
.badge-muted { background: #f1f3f6; color: #7a8698; }

/* === STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* === TICKET LIST === */
.ticket-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ticket-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s;
}

.ticket-item:hover {
    background: var(--color-bg);
}

.ticket-item:last-child {
    border-bottom: none;
}

.ticket-number {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-width: 80px;
}

.ticket-content {
    flex: 1;
    min-width: 0;
}

.ticket-subject {
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
}

.ticket-subject:hover {
    color: var(--color-primary);
}

.ticket-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* === COMMENTS === */
.comments {
    margin-top: 2rem;
}

.comment {
    padding: 1rem;
    border-left: 3px solid var(--color-border);
    margin-bottom: 1rem;
    background: var(--color-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.comment-internal {
    border-left-color: var(--color-warning);
    background: #fffbeb;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    font-weight: 500;
}

.comment-date {
    color: var(--color-text-muted);
}

.comment-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    word-break: break-word;
}

/* === FILTERS === */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(14,152,168,.08);
}

/* === FOOTER === */

.footer {
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer p {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.footer a {
    color: var(--color-primary);
    text-decoration: none;
}

/* === LOGIN PAGE === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h1 {
    font-size: 1.5rem;
    margin: 0;
}

.login-logo p {
    color: var(--color-text-muted);
    margin: 0.5rem 0 0;
}

/* === PLACEHOLDER === */
.placeholder-page {
    text-align: center;
    padding: 4rem 2rem;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
/* SVG ikona v prázdném stavu MUSÍ mít rozměr – bez něj se roztáhne na celou šířku */
.placeholder-icon svg {
    width: 54px;
    height: 54px;
    display: block;
    margin: 0 auto;
    color: var(--color-text-muted);
    stroke-width: 1.5;
}

.placeholder-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.placeholder-desc {
    color: var(--color-text-muted);
    max-width: 400px;
    margin: 0 auto;
}

/* === DETAIL === */
.detail-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.detail-label {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--color-text);
    word-break: break-word;
}

/* Strukturovaná pole požadavku – místo jedné textové "nudle" boxíky */
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
    margin: 0.5rem 0 0;
}
.field-grid .fld.long { grid-column: 1 / -1; }
.fld {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
}
.fld-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}
.fld-value {
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
}
@media (max-width: 560px) {
    .field-grid { grid-template-columns: 1fr; }
}

/* === RESPONSIVE === */
/* Navbar → hamburger už na tabletu/menším laptopu (~1160px), jinak plná lišta (mnoho položek) přetéká */
@media (max-width: 1160px) {
    .navbar-inner {
        flex-wrap: wrap;
        padding: 1rem;
        height: auto;
        align-items: center;
    }
    .nav-brand img {
        height: 24px;
    }
    .navbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
        padding: 1rem;
    }

    .nav-brand {
        flex: 0 0 auto;
        order: 1;
    }

    .nav-toggle {
        display: flex;
        margin-left: auto;
        order: 2;
    }

    .nav-menu {
        display: none;
        flex-basis: 100%;
        order: 3;
        flex-direction: column;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        margin-top: 1rem;
        padding-top: 0.5rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        margin: 0;
        gap: 0;
        width: 100%;
    }

    .nav-links .nav-link {
        display: block;
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
        text-align: center;
        font-size: 1.1rem;
    }

    .nav-links .nav-link:hover {
        background: var(--color-bg);
    }

    .nav-user {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        background: var(--color-bg);
        margin-top: 0.5rem;
        border-radius: var(--radius);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }
    
    .card-wide {
    max-width: none;
    }

    .card-narrow {
    max-width: 600px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    .ticket-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
    }

    [style*="grid-template-columns: 2fr 1fr"] {
        display: block !important;
    }

    [style*="grid-template-columns: 2fr 1fr"] > div {
        margin-bottom: 1rem;
    }
    .card a {
        word-break: break-all;
    }

    .card ul a {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* =====================================================================
   ADMIN „VELÍN" — skořápka (sidebar) + dashboard + web-grade chrome
   Přesazeno z odsouhlaseného mocku. Paleta = family (navy/teal).
   ===================================================================== */
:root{
  --color-navy-2:#111C33;
  --color-teal-soft:#67D6E2;
  --color-sand:#eef3f7;
  --color-tint:#F4F8FA;
  --radius-lg:16px;
  --radius-pill:999px;
  --shadow-card:0 10px 30px -14px rgba(16,35,63,.18);
  --shadow-teal:0 12px 26px -12px rgba(14,152,168,.45);
  --navy-line:rgba(255,255,255,.09);
  --sidebar-w:250px;
}

/* utilita: eyebrow + hover-lift (přeneseno z webu) */
.eyebrow{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.14em;color:#0A6E79}
.hoverlift{transition:transform .18s,box-shadow .18s}
.hoverlift:hover{transform:translateY(-3px);box-shadow:0 16px 34px -16px rgba(16,35,63,.28)}

/* admin režim vypíná flex-column z body (kvůli fixnímu sidebaru) */
body.admin-body{display:block}
.admin-body svg{display:block}

/* ---------- SIDEBAR ---------- */
.admin-sidebar{
  width:var(--sidebar-w);position:fixed;top:0;left:0;bottom:0;z-index:60;
  background:var(--color-navy) linear-gradient(185deg,var(--color-navy) 0%,var(--color-navy-2) 100%);
  color:#C7D2E8;display:flex;flex-direction:column;transition:transform .28s ease}
.asb-brand{display:flex;align-items:center;gap:.7rem;padding:1.25rem 1.25rem 1.1rem}
.asb-logo{width:38px;height:38px;border-radius:11px;flex:none;display:flex;align-items:center;justify-content:center;
  background:var(--color-primary-dark) linear-gradient(135deg,var(--color-primary-dark),var(--color-navy));color:#fff;font-weight:800;font-size:1.05rem;
  box-shadow:0 6px 14px -4px rgba(14,152,168,.6)}
.asb-brand .nm{font-size:.95rem;font-weight:700;color:#fff;line-height:1.2}
.asb-brand .sub{font-size:.72rem;color:#9FB0C9}
.asb-sep{height:1px;background:var(--navy-line);margin:.2rem 1.1rem .7rem}
.asb-nav{display:flex;flex-direction:column;gap:2px;padding:0 .7rem;flex:1;overflow-y:auto}
.asb-cap{font-size:.66rem;font-weight:700;letter-spacing:.13em;text-transform:uppercase;color:#9FB0C9;padding:.5rem .6rem .25rem}
.asb-link{display:flex;align-items:center;gap:.75rem;padding:.62rem .7rem;border-radius:10px;color:#C7D2E8;
  font-size:.93rem;font-weight:500;position:relative;transition:background .15s,color .15s}
.asb-link svg{width:19px;height:19px;flex:none;color:#8FA0BE;transition:color .15s}
.asb-link:hover{background:rgba(255,255,255,.05);color:#fff}
.asb-link:hover svg{color:#C7D2E8}
.asb-link.active{background:linear-gradient(100deg,rgba(14,152,168,.22),rgba(14,152,168,.08));color:#fff;font-weight:600}
.asb-link.active svg{color:var(--color-teal-soft)}
.asb-link.active::before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--color-teal-soft)}
.asb-badge{margin-left:auto;background:var(--color-primary-dark);color:#fff;font-size:.7rem;font-weight:700;
  min-width:20px;height:20px;padding:0 6px;border-radius:var(--radius-pill);display:inline-flex;align-items:center;justify-content:center}
.asb-badge.warn{background:#E0A500;color:#3a2d00}
.asb-foot{padding:.9rem 1.1rem 1.15rem}
.asb-web{display:flex;align-items:center;gap:.55rem;font-size:.84rem;color:#8FA0BE;padding:.55rem .6rem;border-radius:9px;border:1px solid var(--navy-line)}
.asb-web:hover{color:#fff;background:rgba(255,255,255,.04)}
.asb-web svg{width:16px;height:16px}
.asb-backdrop{display:none}

/* ---------- MAIN + TOPBAR ---------- */
.admin-main{margin-left:var(--sidebar-w);min-height:100vh;display:flex;flex-direction:column;min-width:0}
.admin-topbar{height:60px;display:flex;align-items:center;gap:1rem;padding:0 2rem;position:sticky;top:0;z-index:30;
  background:rgba(255,255,255,.85);backdrop-filter:blur(8px);border-bottom:1px solid var(--color-border)}
.atb-toggle{display:none;background:none;border:0;cursor:pointer;color:var(--color-navy);padding:.3rem;margin-left:-.3rem}
.atb-toggle svg{width:24px;height:24px}
.atb-crumb{font-size:.9rem;color:var(--color-text-muted)}
.atb-crumb b{color:var(--color-text);font-weight:600}
.atb-crumb a{color:var(--color-text-muted);text-decoration:none}
.atb-crumb a:hover{color:var(--color-primary)}
.atb-right{margin-left:auto;display:flex;align-items:center;gap:1.1rem}
.atb-user{display:inline-flex;align-items:center;gap:.5rem;font-size:.9rem;font-weight:600;color:var(--color-text)}
.atb-user .av{width:30px;height:30px;border-radius:50%;background:var(--color-sand);color:#0A6E79;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.8rem;flex:none}
.atb-ic{color:var(--color-text-muted);display:inline-flex}
.atb-ic:hover{color:var(--color-primary)}
.atb-ic svg{width:19px;height:19px}
.admin-content{padding:2rem;max-width:1240px;width:100%}

/* ---------- DASHBOARD: uvítání ---------- */
.adm-welcome{margin-bottom:1.5rem}
.adm-welcome h1{font-size:1.6rem;font-weight:700;letter-spacing:-.01em;margin:.15rem 0 0;color:var(--color-navy)}
.adm-welcome .sub{color:var(--color-text-muted);font-size:.92rem;margin-top:.15rem}

/* ---------- DASHBOARD: stat dlaždice ---------- */
.stat-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:1.1rem;margin-bottom:1.6rem}
.stat-tile{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);
  padding:1.15rem 1.25rem;box-shadow:var(--shadow-card);display:block;position:relative;overflow:hidden;
  color:inherit;text-decoration:none;transition:transform .18s,box-shadow .18s}
.stat-tile:hover{transform:translateY(-3px);box-shadow:0 16px 34px -16px rgba(16,35,63,.28)}
.stat-tile .st-ico{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;margin-bottom:.7rem}
.stat-tile .st-ico svg{width:22px;height:22px}
.stat-tile .st-num{font-size:2rem;font-weight:800;line-height:1;letter-spacing:-.02em;color:var(--color-navy)}
.stat-tile .st-lab{font-size:.86rem;color:var(--color-text-muted);margin-top:.28rem;font-weight:500}
.stat-tile .st-go{position:absolute;top:1.15rem;right:1.15rem;color:var(--color-border);transition:color .18s}
.stat-tile:hover .st-go{color:var(--color-primary)}
.stat-tile .st-go svg{width:18px;height:18px}
.st-teal .st-ico{background:rgba(14,152,168,.12);color:var(--color-primary)}
.st-amber .st-ico{background:rgba(224,165,0,.14);color:#B27E00}
.st-navy .st-ico{background:rgba(22,35,63,.09);color:var(--color-navy)}
.st-rose .st-ico{background:rgba(220,38,38,.10);color:var(--color-danger)}
.stat-tile.attn{border-color:rgba(14,152,168,.4)}

/* ---------- DASHBOARD: dvousloupec + panely ---------- */
.adm-cols{display:grid;grid-template-columns:1.62fr 1fr;gap:1.4rem;align-items:start}
.adm-panel{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);overflow:hidden}
.adm-panel-h{display:flex;align-items:center;gap:.6rem;padding:1.05rem 1.35rem;border-bottom:1px solid var(--color-border)}
.adm-panel-h h2{font-size:1.02rem;font-weight:700;color:var(--color-navy)}
.adm-panel-h .cnt{color:var(--color-text-muted);font-size:.85rem;font-weight:600}
.adm-panel-h .all{margin-left:auto;font-size:.82rem;font-weight:600;color:#0A6E79;display:inline-flex;align-items:center;gap:.25rem}
.adm-panel-h .all svg{width:15px;height:15px}
.adm-panel .empty{padding:1.8rem 1.35rem;text-align:center;color:var(--color-text-muted);font-size:.88rem}
.adm-panel-note{padding:.8rem 1.35rem;font-size:.8rem;color:var(--color-text-muted);background:var(--color-tint);border-top:1px solid var(--color-border)}

/* požadavky (Vyžaduje pozornost) */
.reqrow{display:flex;gap:.9rem;padding:.9rem 1.35rem;border-bottom:1px solid var(--color-border);align-items:flex-start;transition:background .13s;color:inherit;text-decoration:none}
.reqrow:last-child{border-bottom:0}
.reqrow:hover{background:var(--color-tint)}
.reqrow.is-new{background:linear-gradient(90deg,rgba(14,152,168,.055),transparent 60%)}
.rq-ico{width:38px;height:38px;border-radius:11px;background:var(--color-sand);color:var(--color-primary);display:flex;align-items:center;justify-content:center;flex:none;margin-top:2px}
.rq-ico svg{width:19px;height:19px}
.rq-bd{min-width:0;flex:1}
.rq-subj{font-weight:600;font-size:.93rem;line-height:1.3;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rq-meta{color:var(--color-text-muted);font-size:.82rem;margin-top:.2rem;display:flex;flex-wrap:wrap;align-items:center;gap:.4rem}
.rq-meta .who{color:var(--color-text);font-weight:500}
.rq-meta .mdot{width:3px;height:3px;border-radius:50%;background:var(--color-border)}
.rq-side{display:flex;flex-direction:column;align-items:flex-end;gap:.35rem;flex:none}
.adm-age{display:inline-flex;align-items:center;gap:.28rem;font-size:.78rem;color:var(--color-text-muted);white-space:nowrap}
.adm-age svg{width:13px;height:13px}

/* priorita – barevná tečka */
.pri{display:inline-flex;align-items:center;gap:.3rem;font-size:.76rem;font-weight:600}
.pri .pd{width:8px;height:8px;border-radius:50%}
.pri.urgent{color:var(--color-danger)} .pri.urgent .pd{background:var(--color-danger)}
.pri.high{color:#B27E00} .pri.high .pd{background:#E0A500}
.pri.normal{color:var(--color-text-muted)} .pri.normal .pd{background:#9fb0c4}
.pri.low{color:#93a1b3} .pri.low .pd{background:#c7d2df}

/* fronta k ověření */
.vq-item{padding:.85rem 1.35rem;border-bottom:1px solid var(--color-border)}
.vq-item:last-of-type{border-bottom:0}
.vq-top{display:flex;align-items:center;gap:.65rem}
.vq-av{width:34px;height:34px;border-radius:50%;background:var(--color-navy);color:#fff;font-weight:700;font-size:.82rem;display:flex;align-items:center;justify-content:center;flex:none}
.vq-nm{font-weight:600;font-size:.9rem;color:var(--color-text)}
.vq-meta{font-size:.79rem;color:var(--color-text-muted)}
.vq-row{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-top:.6rem}

/* zpět-odkaz nahoře v detailu */
.back-link{display:inline-flex;align-items:center;gap:.25rem;color:var(--color-text-muted);font-size:.88rem;
  text-decoration:none;margin-bottom:1rem}
.back-link:hover{color:var(--color-primary)}
.back-link svg{width:16px;height:16px}

/* přílohy v detailu */
.att-list{list-style:none;padding:0;margin:.4rem 0 0;display:flex;flex-direction:column;gap:.4rem}
.att-list a{display:inline-flex;align-items:center;gap:.5rem;color:var(--color-primary);font-size:.9rem;
  background:var(--color-tint);border:1px solid var(--color-border);border-radius:8px;padding:.45rem .7rem;text-decoration:none}
.att-list a:hover{border-color:var(--color-primary)}
.att-list svg{width:16px;height:16px;flex:none}

/* historie (audit) v detailu */
.hist-list{list-style:none;padding:0;margin:.3rem 0 0;display:flex;flex-direction:column;gap:.8rem}
.hist-list li{display:flex;gap:.6rem;align-items:flex-start}
.hist-ico{width:28px;height:28px;border-radius:8px;background:var(--color-sand);color:var(--color-primary);
  display:flex;align-items:center;justify-content:center;flex:none}
.hist-ico svg{width:15px;height:15px}
.hist-sum{font-size:.88rem;color:var(--color-text);line-height:1.35}
.hist-meta{font-size:.78rem;color:var(--color-text-muted);margin-top:.1rem}

/* ---------- DASHBOARD v2: statistiky týdne, aging, dnešní hodiny, mini-aktivita, citát ---------- */
.wk-kudos{color:#0A6E79;font-weight:600;white-space:nowrap}

.week-strip{display:flex;align-items:center;gap:1.5rem;flex-wrap:wrap;background:var(--color-surface);
  border:1px solid var(--color-border);border-radius:var(--radius-lg);box-shadow:var(--shadow-card);
  padding:1rem 1.35rem;margin-bottom:1.6rem}
.ws-item{display:flex;align-items:center;gap:.75rem}
.ws-ico{width:38px;height:38px;border-radius:11px;background:var(--color-sand);color:var(--color-primary);
  display:flex;align-items:center;justify-content:center;flex:none}
.ws-ico svg{width:19px;height:19px}
.ws-num{font-size:1.35rem;font-weight:800;color:var(--color-navy);line-height:1}
.ws-lab{font-size:.82rem;color:var(--color-text-muted);margin-top:.15rem}
.ws-sep{width:1px;align-self:stretch;background:var(--color-border)}

.adm-rightcol{display:flex;flex-direction:column;gap:1.4rem;min-width:0}
.aging-card{border-color:rgba(224,165,0,.45)}
.aging-dot{width:9px;height:9px;border-radius:50%;background:#E0A500;flex:none}

.th-body{padding:1rem 1.35rem}
.th-range{font-weight:700;color:var(--color-navy);font-size:1rem;margin-bottom:.55rem}
.th-rows{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.4rem}
.th-rows li{display:flex;gap:.7rem;font-size:.88rem;align-items:baseline}
.th-time{color:#0A6E79;font-weight:600;min-width:96px;flex:none}
.th-act{color:var(--color-text)}
.th-note{margin-top:.65rem;font-size:.82rem;color:var(--color-text-muted)}
.th-closed{color:var(--color-text-muted);font-size:.9rem}

.mini-act{display:flex;gap:.65rem;padding:.7rem 1.35rem;border-bottom:1px solid var(--color-border);align-items:flex-start}
.mini-act:last-child{border-bottom:0}
.ma-ico{width:28px;height:28px;border-radius:8px;background:var(--color-sand);color:var(--color-primary);
  display:flex;align-items:center;justify-content:center;flex:none}
.ma-ico svg{width:15px;height:15px}
.ma-sum{font-size:.86rem;color:var(--color-text);line-height:1.3}
.ma-meta{font-size:.77rem;color:var(--color-text-muted);margin-top:.1rem}

/* hláška jako bublina v sidebaru (tmavé pozadí, asymetrický roh = chat bublina) */
.asb-quote{margin:0 0 .9rem;padding:.95rem 1rem 1rem;position:relative;
  background:rgba(103,214,226,.10);border:1px solid rgba(255,255,255,.09);
  border-radius:16px 16px 16px 5px}
.asb-quote::before{content:"„";position:absolute;top:.35rem;left:.6rem;font-family:Georgia,serif;
  font-size:2.4rem;line-height:1;color:var(--color-teal-soft);opacity:.5}
.asb-quote p{margin:0;padding-left:1.5rem;padding-top:.35rem;font-size:1.02rem;font-style:italic;
  line-height:1.4;color:#DCE7F2}

/* ---------- FILTR LIŠTA (server+AJAX seznamy) ---------- */
.filterbar{display:flex;flex-direction:column;gap:.7rem;margin-bottom:1.1rem}
.chip-row{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center}
.fchip{display:inline-flex;align-items:center;gap:.4rem;padding:.42rem .8rem;border-radius:var(--radius-pill);
  border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);
  font-size:.86rem;font-weight:600;cursor:pointer;user-select:none;transition:all .13s;white-space:nowrap}
.fchip:hover{border-color:var(--color-primary);color:var(--color-primary)}
.fchip svg{width:16px;height:16px;flex:none}
.type-chip svg{color:var(--color-primary)}
.fchip.active{background:var(--color-primary);border-color:var(--color-primary);color:#fff}
.fchip.active svg{color:#fff}
.fb-search{display:flex;gap:.5rem;align-items:center;margin-left:auto}
.fb-search .form-input{width:220px;padding:.45rem .7rem;margin:0}
.fb-clear{font-size:.83rem;color:var(--color-text-muted);white-space:nowrap;text-decoration:none}
.fb-clear:hover{color:var(--color-primary)}
.list-head{margin:0 0 .6rem;font-size:.86rem;color:var(--color-text-muted);font-weight:600}
.load-more-wrap{display:flex;justify-content:center;margin-top:1.1rem}
#ticket-list.is-loading,#user-list.is-loading{opacity:.5;pointer-events:none;transition:opacity .1s}

/* ---------- PODZÁLOŽKY NASTAVENÍ (Ordinace | Personál) ---------- */
.settings-tabs{display:flex;gap:.25rem;border-bottom:1px solid var(--color-border);margin:0 0 1.5rem;flex-wrap:wrap}
.settings-tabs .stab{display:inline-flex;align-items:center;gap:.45rem;padding:.62rem .95rem;
  font-size:.92rem;font-weight:600;color:var(--color-text-muted);text-decoration:none;
  border-bottom:2px solid transparent;margin-bottom:-1px;transition:color .13s,border-color .13s}
.settings-tabs .stab svg{width:17px;height:17px;flex:none}
.settings-tabs .stab:hover{color:var(--color-primary-dark)}
.settings-tabs .stab.active{color:#0A6E79;border-bottom-color:var(--color-primary)}
.hidden{display:none !important}
/* atribut hidden musí přebít i .btn{display:inline-flex} (jinak „Načíst další" svítí i skryté) */
[hidden]{display:none !important}
/* neaktivní účet – ztlumený řádek */
.table tbody tr.row-inactive td{opacity:.55}
.table tbody tr.row-inactive td:last-child{opacity:1}

/* ---------- RESPONSIVE: sidebar → drawer ---------- */
@media (max-width:900px){
  .td-grid{grid-template-columns:1fr !important}
  .fb-search{margin-left:0;width:100%}
  .fb-search .form-input{flex:1;width:auto}
  .admin-sidebar{transform:translateX(-100%);box-shadow:0 0 40px rgba(0,0,0,.3)}
  .admin-sidebar.open{transform:translateX(0)}
  .admin-main{margin-left:0}
  .atb-toggle{display:inline-flex}
  .admin-content{padding:1.25rem}
  .asb-backdrop.show{display:block;position:fixed;inset:0;background:rgba(16,35,63,.45);z-index:55}
  .adm-cols{grid-template-columns:1fr}
}


/* ============================================================
   PORTÁL PACIENTA — reskin do kvality velína (Milník 1)
   Reuse velínových globálních tříd (.eyebrow/.hoverlift/.stat-tile/
   .adm-panel/.reqrow/.badge-*/.field-grid/.back-link/.att-list);
   zde jen NOVÉ komponenty a drobné pojistky. Bez zásahu do stávajících.
   ============================================================ */

/* Pojistka: velín normalizuje svg přes .admin-body svg{display:block};
   pacient .admin-body nemá → normalizuj svg v reskin komponentách. */
.pt-page svg,.rt-tile svg,.portal-empty svg,.pt-contact svg{display:block}

/* Nadpis stránky (eyebrow + h1 + podnadpis) – jednotný napříč portálem */
.pt-head{margin:.4rem 0 1.4rem}
.pt-head h1{font-size:1.5rem;font-weight:700;color:var(--color-navy);margin:.25rem 0 0;line-height:1.2}
.pt-head .sub{color:var(--color-text-muted);font-size:.95rem;margin:.35rem 0 0;max-width:60ch}
.pt-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;margin-top:1rem}

/* Akční dlaždice typů požadavků (Nový požadavek / onboarding domov) */
.rt-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:1.1rem;margin:0 0 1.4rem}
.rt-tile{display:block;background:var(--color-surface);border:1px solid var(--color-border);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-card);padding:1.3rem 1.35rem;
  color:inherit;text-decoration:none}
.rt-tile .rt-ico{width:46px;height:46px;border-radius:13px;background:var(--color-sand);
  color:var(--color-primary);display:flex;align-items:center;justify-content:center;margin-bottom:.85rem}
.rt-tile .rt-ico svg{width:23px;height:23px}
.rt-tile h3{font-size:1.05rem;font-weight:700;color:var(--color-navy);margin:0 0 .3rem}
.rt-tile p{font-size:.9rem;color:var(--color-text-muted);margin:0;line-height:1.5}

/* Karta ve velínové kvalitě pro portál (globální .card je plochý – nesaháme na něj) */
.card-lg{background:var(--color-surface);border:1px solid var(--color-border);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-card);padding:1.5rem;margin-bottom:1.5rem}
.card-lg.narrow{max-width:640px}

/* Jednotný prázdný stav portálu (nahrazuje emoji .placeholder-page) */
.portal-empty{text-align:center;padding:2.6rem 1.5rem;color:var(--color-text-muted)}
.portal-empty .pe-ico{width:54px;height:54px;border-radius:15px;background:var(--color-sand);
  color:var(--color-primary);display:flex;align-items:center;justify-content:center;margin:0 auto 1rem}
.portal-empty .pe-ico svg{width:27px;height:27px}
.portal-empty .pe-title{font-size:1.05rem;font-weight:700;color:var(--color-navy);margin:0 0 .35rem}
.portal-empty .pe-desc{font-size:.92rem;line-height:1.55;margin:0 auto 1.2rem;max-width:44ch}

/* SVG ikony v pacientské navigaci (base.html) */
.nav-link{display:inline-flex;align-items:center;gap:.5rem;white-space:nowrap}
.nav-link svg{width:17px;height:17px;flex:none}
/* Initials-avatar v účtové části lišty */
.nav-av{width:30px;height:30px;border-radius:50%;flex:none;display:inline-flex;align-items:center;
  justify-content:center;font-size:.76rem;font-weight:700;letter-spacing:.02em;color:#fff;
  background:linear-gradient(135deg,var(--color-primary),var(--color-navy))}

/* Taby (Aktivní / Historie u Mých požadavků) – vzor settings-tabs velína */
.pt-tabs{display:flex;gap:.4rem;border-bottom:1px solid var(--color-border);margin:0 0 1.2rem}
.pt-tab{padding:.6rem .9rem;font-size:.92rem;font-weight:600;color:var(--color-text-muted);
  text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}
.pt-tab:hover{color:var(--color-primary)}
.pt-tab.active{color:var(--color-primary);border-bottom-color:var(--color-primary)}

/* Pacientský sidebar = TEAL (odlišení od admin navy). Deep-teal gradient kvůli
   kontrastu bílého textu (start #0C7F8C ~4.6:1). Aktivní/hover = bílý overlay. */
.admin-sidebar.portal-sidebar{background:#0C7F8C linear-gradient(185deg,#0C7F8C 0%,#06414a 100%)}
.portal-sidebar .asb-logo{background:#fff;color:var(--color-primary-dark)}
.portal-sidebar .asb-brand .sub{color:rgba(255,255,255,.74)}
.portal-sidebar .asb-sep{background:rgba(255,255,255,.15)}
.portal-sidebar .asb-cap{color:rgba(255,255,255,.7)}
.portal-sidebar .asb-link{color:#fff}
.portal-sidebar .asb-link svg{color:rgba(255,255,255,.75)}
.portal-sidebar .asb-link:hover{background:rgba(255,255,255,.12);color:#fff}
.portal-sidebar .asb-link:hover svg{color:#fff}
.portal-sidebar .asb-link.active{background:rgba(255,255,255,.18);color:#fff;font-weight:600}
.portal-sidebar .asb-link.active svg{color:#fff}
.portal-sidebar .asb-link.active::before{background:#fff}
.portal-sidebar .asb-web{color:rgba(255,255,255,.85);border-color:rgba(255,255,255,.22)}
.portal-sidebar .asb-web:hover{color:#fff;background:rgba(255,255,255,.10)}

/* --- Portál pacienta: profil + aktuality (Milník 2) --- */
.prof-av{width:56px;height:56px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;
  font-size:1.15rem;font-weight:700;color:#fff;background:linear-gradient(135deg,var(--color-primary),var(--color-navy))}
.pt-grid2{display:grid;grid-template-columns:1.25fr 1fr;gap:1.4rem;align-items:start}
@media(max-width:820px){.pt-grid2{grid-template-columns:1fr}}
.kv{display:grid;grid-template-columns:auto 1fr;gap:.55rem .9rem;font-size:.93rem;margin:0}
.kv dt{color:var(--color-text-muted);display:inline-flex;align-items:center;gap:.5rem;white-space:nowrap}
.kv dt svg{width:16px;height:16px;color:var(--color-primary);flex:none}
.kv dd{margin:0;color:var(--color-text);font-weight:500}
.ro-note{color:var(--color-text-muted);font-size:.82rem;margin:.3rem 0 0}
/* aktuality */
.news-item{padding:1.2rem 0;border-bottom:1px solid var(--color-border)}
.news-item:last-child{border-bottom:0}
.news-item h3{margin:0 0 .25rem;font-size:1.06rem;color:var(--color-navy)}
.news-date{color:var(--color-text-muted);font-size:.82rem}
.news-body{margin:.55rem 0 0;line-height:1.6;color:var(--color-text);white-space:pre-line}
.news-item.important{border-left:3px solid var(--color-primary);padding-left:1.1rem;background:linear-gradient(90deg,rgba(14,152,168,.05),transparent 55%)}
.news-flag{display:inline-flex;align-items:center;gap:.3rem;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em;color:var(--color-primary-dark);margin-bottom:.35rem}
.news-flag svg{width:14px;height:14px}
/* dashboard: upozornění z ordinace + kontakt mini-karta */
.pt-notice{display:flex;gap:.7rem;align-items:flex-start;background:linear-gradient(90deg,rgba(224,165,0,.10),rgba(224,165,0,.03));
  border:1px solid rgba(224,165,0,.28);border-radius:var(--radius-lg);padding:.95rem 1.15rem;margin:0 0 1.4rem}
.pt-notice .ico{color:#B27E00;flex:none}.pt-notice .ico svg{width:20px;height:20px}
.pt-notice b{color:var(--color-navy)}
