/*
 * Layout aplikace nad výchozím tématem PrimeFaces (Saga Blue).
 * Horní lišta, postranní menu, obsah a patička. Barvy odpovídají Saga Blue.
 */
:root {
    --app-topbar-height: 3.5rem;
    --app-sidebar-width: 20rem;
    --app-bg: #f8f9fa;
    --app-surface: #ffffff;
    --app-border: #dee2e6;
    --app-text-muted: #6c757d;
    --app-primary: #2196f3;
    --app-primary-soft: #e3f2fd;
}

html {
    font-size: 14px;
}

/* Saga nastavuje písmo jen komponentám, zbytek stránky ho převezme odsud */
body.app-body,
body.app-login-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: #495057;
}

body.app-body {
    margin: 0;
    background: var(--app-bg);
}

/* Horní lišta */
.app-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-topbar-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    z-index: 1000;
}

.app-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-text-muted);
    cursor: pointer;
}

.app-menu-toggle:hover {
    background: var(--app-bg);
}

.app-menu-toggle .pi {
    font-size: 1.25rem;
}

.app-logo img {
    display: block;
    height: 2.25rem;
}

.app-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}
/* Dlouhý název agentury a jméno uživatele se zkrátí (…): na tabletu by jinak vytlačily nabídku uživatele (Odhlásit)
   za pravý okraj pevné lišty (review 16. 11. 2026, nález 9-12) */
.app-topbar .app-company-name,
.app-topbar .app-company-menu .ui-button-text,
.app-topbar .app-user-menu .ui-button-text {
    display: inline-block;
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
@media (max-width: 991px) {
    .app-topbar .app-company-name,
    .app-topbar .app-company-menu .ui-button-text,
    .app-topbar .app-user-menu .ui-button-text {
        max-width: 9rem;
    }
}

/* Aktivní agentura v záhlaví (bez nabídky, když má účet jen jednu agenturu) */
.app-topbar .app-company-name {
    padding: 0 0.75rem;
    color: var(--app-text-muted);
    white-space: nowrap;
}

/* Nápověda vzhledem jako tlačítko uživatele vedle ní (ne jako podtržený odkaz) */
.app-topbar .app-help-link a,
.app-topbar .app-help-link a:hover {
    text-decoration: none;
    color: inherit;
}

/* Postranní menu */
.app-sidebar {
    position: fixed;
    top: var(--app-topbar-height);
    bottom: 0;
    left: 0;
    width: var(--app-sidebar-width);
    overflow-y: auto;
    padding: 0.75rem;
    box-sizing: border-box;
    background: var(--app-surface);
    border-right: 1px solid var(--app-border);
    z-index: 999;
    transition: transform 0.2s;
}

.app-menu.ui-menu {
    width: 100%;
    padding: 0;
    border: 0;
}

/* Nadpisy sekcí menu (Zájezdy, Fakturace a Pokladna, ...) */
.app-menu.ui-menu .ui-widget-header {
    margin-top: 0.75rem;
    background: transparent;
    border: 0;
}

.app-menu.ui-menu .ui-widget-header:first-child {
    margin-top: 0;
}

.app-menu.ui-menu .ui-widget-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--app-text-muted);
}

/* Skupiny bez podmenu (Kontroly, Asistent, Administrace – stránky jsou taby nad obsahem): vypadají jako nadpis sekce,
   ale dají se kliknout */
.app-menu.ui-menu .ui-menuitem-link.app-menu-group {
    margin-top: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.app-menu.ui-menu .ui-menuitem-link.app-menu-group .ui-menuitem-text {
    font-size: 14px;
    font-weight: 700;
}

.app-menu.ui-menu .ui-menuitem-link.app-menu-group:not(.app-menu-active) .ui-menuitem-text,
.app-menu.ui-menu .ui-menuitem-link.app-menu-group:not(.app-menu-active) .ui-menuitem-icon {
    color: #495057;
}

/* Ikona zůstane vlevo i u dlouhých položek, text se zalomí vedle ní (PL/RO „Dokumenty płatności i plany płatności“) */
.app-menu.ui-menu .ui-menuitem-link {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.app-menu.ui-menu .ui-menuitem-link .ui-menuitem-text {
    white-space: normal;
}

.app-menu.ui-menu .ui-menuitem-link .ui-menuitem-icon {
    flex-shrink: 0;
}

.app-menu.ui-menu .ui-menuitem-link.app-menu-active {
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 600;
}

.app-menu.ui-menu .ui-menuitem-link.app-menu-active .ui-menuitem-icon,
.app-menu.ui-menu .ui-menuitem-link.app-menu-active .ui-menuitem-text {
    color: var(--app-primary);
}

/* Obsah */
.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--app-sidebar-width);
    padding-top: var(--app-topbar-height);
    box-sizing: border-box;
    transition: margin-left 0.2s;
}

.app-breadcrumb {
    padding: 0.75rem 1.5rem 0;
    color: var(--app-text-muted);
}

.app-breadcrumb:empty {
    display: none;
}

.app-content {
    flex: 1;
    padding: 1rem 1.5rem;
}

/* Taby skupin Administrace, Kontroly, Asistent (sectionTabs.xhtml): ouška nad obsahem, zalomí se do více řádků */
.app-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.15rem;
    margin: 1rem 1.5rem -1rem;
    padding-left: 0.25rem;
    border-bottom: 1px solid var(--app-border);
}

.app-tabs .app-tab {
    padding: 0.45rem 0.85rem;
    margin-bottom: -1px;
    border: 1px solid var(--app-border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: var(--app-bg);
    color: var(--app-text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.app-tabs .app-tab:hover {
    color: var(--app-primary);
}

/* aktivní tab podbarvený jako aktivní položka menu (zadáno 13. 11. 2026) */
.app-tabs .app-tab.app-tab-active {
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-weight: 600;
    border-color: var(--app-primary);
    border-top: 2px solid var(--app-primary);
}

.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    color: var(--app-text-muted);
    font-size: 0.875rem;
}

.app-footer img {
    height: 1.75rem;
}

.app-ajax-status {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 1100;
    color: var(--app-primary);
    font-size: 1.5rem;
}

.app-mask {
    display: none;
}

/* Desktop: menu lze skrýt */
body.app-menu-hidden .app-sidebar {
    transform: translateX(-100%);
}

body.app-menu-hidden .app-main {
    margin-left: 0;
}

/* Tablet a mobil: menu se vysouvá přes obsah */
@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .app-main {
        margin-left: 0;
    }

    body.app-menu-open .app-sidebar {
        transform: none;
        box-shadow: 0 0 1.5rem rgba(0, 0, 0, 0.2);
    }

    body.app-menu-open .app-mask {
        display: block;
        position: fixed;
        inset: var(--app-topbar-height) 0 0 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 998;
    }

    .app-content {
        padding: 0.75rem;
    }

    /* na mobilu a tabletu jeden řádek tabů s posunem */
    .app-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0.75rem 0.75rem -0.75rem;
        scrollbar-width: thin;
    }
}

/* Na telefonu jen ikona uživatele a agentury, jména se nevejdou */
@media (max-width: 575px) {
    .app-topbar .app-company-name {
        display: none;
    }

    .app-topbar .app-user-menu .ui-button .ui-button-text,
    .app-topbar .app-company-menu .ui-button .ui-button-text {
        display: none;
    }

    .app-topbar .app-user-menu .ui-button,
    .app-topbar .app-company-menu .ui-button {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
    }

    .app-topbar .app-user-menu .ui-button .ui-button-icon-left,
    .app-topbar .app-company-menu .ui-button .ui-button-icon-left {
        left: 50%;
        margin-left: 0;
        transform: translateX(-50%);
    }

    /* Nápověda a Podpora na telefonu jen jako ikony – se šířkou tlačítka, jinak se ikony překryjí */
    .app-topbar .app-help-link .ui-button-text {
        display: none;
    }

    .app-topbar .app-help-link {
        width: 2.5rem;
        height: 2.5rem;
    }

    .app-topbar .app-help-link a {
        display: block;
        height: 100%;
    }

    .app-topbar .app-help-link .ui-button-icon-left {
        left: 50%;
        margin-left: 0;
        transform: translateX(-50%);
    }
}

/* Přihlašovací a chybová stránka */
body.app-login-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    background: var(--app-bg) center / cover no-repeat;
}

.app-login-card {
    width: 100%;
    max-width: 26rem;
    padding: 2rem;
    box-sizing: border-box;
    background: var(--app-surface);
    border-radius: 6px;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

.app-login-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.app-login-card .app-login-logo {
    display: block;
    height: 3rem;
    max-width: 100%;
    margin-bottom: 1rem;
}

/* personalizované přihlášení agentury: pod názvem agentury název aplikace */
.app-login-card .app-login-sub {
    margin: -0.5rem 0 1rem;
    color: #6c757d;
}

.app-login-card .field label {
    display: block;
    margin-bottom: 0.375rem;
}

/* Testovací prostředí: výrazný žlutý pruh, aby si uživatelé nespletli test s produkcí */
body.app-env-test .app-topbar {
    background: #ffd600;
    border-bottom-color: #c7a500;
}

.app-env-badge {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #212529;
    white-space: nowrap;
}

.app-env-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: #ffd600;
    color: #212529;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: center;
    z-index: 1000;
}

@media (max-width: 575px) {
    .app-env-badge {
        font-size: 1rem;
        letter-spacing: 0.05em;
    }
}

/* Barvy příznaků klientů (flags.color) – dřív ze šablony, hodnoty jsou uložené v databázi */
.Red { color: #d32f2f; }
.Green { color: #388e3c; }
.Yellow { color: #f9a825; }
.Blue { color: #1976d2; }
.Orange { color: #ef6c00; }
.Purple { color: #7b1fa2; }
.Gray { color: #616161; }

/* ---------------------------------------------------------------- AI asistent (plovoucí okno) */
.as-fab { position: fixed; right: 18px; bottom: 18px; z-index: 900; width: 72px; height: 72px; padding: 0; border: none;
          background: transparent; cursor: pointer; filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); transition: transform .15s; }
.as-fab:hover { transform: scale(1.08); }
.as-fab img { width: 100%; height: 100%; object-fit: contain; }
.as-fab-label { position: absolute; right: 80px; bottom: 22px; white-space: nowrap; background: #1F4E79; color: #fff;
                font-size: .85rem; padding: .2rem .6rem; border-radius: 1rem; opacity: 0; pointer-events: none; transition: opacity .15s; }
.as-fab:hover .as-fab-label { opacity: 1; }
.as-actions { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.5rem; }
.as-actions .ui-button { text-align: left; white-space: normal; }
body.as-panel-open .as-fab, body:has(.ui-widget-overlay.ui-dialog-mask) .as-fab { display: none; }
.as-panel { position: fixed; right: 18px; bottom: 18px; z-index: 950; width: 380px; height: 560px; max-height: calc(100vh - 36px);
            display: none; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
            overflow: hidden; }
.as-panel.as-open { display: flex; }
.as-panel form { display: flex; flex-direction: column; height: 100%; }
.as-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: #1F4E79; color: #fff; }
.as-head img { width: 36px; height: 36px; object-fit: contain; }
.as-head-actions { margin-left: auto; display: flex; gap: .5rem; }
.as-icon, .as-icon:visited, .as-head .ui-commandlink.as-icon { color: #fff; text-decoration: none; padding: .2rem; }
.as-msgs { flex: 1; overflow-y: auto; padding: .75rem; background: #f4f7fa; }
.as-msg { max-width: 88%; margin: 0 0 .6rem; padding: .5rem .7rem; border-radius: 10px; font-size: .92rem; line-height: 1.4;
          overflow-wrap: anywhere; }
.as-msg p { margin: 0 0 .4rem; } .as-msg p:last-child { margin-bottom: 0; }
.as-msg ul, .as-msg ol { margin: .2rem 0 .4rem; padding-left: 1.2rem; }
.as-bot { background: #fff; border: 1px solid #dfe6ee; }
.as-user { background: #2E86C1; color: #fff; margin-left: auto; white-space: pre-wrap; }
.as-error { border-color: #e6b0aa; background: #fdf2f1; }
.as-typing { display: none; color: #6c757d; font-style: italic; }
.as-sources { margin-top: .4rem; font-size: .8rem; color: #5b6b7b; }
.as-rate { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; font-size: .85rem; }
.as-rate a { color: #8a96a3; text-decoration: none; }
.as-rate a.as-rated, .as-rate a:hover { color: #1F4E79; }
.as-rate-note { display: flex; gap: .3rem; width: 100%; }
.as-rate-note input { flex: 1; min-width: 0; }
.as-rate-thanks { color: #6c757d; font-size: .8rem; }
.as-input { display: flex; gap: .4rem; padding: .5rem; border-top: 1px solid #e3e8ee; align-items: center; }
.as-input textarea { flex: 1; resize: none; }
.as-attach, .as-attach:visited { color: #8a96a3; text-decoration: none; font-size: 1.15rem; padding: .2rem; }
.as-attach:hover { color: #1F4E79; }
.as-chips { display: none; flex-wrap: wrap; gap: .3rem; padding: .4rem .6rem 0; }
.as-chip { background: #e8eef5; border-radius: 1rem; padding: .1rem .6rem; font-size: .78rem; color: #1F4E79; }
.as-chip a { color: #8a96a3; text-decoration: none; margin-left: .35rem; font-weight: bold; }
.as-file-msg { display: none; font-size: .78rem; color: #b03a2e; padding: .3rem .6rem 0; }
/* odpovědi podpory Tevonio (agent i člověk) – odlišené od asistenta agentury */
.as-support { border-color: #e9b46c; background: #fffaf1; }
.as-support-tag { font-size: .72rem; color: #a35f00; text-transform: uppercase; letter-spacing: .03em; margin-bottom: .25rem; }
.as-note { font-size: .72rem; color: #6c757d; padding: 0 .6rem .5rem; }
@media (max-width: 600px) {
    .as-fab { width: 56px; height: 56px; right: 12px; bottom: 12px; }
    /* přes celou obrazovku a nad horní lištou aplikace (z-index 1000), jinak lišta zakryje záhlaví se zavřením */
    .as-panel { inset: 0; z-index: 1050; width: auto; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0;
                overflow-x: hidden; }
    /* písmo aspoň 16 px – jinak Safari na iPhonu při ťuknutí do pole stránku přiblíží a okno přeteče mimo obrazovku */
    .as-input textarea, .as-input textarea.ui-inputfield { font-size: 16px; min-width: 0; }
    .as-head { padding-top: calc(.5rem + env(safe-area-inset-top)); }
    .as-icon { font-size: 1.35rem; padding: .35rem .5rem; }
}

/* Prodlení s předplatným: pruh jen pro administrátora agentury, aplikace nic neblokuje */
.app-overdue {
    margin: 1rem 1.5rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #fff4e5;
    border: 1px solid #f0b46c;
    color: #7a4100;
}

.app-overdue .pi {
    margin-right: 0.5rem;
}

/* Kontrola délky hesla s jezevčíkem (WEB-INF/passwordDog.xhtml, js/password-dog.js) */
.pw-dog {
    margin: 0 0 0.5rem;
    text-align: center;
}
.pw-dog-stage {
    height: 110px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.pw-dog-svg {
    max-width: 100%;
    height: auto;
    overflow: visible;
}
/* jezevčík vpravo od polí se otočí čelem k nim */
.pw-dog-face-left .pw-dog-svg {
    transform: scaleX(-1);
}
.pw-dog .grow {
    transition: width .25s ease, transform .25s ease;
}
.pw-dog .tail {
    transform-box: view-box;
    transform-origin: 44px 74px;
}
.pw-dog.wag .tail {
    animation: pw-wag .22s ease-in-out infinite alternate;
}
@keyframes pw-wag {
    from { transform: rotate(-18deg); }
    to { transform: rotate(14deg); }
}
.pw-dog.hop [data-part="dogAll"] {
    animation: pw-hop .18s ease-out;
}
@keyframes pw-hop {
    50% { transform: translateY(-3px); }
}
.pw-dog [data-part="face"] > g {
    display: none;
}
.pw-dog-label {
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 1.1em;
}
.pw-dog-label.pw-l0 { color: #d33; }
.pw-dog-label.pw-l1 { color: #b07d00; }
.pw-dog-label.pw-l2 { color: #5d8a00; }
.pw-dog-label.pw-l3 { color: #2a9d3a; }
@media (prefers-reduced-motion: reduce) {
    .pw-dog .grow { transition: none; }
    .pw-dog.wag .tail, .pw-dog.hop [data-part="dogAll"] { animation: none; }
}

/* Registrace agentury: širší karta, údaje z ARES, past na roboty */
.app-login-card.app-register-card {
    max-width: 60rem;
    padding: 1.5rem 2rem;
}

/* registrace ve dvou sloupcích: hustší řádky, aby se vešla na obrazovku bez posouvání */
.app-register-card .app-login-logo { height: 2.25rem; margin-bottom: 0.5rem; }
.app-register-card h1 { margin-bottom: 1rem; font-size: 1.35rem; }
.app-register-card .app-login-sub { margin: -0.75rem 0 0.75rem; }
.app-register-grid .field { margin-bottom: 0.75rem; }
.app-register-grid > [class*="col-"] { padding-top: 0; padding-bottom: 0; }

.app-register-firm {
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--primary-color, #2196f3);
    background: rgba(0, 0, 0, 0.03);
    line-height: 1.5;
}

.app-register-note {
    display: block;
    margin-top: 0.375rem;
    color: #6c757d;
}

/* povinná a nepovinná část registrace (3. 12. 2026); nepovinné pole opuštěné prázdné = žluté */
.app-register-section { margin-bottom: 0.75rem; }
.app-register-h { font-size: 1rem; font-weight: 600; margin: 0 0 0.5rem; }
.app-register-req, .app-register-opt {
    padding: 0.75rem 1rem 0.25rem;
    border: 1px solid #e3e7ec;
    border-radius: 6px;
}
.app-register-opt { background: #f6f8fa; }
.app-register-opt .ui-inputfield.app-skipped { background: #fff6c4; }

.app-register-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Administrace → Předplatné: faktura předplatného k tisku */
.app-subinvoice h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.app-subinvoice-note {
    margin: -0.5rem 0 1rem;
    color: #6c757d;
}

.app-subinvoice-table {
    border-collapse: collapse;
}

.app-subinvoice-table td, .app-subinvoice-table th {
    padding: 0.25rem 1.5rem 0.25rem 0;
    text-align: left;
}

.app-subinvoice-items {
    width: 100%;
    margin-top: 1.5rem;
}

.app-subinvoice-items th, .app-subinvoice-items td {
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 0.5rem 0.5rem 0;
}

/* Zkušební období: informační pruh pro administrátora */
.app-trial {
    margin: 1rem 1.5rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #e8f4fd;
    border: 1px solid #90c8f0;
    color: #0b4f7c;
}

.app-trial .pi {
    margin-right: 0.5rem;
}

.app-subinvoice-paid {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 0.25rem 0.75rem;
    border: 2px solid #2e7d32;
    border-radius: 4px;
    color: #2e7d32;
    font-weight: 600;
}

/* buňky tabulky bez zalomení (čísla dokladů, data, období) */
.app-nowrap {
    white-space: nowrap;
}

.app-subinvoice-cancelled {
    border-color: #c62828;
    color: #c62828;
}

/* kopírování kliknutím (číslo zájezdu u CK, layout.js AppCopy): bublina „Zkopírováno“ po úspěchu */
.app-copy {
    cursor: copy;
    position: relative;
    border-bottom: 1px dotted currentColor;
}

.app-copy:empty {
    border-bottom: 0;
}

/* ikona kopírování vedle upravitelného čísla (detail zájezdu) */
.app-copy.app-copy-icon {
    border-bottom: 0;
    margin-left: 6px;
    color: #6c757d;
    font-size: 0.95em;
    vertical-align: middle;
}

.app-copy.app-copy-icon:hover {
    color: #0b6fb3;
}

.app-copy:focus-visible {
    outline: 2px solid #0b6fb3;
    outline-offset: 2px;
}

.app-copy.app-copied {
    color: #2e7d32;
}

.app-copy.app-copied::after {
    content: attr(data-copied);   /* text v jazyce agentury z atributu body (layout.js) */
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #263238;
    color: #fff;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* Administrace → Uživatelé a Pobočky: cena nad základ předplatného */
.app-plan-notice {
    max-width: 60rem;
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: #e8f4fd;
    color: #0b4f7c;
}

.app-plan-notice .pi {
    margin-right: 0.375rem;
}

/* Dárek: promo kód přidělený agentuře */
.app-gift {
    background: #fdf3e6;
    border-color: #e9b46c;
    color: #6b3d00;
}

/* svislé čáry mezi skupinami sloupců (detail zájezdu a klienta: předpis | klient | cestovní kancelář, provize):
   sloupce mají v xhtml border-right-color, téma Saga ale u buněk kreslí jen spodní čáru – doplnit šířku a styl */
.ui-datatable th[style*="border-right-color"],
.ui-datatable td[style*="border-right-color"] {
    border-right-width: 1px !important;
    border-right-style: solid !important;
    border-right-color: #e9ecef !important;   /* jako čáry v záhlaví tabulky */
}

/* Plovoucí záhlaví tabulek (stickyHeader) pod horní lištou (1000), menu (999) a dialogy – PrimeFaces mu jinak dá
   z-index vyšší než dialogu otevřenému hned při načtení stránky (Nový zájezd z menu) */
.ui-datatable-sticky.ui-widget { z-index: 998 !important; }

/* sloupec částek v souhrnu (detail zájezdu): čísla pod sebou zarovnaná vpravo */
.app-amount-col {
    text-align: right;
}
/* hodnota upravitelná kliknutím (p:inplace) má vpravo vnitřní okraj – v tomto sloupci by končila dřív než ostatní */
body .app-amount-col .ui-inplace .ui-inplace-display {
    padding-right: 0;
}

/* sloupce částek v tabulkách (styleClass="app-amount" u p:column): čísla zarovnaná vpravo, bez zalomení */
body .ui-datatable .app-amount,
body .ui-datatable .ui-datatable-thead > tr > th.app-amount,
body .ui-datatable .ui-datatable-tfoot > tr > td.app-amount,
body .ui-datatable .ui-datatable-data > tr > td.app-amount {
    text-align: right;
    white-space: nowrap;
}

/* tabulka s mnoha sloupci (Zájezdy ke kontrole – cena × platby): šířky podle obsahu, užší okraje buněk, nadpisy
   se smí zalomit (částky ne – app-amount) */
body .ui-datatable.app-wide-table table {
    table-layout: auto;
}
body .ui-datatable.app-wide-table thead > tr > th,
body .ui-datatable.app-wide-table .ui-datatable-data > tr > td {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
body .ui-datatable.app-wide-table thead > tr > th {
    white-space: normal;
}

/* nadpisy sloupců se smí zalomit (dlouhé maďarské), rozložení tabulky zůstává pevné na šířku stránky – na rozdíl od
   app-wide-table netlačí tabulku do šířky (Blížící se platby, platby v detailu zájezdu; procházka HU 30. 11. 2026, N3) */
body .ui-datatable.app-wrap-headers thead > tr > th,
body .ui-datatable.app-wrap-headers thead > tr > th .ui-column-title,
body .ui-datatable.app-wrap-headers tfoot > tr > td {
    white-space: normal;
    hyphens: auto;   /* dělení podle jazyka stránky (html lang), ne lámání uprostřed slova bez spojovníku */
    /* záloha, kde prohlížeč pro jazyk nemá slovník dělení (pl, ro) – dlouhé slovo se zalomí místo přetečení
       (průchod 30. 11. 2026, nález 6; patička s opakovanými nadpisy byla oříznutá) */
    overflow-wrap: anywhere;
}
body .ui-datatable.app-wrap-headers thead > tr > th,
body .ui-datatable.app-wrap-headers tfoot > tr > td,
body .ui-datatable.app-wrap-headers .ui-datatable-data > tr > td {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

/* Administrace → Průvodce nastavením (admin/setupGuide.xhtml) a proužek „Zpět do průvodce“ na cílových stránkách */
.app-guide-back a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}
.app-guide-progress {
    max-width: 60rem;
    margin: 0 0 1.25rem;
}
/* popisek nad ukazatelem: uvnitř by při 0 hotových krocích nebyl vidět (výplň má nulovou šířku) */
.app-guide-progress-label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.app-guide-step {
    display: flex;
    gap: 1rem;
    max-width: 60rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    background: #fff;
}
.app-guide-step.app-guide-done {
    background: #f3faf4;
    border-color: #bfe3c4;
}
.app-guide-status .pi {
    font-size: 1.5rem;
    color: #9aa3ad;
}
.app-guide-done .app-guide-status .pi {
    color: #2e7d32;
}
.app-guide-body {
    flex: 1;
}
.app-guide-body h3 {
    margin: 0 0 0.375rem;
    font-size: 1.05rem;
}
.app-guide-body p {
    margin: 0 0 0.375rem;
}
.app-guide-hint {
    color: #6b7280;
    font-size: 0.9rem;
}
.app-guide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.app-guide-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

/* Telefonické kampaně (Klienti → Kampaně): karty klientů, na telefonu pod sebou přes celou šířku */
.app-campaign-editor {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.app-campaign {
    max-width: 52rem;
}
.app-campaign-head h2 {
    margin: 0.25rem 0;
}
.app-campaign-back {
    text-decoration: none;
}
.app-campaign-progress {
    color: #6b7280;
}
.app-campaign-tools,
.app-campaign-pager,
.app-campaign-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0;
}
.app-campaign-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: #fff;
}
.app-campaign-done {
    background: #f8faf8;
}
.app-campaign-name {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-weight: 600;
    font-size: 1.05rem;
}
.app-campaign-called {
    color: #2e7d32;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.app-campaign-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}
.app-campaign-call {
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.app-campaign-mail {
    text-decoration: none;
    word-break: break-all;
}
.app-campaign-info {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.app-campaign-note {
    white-space: pre-wrap;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.app-campaign-edit {
    margin-top: 0.5rem;
}
.app-campaign-edit textarea {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .app-campaign-card {
        padding: 0.75rem;
    }
    /* písmo aspoň 16 px – Safari na iPhonu jinak při psaní poznámky přiblíží stránku */
    .app-campaign-edit textarea {
        font-size: 16px;
    }
    .app-campaign-actions .ui-button {
        flex: 1 1 auto;
    }
    .app-campaign-call {
        display: inline-block;
        padding: 0.35rem 0;
    }
}

/* Detail zájezdu a detail klienta na telefonu (styleClass="app-mobile" u obsahu stránky). Nad 767 px se nic nemění:
   pomocné popisky a odkazy jsou skryté, sekce otevřené (js/layout.js, AppSections).
   - app-stack-sm: tabulkové p:panelGrid (hlavička, dialogy) – buňky pod sebou, app-first-sm = buňka nahoru
   - app-show-sm: jen na telefonu (odkaz pro vytočení čísla a nový e-mail)
   - tabulky s reflow="true" se od 640 px (hranice PrimeFaces) skládají do řádků „popisek hodnota“; u tabulek s dvouřádkovým
     záhlavím (p:columnGroup) bere PrimeFaces popisky ze záhlaví podle pořadí a přiřadí je špatně – takové tabulky mají
     třídu app-reflow-own a vlastní popisky v buňkách (app-cell-title)
   - app-hide-sm: buňka skrytá (při úpravě řádku tužkou se zobrazí), app-reflow-tool: nabídka a tužka vedle sebe,
     app-reflow-keep: buňka záhlaví, která zůstane (tlačítko + pro nový řádek) */
.app-show-sm,
.app-cell-title {
    display: none;
}
details.app-section > summary {
    display: block;
    list-style: none;
}
details.app-section > summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 767px) {
    .app-show-sm {
        display: inline;
    }
    .app-mobile .app-stack-sm,
    .app-mobile .app-stack-sm > tbody,
    .app-mobile .app-stack-sm > tbody > tr > td {
        display: block;
        width: auto !important;
    }
    .app-mobile .app-stack-sm > tbody > tr {
        display: flex;
        flex-direction: column;
    }
    .app-mobile .app-stack-sm > tbody > tr > td.app-first-sm {
        order: -1;
    }
    .app-contact-link {
        display: inline-block;
        padding: 0.25rem 0.5rem;
        font-size: 1.15rem;
        text-decoration: none;
    }
    /* písmo aspoň 16 px – Safari na iPhonu jinak při psaní stránku přiblíží; pole nepřesahují šířku */
    .app-mobile input.ui-inputfield,
    .app-mobile textarea {
        font-size: 16px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .app-mobile .app-stack-sm .ui-autocomplete,
    .app-mobile .app-stack-sm .ui-autocomplete-input {
        width: 100%;
    }
    .app-mobile .ui-dialog {
        max-width: 96vw;
    }
    .app-mobile .ui-dialog .ui-dialog-content {
        max-height: calc(100vh - 10rem);
        max-height: calc(100dvh - 10rem);
        overflow: auto;
    }
    details.app-section {
        border-top: 1px solid #e9ecef;
    }
    details.app-section > summary {
        padding: 0.75rem 0;
        font-weight: 600;
        cursor: pointer;
    }
    details.app-section > summary::before {
        content: "\e901";   /* pi-chevron-right */
        font-family: 'primeicons';
        margin-right: 0.5rem;
        font-weight: normal;
    }
    details.app-section[open] > summary::before {
        content: "\e902";   /* pi-chevron-down */
    }
}

@media (max-width: 640px) {
    .app-mobile .ui-datatable-reflow.app-reflow-own .ui-datatable-data td .ui-column-title {
        display: none;
    }
    .app-mobile .ui-datatable-reflow .ui-datatable-data td .app-cell-title {
        display: inline-block;
        font-weight: bold;
        margin: -0.4em 1em -0.4em -0.4em;
        width: 40%;
        padding: 0.4em;
        box-sizing: border-box;
    }
    /* svislé čáry mezi skupinami sloupců (Předpis | Klient | CK) na telefonu nedávají smysl */
    .app-mobile .ui-datatable-reflow .ui-datatable-data td[style*="border-right-color"] {
        border-right-width: 0 !important;
    }
    /* hodnota (i pole při úpravě tužkou) vedle popisku, pole přes zbytek šířky */
    .app-mobile .ui-datatable-reflow .ui-datatable-data td .ui-cell-editor {
        display: inline-block;
        vertical-align: middle;
        width: calc(60% - 1em);
    }
    .app-mobile .ui-datatable-reflow .ui-datatable-data td .ui-cell-editor-input > span {
        display: block;
        width: 100% !important;
    }
    .app-mobile .ui-datatable-reflow .ui-datatable-data td .ui-cell-editor-input .ui-inputfield {
        width: 100% !important;
    }
    .app-mobile .ui-datatable-reflow .ui-datatable-data tr:not(.ui-row-editing) > td.app-hide-sm {
        display: none;
    }
    /* „> tr >“ kvůli váze: pravidlo PrimeFaces (td[role=gridcell]:not(...), width 100 % !important) se načítá později */
    .app-mobile .ui-datatable-reflow .ui-datatable-data > tr > td.app-reflow-tool {
        width: auto !important;
    }
    .app-mobile .ui-datatable-reflow .ui-datatable-data > tr > td.app-reflow-tool + td.app-reflow-tool {
        clear: none !important;
    }
    .app-mobile .ui-datatable-reflow thead th.app-reflow-keep {
        display: block;
        width: auto !important;
        text-align: right;
        border: 0 none;
    }
}

/* přepínač jazyka s vlaječkami na stránkách bez přihlášení (WEB-INF/langSwitch.xhtml) – vpravo nahoře v kartě */
.app-login-card { position: relative; }
.app-lang-switch { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.85rem; z-index: 5; }
.app-lang-switch > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.45rem; border-radius: 6px; border: 1px solid #dee2e6; background: var(--app-surface); }
.app-lang-switch > summary::-webkit-details-marker { display: none; }
.app-lang-switch[open] > summary, .app-lang-switch > summary:hover { border-color: #adb5bd; }
.app-flag { width: 1.35rem; height: 0.9rem; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); flex: none; }
.app-lang-code { font-weight: 600; color: #495057; }
.app-lang-menu { position: absolute; right: 0; margin-top: 0.25rem; min-width: 10rem; background: var(--app-surface);
    border: 1px solid #dee2e6; border-radius: 6px; box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12); padding: 0.25rem 0; }
.app-lang-menu a { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; color: inherit; text-decoration: none; }
.app-lang-menu a:hover { background: #f1f3f5; }
.app-lang-menu a.app-lang-current { font-weight: 600; }

/* povinné pole: hvězdička za popiskem (registrace; kontrola zůstává na serveru) */
.app-req::after { content: " *"; color: #c62828; }

/* zpráva klientovi před odjezdem (SMS / WhatsApp přes QR kód, 8. 11. 2026) */
.app-tm-grid { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.app-tm-text { flex: 1 1 18rem; min-width: 0; }
.app-tm-qr { display: flex; gap: 0.75rem; flex: 0 0 auto; }
.app-tm-qr img { display: block; border: 1px solid #e5e7eb; border-radius: 6px; }
.app-tm-qr-label { font-size: 0.85em; font-weight: 600; margin-bottom: 0.25rem; text-align: center; }
tr.app-msg-overdue > td { background: #fff4e5 !important; }
tr.app-msg-today > td { background: #eef6ff !important; }
tr.app-msg-later > td { color: #6b7280; }

/* potvrzovací okno (globální p:confirmDialog) se u dlouhého textu roztáhlo přes celou šířku stránky (revize SK 8. 11. 2026) */
.ui-confirm-dialog { max-width: min(36rem, calc(100vw - 2rem)); }
.ui-confirm-dialog .ui-confirm-dialog-message { white-space: normal; }

/* dlouhý e-mail se zalomí, nerozšíří stránku (detail zájezdu na 1366 px přetékal, 8. 11. 2026) */
.app-break {
    display: inline-block;
    min-width: 9rem;
    overflow-wrap: anywhere;
}

/* Blížící se odjezdy: zájezdy po odjezdu šedě a se štítkem (návrh 2, 11. 11. 2026) */
tr.app-departed > td { opacity: 0.55; }
.app-departed-tag { display: block; font-size: 0.8em; }
/* Dashboard: prázdná karta (zprávy klientům) jen jako jeden řádek */
.app-card-min { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; align-items: baseline; margin-bottom: 0.75em;
    padding: 0.5rem 0.9rem; background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; color: #6b7280; }
.app-card-min b { color: #1f2937; }

/* rámeček průvodce nastavením na Dashboardu (návrh výchozího nastavení 21. 11. 2026) */
.app-guide-frame {
    margin-bottom: 1em;
    padding: 0.75rem 1rem;
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
}
.app-guide-frame-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.app-guide-frame-sub {
    margin-top: 0.5rem;
    color: #374151;
}
.app-guide-frame-list {
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
}
.app-guide-frame-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-top: 1px solid #dbeafe;
}
.app-guide-frame-list li span {
    flex: 1 1 20rem;
}
.app-guide-frame-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9em;
}

/* nevyplněná hodnota p:inplace („Vorgangsnummer des Veranstalters eingeben“) se v hlavičce zájezdu zalamuje – delší jazyky
   jinak roztáhly hlavičku za okraj okna (průchod DACH 29. 11. 2026, nález 8) */
body .ui-inplace .ui-inplace-display {
    white-space: normal;
}

/* obal hlášek (p:growl) je širší a vyšší než viditelné hlášky (okraj 14 px pod každou) – neviditelný pruh zachytával kliknutí
   na tlačítka v záhlaví stránky pod ním; kliknutí zachytí jen samotná hláška (natáčení HU 30. 11. 2026, E4) */
.ui-growl {
    pointer-events: none;
}
.ui-growl .ui-growl-item-container {
    pointer-events: auto;
}
