:root {
    --crm-shell-purple: #45225e;
    --crm-shell-purple-soft: #f3ebfb;
    --crm-shell-surface: #ffffff;
    --crm-shell-surface-muted: #f8fafc;
    --crm-shell-border: #dbe2ea;
    --crm-shell-text: #1e293b;
    --crm-shell-text-muted: #64748b;
    --crm-shell-header-height: 45px;
    --crm-shell-sidebar-width: 200px;
    --crm-shell-mob-bar-core: 60px;
}

.crm-shell-body {
    margin: 0;
    background: #eef2f6;
    font-family: Arial, Helvetica, sans-serif;
    /* common.css má body { overflow: hidden } — pro shell potřebujeme vidět spodek při scrollu v main */
    overflow-x: hidden;
    overflow-y: hidden;
}

.crm-shell-app {
    --crm-shell-inline-pad: 21px;
    min-height: var(--app-viewport-height);
    display: flex;
    flex-direction: column;
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
}

.crm-shell-app.crm-shell-kiosk {
    --crm-shell-sidebar-width: 150px;
    --crm-shell-inline-pad: 16px;
}

.crm-shell-app.crm-shell-kiosk > .crm-shell-header {
    display: none;
}

.crm-shell-app.crm-shell-kiosk > .app-layout {
    height: var(--app-viewport-height);
}

.crm-shell-app.crm-shell-kiosk .crm-shell-main {
    padding-top: 0 !important;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar {
    --crm-shell-nav-base: 10px;
    --crm-shell-nav-nested: 9px;
    --crm-shell-nav-row-min: 36px;
    --crm-shell-nav-pad-y: 9px;
    --crm-shell-nav-pad-x: 9px;
    --crm-shell-sidebar-menu-scale: 1;
}

/* kiosk.rybizak.app: tlačítko sbalit — zelené když je menu rozbalené, ve sbaleném stavu jen fialová šipka (žádný šedivý pruh) */
.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 6px;
    border: 0;
    border-top: 1px solid rgba(22, 163, 74, 0.35);
    background: #16a34a;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot:hover,
.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot:focus-visible {
    background: #15803d;
    outline: none;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot .crm-shell-kiosk-sidebar-foot-icon {
    color: #fff;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot.crm-shell-kiosk-foot--sidebar-collapsed {
    background: transparent;
    border-top-color: #e2e8f0;
    color: var(--crm-shell-purple);
    padding: 8px 4px;
}

.crm-shell-app.crm-shell-kiosk
    .crm-shell-kiosk-sidebar-foot.crm-shell-kiosk-foot--sidebar-collapsed
    .crm-shell-kiosk-sidebar-foot-icon {
    color: var(--crm-shell-purple);
    font-size: 1.35rem;
}

.crm-shell-app.crm-shell-kiosk
    .crm-shell-kiosk-sidebar-foot.crm-shell-kiosk-foot--sidebar-collapsed
    .crm-shell-kiosk-sidebar-foot-text {
    display: none;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot.crm-shell-kiosk-foot--sidebar-collapsed:hover,
.crm-shell-app.crm-shell-kiosk .crm-shell-kiosk-sidebar-foot.crm-shell-kiosk-foot--sidebar-collapsed:focus-visible {
    background: rgba(69, 34, 94, 0.06);
}

/* Tenký fialový proušek: safe area + datum/čas (obsah není pod systémovou lištou iPadu) */
.crm-shell-app.crm-shell-kiosk.crm-shell-kiosk-rybizak-app > .crm-shell-kiosk-rybizak-statusbar {
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: 28px;
    padding: calc(2px + env(safe-area-inset-top, 0px)) 10px 6px;
    background: var(--crm-shell-purple);
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-shell-kiosk-rybizak-app .crm-shell-kiosk-rybizak-statusbar-line {
    display: block;
}

.crm-shell-app.crm-shell-kiosk.crm-shell-kiosk-rybizak-app > .app-layout {
    height: auto;
    min-height: 0;
    flex: 1;
    max-height: none;
}

/* Sbalený postranní panel: moduly s krátkým popiskem, aktivní stav s odsazením od okrajů */
.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed {
    width: 80px;
    min-width: 80px;
}

.crm-shell-app.crm-shell-kiosk-rybizak-app.crm-shell-sidebar-collapsed > .app-layout {
    grid-template-columns: 80px minmax(0, 1fr);
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed .nav-group-label {
    display: none;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed .nav-group {
    margin: 6px 0;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed .nav-group + .nav-group {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e8edf2;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed .nav-group-items {
    display: flex !important;
    flex-direction: column;
    padding: 0;
    margin: 0;
    border: 0;
    gap: 2px;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed .nav-item-kiosk-abbr {
    display: block;
    font-size: 8px;
    line-height: 1.1;
    font-weight: 600;
    text-align: center;
    text-transform: none;
    color: #334155;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
    padding: 0 1px;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar:not(.collapsed) .nav-item-kiosk-abbr {
    display: none;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed a.nav-item {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    min-height: 50px;
    box-sizing: border-box;
    margin: 0 4px 2px;
    padding: 6px 1px 5px;
    text-align: center;
    border-radius: 7px;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed a.nav-item .nav-item-text {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    max-width: none;
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    flex-shrink: 0;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed a.nav-item i {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 1.05em;
    flex-shrink: 0;
}

.crm-shell-kiosk-rybizak-app .crm-shell-sidebar.collapsed a.nav-item.active {
    margin-left: 5px;
    margin-right: 5px;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-links {
    padding: 12px 0 18px;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-group {
    margin: 8px 0 14px;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-item,
.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-group-label {
    align-items: flex-start;
    gap: 8px;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-item i,
.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-group-toggle-main i {
    margin-top: 2px;
    flex-shrink: 0;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-item-text {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    line-height: 1.2;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.crm-shell-app.crm-shell-kiosk .crm-shell-sidebar .nav-group-items {
    margin-left: 0;
    padding: 6px 0 0 8px;
}

.crm-shell-app > .crm-shell-header {
    flex-shrink: 0;
}

/* Jen kořenový layout shellu — ne vnořené .app-layout (např. helpdesk z helpdesk.html). */
.crm-shell-app > .app-layout {
    display: grid;
    grid-template-columns: var(--crm-shell-sidebar-width) minmax(0, 1fr);
    /* Jedna řada s pevnou výškou = výška kontejneru; bez toho by řádek rostl podle obsahu main a celý shell přetekl přes viewport (body overflow:hidden ořízne patičku). */
    grid-template-rows: minmax(0, 1fr);
    /* Přepis common.css .app-layout { height: 100vh } — zabírá jen výšku pod headerem */
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    overflow: hidden;
}

.crm-shell-app.crm-shell-sidebar-collapsed > .app-layout {
    grid-template-columns: 62px minmax(0, 1fr);
}

.crm-shell-sidebar {
    position: relative;
    top: auto;
    width: var(--crm-shell-sidebar-width);
    min-width: var(--crm-shell-sidebar-width);
    border-right: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: none;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    overflow-x: hidden;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    --crm-shell-nav-base: 11px;
    --crm-shell-nav-nested: 10px;
    --crm-shell-nav-row-min: 30px;
    --crm-shell-nav-pad-y: 7px;
    --crm-shell-nav-pad-x: 10px;
    /* Pevnych 120 % oproti puvodnimu „100 %“ zakladu (bez uzivatelskeho nastaveni) */
    --crm-shell-sidebar-menu-scale: 1.2;
}

.crm-shell-sidebar-navscroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* common.css dává .nav-links overflow-y: auto bez overflow-x → v úzkém / sbaleném menu šedý horizontální posuvník */
.crm-shell-sidebar .crm-shell-sidebar-navscroll .nav-links {
    overflow-x: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.crm-shell-sidebar.collapsed .nav-item-text,
.crm-shell-sidebar.collapsed .nav-group-toggle-main .nav-item-text {
    overflow: hidden;
    max-width: 0;
    flex-shrink: 0;
}

.crm-shell-sidebar.collapsed {
    width: 62px;
    min-width: 62px;
}

.crm-shell-main {
    background: #eef2f6;
    padding: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.crm-shell-container {
    max-width: 100%;
}

.crm-shell-header {
    display: flex;
    align-items: stretch;
    min-height: var(--crm-shell-header-height);
    height: var(--crm-shell-header-height);
    margin: 0;
    padding: 0;
    background: var(--crm-shell-purple);
    color: #fff;
    width: 100%;
}

/* Desktop: brand + main v jednom řádku (mobilní prvky display:none) */
.crm-shell-header-desk {
    display: flex;
    flex: 1;
    align-items: stretch;
    min-width: 0;
    width: 100%;
}

.crm-shell-header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--crm-shell-sidebar-width);
    min-width: var(--crm-shell-sidebar-width);
    padding: 0 12px 0 10px;
    border-right: 0;
    position: relative;
}

.crm-shell-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    padding: 0 var(--crm-shell-inline-pad) 0 12px;
}

.crm-shell-header-search {
    flex: 0 0 auto;
}

.crm-shell-header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.crm-shell-header-module {
    flex: 0 0 auto;
    max-width: 10rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.crm-shell-header-sep {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.crm-shell-header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 0;
    overflow: hidden;
}

.crm-shell-header-breadcrumbs span {
    white-space: nowrap;
}

.crm-shell-header-breadcrumbs strong {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-shell-header-breadcrumbs i {
    font-size: 0.4rem;
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.crm-shell-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.crm-shell-header-actions:empty {
    display: none;
}

.crm-shell-header-standard-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.crm-hdr-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1;
    letter-spacing: 0.01em;
}

.crm-hdr-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
}

.crm-hdr-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

.crm-hdr-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

.crm-hdr-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.crm-hdr-btn i {
    font-size: 0.6rem;
    opacity: 0.85;
}

.crm-hdr-btn--icon-only {
    padding: 0 7px;
    min-width: 26px;
    justify-content: center;
}

.crm-shell-header-right {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: 28px;
    flex-shrink: 0;
}

.crm-shell-search {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 235px;
    height: 24px;
    padding: 0 0 0 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    background: #ffffff;
    color: #7c8392;
}

.crm-shell-search--with-submit {
    padding-right: 2px;
}

.crm-shell-search input {
    flex: 1;
    min-width: 0;
    width: auto;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 10px;
    outline: none;
}

.crm-shell-search-submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 20px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 2px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.crm-shell-search-submit:hover {
    background: rgba(69, 34, 94, 0.08);
    color: var(--crm-shell-purple, #45225e);
}

.crm-shell-search-submit:active {
    background: rgba(69, 34, 94, 0.14);
}

.crm-shell-search input::placeholder {
    color: #8b94a7;
}

.crm-shell-bell-mount {
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-shell-user-card {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.crm-shell-user-card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

.crm-shell-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.crm-shell-user-card-copy {
    min-width: 0;
    padding-right: 21px;
}

.crm-shell-user-card-name,
.crm-shell-user-card-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-shell-user-card-name {
    max-width: 122px;
    font-size: 10px;
    font-weight: 700;
}

.crm-shell-user-card-email {
    max-width: 122px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 8px;
}

.crm-shell-content-card {
    background: var(--crm-shell-surface);
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    border: 0;
    min-height: auto;
    overflow: hidden;
}

/* Rezervace admin: vnořené modály (mapa stolů) — fixed overlay nesmí ořezat rodič overflow:hidden */
.crm-shell-content-card:has(#rezAdminRoot) {
    overflow: visible;
}

.crm-shell-content-card:has(#crmRutinaRoot) {
    overflow: visible;
}

.crm-shell-content-card:has(#crmPrekvapkoRoot) {
    overflow: visible;
}

.crm-shell-content-card:has(#vinarnaDochazkaRoot) {
    padding: 0;
    overflow: hidden;
}

/* Nativní modul (bez legacy iframe / bez helpdesku) — odstup obsahu od okrajů karty */
.crm-shell-content-card:not(.crm-shell-content-card--legacy):not(:has(#helpdeskFullMount)) {
    padding: 12px clamp(12px, 2.8vw, 24px) 20px;
}

.crm-shell-user-subtitle {
    margin-top: 4px;
    font-size: 0.74rem;
    color: var(--crm-shell-text-muted);
}

.crm-shell-content-card--legacy {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
}

.crm-shell-logo-link {
    display: flex;
    align-items: center;
    min-height: 24px;
}

.crm-shell-logo-img {
    display: block;
    width: auto;
    height: 20px;
    max-width: 112px;
}

.crm-shell-header .sidebar-header-top {
    width: 100%;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.crm-shell-header .sidebar-toggle {
    width: 20px;
    height: 20px;
    font-size: 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--crm-shell-purple);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.crm-shell-header .sidebar-toggle:hover,
.crm-shell-header .sidebar-toggle:focus-visible {
    background: #ffffff;
    border-color: rgba(69, 34, 94, 0.35);
    color: var(--crm-shell-purple);
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.crm-shell-sidebar .nav-links {
    padding: 8px 0 12px;
}

.crm-shell-bell-mount .zvonecek-btn,
.crm-shell-bell-mount .zvonecek-btn:hover,
.crm-shell-bell-mount .zvonecek-btn:focus-visible,
.crm-shell-bell-mount .zvonecek-btn--open,
.crm-shell-bell-mount .zvonecek-btn--open:hover {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    box-shadow: none;
    outline: none;
}

.crm-shell-bell-mount .zvonecek-btn i {
    font-size: 22px;
}

.crm-shell-bell-mount .zvonecek-badge {
    top: -7px;
    right: -9px;
    border-color: var(--crm-shell-purple);
}

.crm-shell-sidebar .nav-item,
.crm-shell-sidebar .nav-group-label {
    min-height: calc(var(--crm-shell-nav-row-min) * var(--crm-shell-sidebar-menu-scale));
    padding: calc(var(--crm-shell-nav-pad-y) * var(--crm-shell-sidebar-menu-scale))
        calc(var(--crm-shell-nav-pad-x) * var(--crm-shell-sidebar-menu-scale));
    border-radius: 0;
    font-size: calc(var(--crm-shell-nav-base) * var(--crm-shell-sidebar-menu-scale));
    font-weight: 400;
    letter-spacing: 0;
    box-shadow: none;
}

.crm-shell-sidebar .nav-item.active {
    background: #e8f3ff;
    color: #4aa6ed;
    box-shadow: none;
}

.crm-shell-sidebar .nav-item.active::before {
    display: none;
}

.crm-shell-sidebar .nav-item:hover {
    background: #f7f9fb;
    transform: none;
    box-shadow: none;
}

@keyframes crm-shell-nav-rezervace-attn-pulse {
    0%,
    100% {
        background-color: transparent;
        box-shadow: none;
    }
    50% {
        background: rgba(109, 40, 217, 0.11);
        box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.32);
    }
}

.crm-shell-sidebar .nav-item.nav-item-rezervace-attn {
    animation: crm-shell-nav-rezervace-attn-pulse 1.25s ease-in-out infinite;
    color: var(--crm-shell-purple);
    font-weight: 600;
}

.crm-shell-sidebar .nav-item.nav-item-rezervace-attn i {
    color: var(--crm-shell-purple);
}

.crm-shell-sidebar .nav-item[data-key="rutina"] {
    position: relative;
}

.crm-shell-sidebar .nav-item.nav-item--rutina-attn {
    animation: crm-shell-nav-rutina-attn-pulse 1.2s ease-in-out infinite;
    color: #2563eb;
    font-weight: 600;
}

.crm-shell-sidebar .nav-item.nav-item--rutina-attn i {
    color: #2563eb;
}

.crm-shell-sidebar .nav-item .rutina-progress-dot {
    position: absolute;
    top: 7px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
    pointer-events: none;
}

@keyframes crm-shell-nav-rutina-attn-pulse {
    0%,
    100% {
        background: transparent;
        box-shadow: none;
    }
    50% {
        background: rgba(37, 99, 235, 0.1);
        box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .crm-shell-sidebar .nav-item.nav-item-rezervace-attn {
        animation: none;
        background: rgba(109, 40, 217, 0.1);
        box-shadow: inset 0 0 0 2px rgba(109, 40, 217, 0.35);
    }

    .crm-shell-sidebar .nav-item.nav-item--rutina-attn {
        animation: none;
        background: rgba(37, 99, 235, 0.08);
        box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.35);
    }
}

.crm-shell-sidebar .nav-item i,
.crm-shell-sidebar .nav-group-toggle-main i {
    width: 1.15em;
    min-width: 1.15em;
    font-size: 1em;
    text-align: center;
}

.crm-shell-sidebar .nav-group-items .nav-item.active {
    background: #f3f7fb;
}

.crm-shell-sidebar .nav-group {
    margin: 2px 0 5px;
    box-shadow: none;
}

.crm-shell-sidebar .nav-group-items {
    margin-left: 2px;
    padding: 2px 0 0 6px;
    border-left: 0;
}

.crm-shell-sidebar .nav-group-items .nav-item {
    font-size: calc(var(--crm-shell-nav-nested) * var(--crm-shell-sidebar-menu-scale));
}

.crm-shell-sidebar .nav-group-label {
    background: transparent;
    color: #3f4752;
    box-shadow: none;
}

.crm-shell-sidebar .nav-group-label:hover,
.crm-shell-sidebar .nav-group-label.expanded {
    background: #f7f9fb;
    color: #2f3742;
    box-shadow: none;
}

.crm-shell-sidebar .nav-item-text {
    font-size: inherit;
}

.crm-shell-sidebar.collapsed .crm-shell-logo-img {
    max-width: 26px;
    object-fit: cover;
    object-position: left;
}

.crm-shell-native-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.crm-shell-native-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
}

.crm-shell-native-card h2,
.crm-shell-section-head h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-shell-native-card p,
.crm-shell-section-head p {
    margin: 0;
    line-height: 1.6;
    color: #475569;
}

.crm-shell-checklist {
    margin: 16px 0 0;
    padding-left: 18px;
    color: #334155;
    line-height: 1.7;
}

.crm-shell-kpi-list {
    display: grid;
    gap: 10px;
}

.crm-shell-kpi {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.crm-shell-kpi span {
    font-size: 0.8rem;
    color: #64748b;
}

.crm-shell-kpi strong {
    color: #1e293b;
}

.crm-shell-api-list {
    display: grid;
    gap: 10px;
}

.crm-shell-api-list code {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

/* ═══ Modul se záložkami (znovupoužitelné v nativních stránkách) ═══
   Varianta A (Moje info): .crm-native-mod-with-tabs > .crm-shell-native-tabs-chrome (šedé pozadí, ne sticky — scrolluje s main)
   + .crm-shell-content-card--below-native-tabs > obsah s .crm-module-layout (jen head + panely).
   Kořen pro crmShellBindModuleTabs = .crm-native-mod-with-tabs.
   Varianta B: záložky uvnitř .crm-module-layout jako dřív.
   JS: crmShellBindModuleTabs — viz module_tabs.js; URL záložky přes history.replaceState (bez full reloadu). */

.crm-native-mod-with-tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

/* Záložky nad bílou kartou, v šedém pásu mainu; scrollují spolu s obsahem (ne sticky) */
.crm-shell-native-tabs-chrome {
    margin: 0 0 10px;
    padding: 2px 0 12px;
    background: #eef2f6;
}

.crm-module-tabs-wrap--in-chrome {
    margin-top: 0;
    padding-bottom: 0;
    box-shadow: none;
}

.crm-shell-content-card--below-native-tabs {
    margin-top: 0;
}

/* Nativní modul hodnocení vinárny — nechat dýchat spodek nad patičkou při scrollu v main */
.crm-shell-main:has(.crm-vinarna-hodn) .crm-shell-content-wrap {
    padding-bottom: 24px;
}

.crm-module-layout {
    --crm-module-tabs-edge: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.crm-module-head {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.crm-module-tabs-wrap {
    position: relative;
    margin-top: 18px;
    padding-bottom: 2px;
    /* jemné zamlžení okrajů při horizontálním scrollu záložek (ne v chrome variantě) */
    box-shadow:
        inset 18px 0 16px -18px var(--crm-module-tabs-edge),
        inset -18px 0 16px -18px var(--crm-module-tabs-edge);
}

.crm-module-tabs-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 4px 12px;
    margin: 0 -2px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.crm-module-tabs-scroll::-webkit-scrollbar {
    display: none;
    height: 0;
}

.crm-module-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 10px 16px;
    border: none;
    border-radius: 11px;
    background: #f1f5f9;
    color: #475569;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.crm-module-tab i {
    font-size: 0.92em;
    opacity: 0.88;
}

.crm-module-tab:hover {
    background: #e2e8f0;
    color: #334155;
}

.crm-module-tab:focus-visible {
    outline: 2px solid var(--crm-shell-purple);
    outline-offset: 2px;
}

.crm-module-tab:active {
    transform: scale(0.98);
}

.crm-module-tab--active {
    background: #45225e;
    color: #fff;
    box-shadow: none;
}

.crm-module-tab--active:hover {
    background: #3b1d52;
    color: #fff;
}

.crm-module-tab--active i {
    opacity: 1;
}

.crm-module-panels {
    margin-top: 4px;
    min-width: 0;
}

.crm-module-panel {
    display: none;
}

.crm-module-panel.crm-module-panel--active {
    display: block;
}

@media (max-width: 768px) {
    .crm-module-tab {
        padding: 11px 14px;
        font-size: 14px;
        border-radius: 12px;
    }

    .crm-module-tabs-wrap {
        margin-top: 14px;
    }
}

/* ── Content wrap ──
   Ne flex:1 — obsah má přirozenou výšku; patička následuje a scrolluje se spolu v .crm-shell-main */
.crm-shell-content-wrap {
    flex: 0 0 auto;
    padding: 14px var(--crm-shell-inline-pad) 0;
    width: 100%;
}

.crm-shell-content-wrap .crm-shell-content-card {
    margin-bottom: 20px;
}

.crm-shell-main:has(#crmPrekvapkoRoot) .crm-shell-content-wrap {
    padding-bottom: 140px;
}

/* Helpdesk 1:1 — vyplnit výšku pod hlavičkou až k patičce; scroll jen uvnitř panelů (seznam / vlákno / editor). */
.crm-shell-main:has(.crm-helpdesk-full-mount) {
    overflow: hidden;
    min-height: 0;
}

.crm-shell-main:has(.crm-helpdesk-full-mount) .crm-shell-content-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.crm-shell-main:has(.crm-helpdesk-full-mount) .crm-shell-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.crm-shell-main:has(.crm-helpdesk-full-mount) #crmShellContent {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.crm-shell-main:has(.crm-helpdesk-full-mount) .crm-shell-content-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 0;
}

/* Helpdesk: bez šedé patičky s odkazy a verzí — modul až ke spodnímu okraji viewportu */
.crm-shell-main:has(.crm-helpdesk-full-mount) .crm-shell-footer {
    display: none !important;
}

/* ── Footer (decentní text na šedém pozadí, žádný fialový pruh) ── */
.crm-shell-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 24px var(--crm-shell-inline-pad) 28px;
    margin-top: auto;
}

.crm-shell-footer a {
    color: #94a3b8;
    font-size: 0.68rem;
    text-decoration: none;
}

.crm-shell-footer a:hover {
    color: #64748b;
}

.crm-shell-footer-dot {
    color: #cbd5e1;
    font-size: 0.68rem;
    user-select: none;
}

.crm-shell-footer-version {
    font-size: 0.62rem;
    color: #b0bec5;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.crm-shell-legacy-wrap {
    flex: 1;
    min-height: 0;
}

.crm-shell-legacy-frame {
    display: block;
    width: 100%;
    min-height: calc(var(--app-viewport-height) - 130px);
    height: calc(var(--app-viewport-height) - 130px);
    border: 0;
    border-top: 1px solid #e8edf2;
    border-radius: 0;
    background: #fff;
}

/* ── Mobilní prvky skryté na desktopu ── */
.crm-shell-mob-topbar,
.crm-shell-mob-search-drop,
.crm-shell-mob-crumbs {
    display: none;
}

.crm-shell-sidebar-userfoot {
    display: none;
}

@media (max-width: 768px) {
    .crm-shell-app {
        --crm-shell-inline-pad: 15px;
        --crm-shell-mob-top-h: calc(var(--crm-shell-mob-bar-core) + var(--safe-area-top, 0px));
    }

    .crm-shell-body .mobile-menu-btn {
        display: none !important;
    }

    /*
     * Jedna buňka: sidebar + main se překrývají. Jinak druhý child jde do implicitního 2. řádku,
     * první řádek (1fr) polyká výšku viewportu → obří prázdný pás nad obsahem (helpdesk v iframe).
     */
    .crm-shell-app > .app-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "shellstack";
    }

    .crm-shell-app > .app-layout > .crm-shell-sidebar {
        grid-area: shellstack;
        align-self: stretch;
        min-height: 0;
    }

    .crm-shell-app > .app-layout > .crm-shell-main {
        grid-area: shellstack;
        align-self: stretch;
        min-height: 0;
    }

    .crm-shell-app > .crm-shell-header {
        display: contents;
    }

    .crm-shell-header-desk {
        display: none !important;
    }

    .crm-shell-mob-lead {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        min-width: 0;
    }

    .crm-shell-mob-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 300;
        min-height: var(--crm-shell-mob-top-h);
        padding: var(--safe-area-top, 0px) 10px 0;
        box-sizing: border-box;
        background: var(--crm-shell-purple);
        color: #fff;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
        will-change: transform;
    }

    html.crm-shell-mob-top-hidden .crm-shell-mob-topbar {
        transform: translateY(-100%);
        box-shadow: none;
    }

    .crm-shell-mob-iconbtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #fff;
        font-size: 1.05rem;
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .crm-shell-mob-iconbtn:active {
        background: rgba(255, 255, 255, 0.12);
    }

    .crm-shell-mob-iconbtn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .crm-shell-mob-logo {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-decoration: none;
    }

    .crm-shell-mob-logo-img {
        display: block;
        height: 22px;
        width: auto;
        max-width: min(120px, 38vw);
        object-fit: contain;
    }

    .crm-shell-mob-icons {
        display: flex;
        align-items: center;
        gap: 2px;
        flex-shrink: 0;
    }

    .crm-shell-mob-icons .crm-shell-bell-slot {
        margin-right: 12px;
    }

    .crm-shell-mob-icons .crm-shell-bell-mount .zvonecek-btn i {
        font-size: 1.15rem;
    }

    .crm-shell-mob-search-drop:not([hidden]) {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        /* Nad obsahem main, pod návrhy vyhledávání helpdesku (fixed dropdown). */
        z-index: 310;
        padding: 10px 12px 12px;
        background: var(--crm-shell-purple);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        top: var(--crm-shell-mob-top-h);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    }

    .crm-shell-mob-search-drop[hidden] {
        display: none !important;
    }

    html.crm-shell-mob-top-hidden .crm-shell-mob-search-drop:not([hidden]) {
        transform: translateY(calc(-1 * var(--crm-shell-mob-top-h) - 100%));
        opacity: 0;
        pointer-events: none;
    }

    .crm-shell-search--mob-full {
        width: 100%;
        height: 40px;
        padding-left: 12px;
        padding-right: 4px;
    }

    .crm-shell-search--mob-full input {
        font-size: 14px;
    }

    .crm-shell-search--mob-full .crm-shell-search-submit {
        width: 40px;
        height: 34px;
        border-radius: 8px;
        font-size: 1rem;
        color: #64748b;
    }

    .crm-shell-mob-crumbs {
        display: block;
        position: relative;
        width: 100%;
        margin: 0 0 10px;
        padding: 10px var(--crm-shell-inline-pad);
        box-sizing: border-box;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
    }

    .crm-shell-mob-pagehead {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .crm-shell-mob-pagetitle {
        font-size: 0.95rem;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.3;
        flex: 1;
        min-width: 0;
        padding-right: 8px;
    }

    .crm-shell-mob-breadcrumbs {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 6px;
        font-size: 0.72rem;
        color: #64748b;
        line-height: 1.35;
        max-width: 58%;
        text-align: right;
    }

    .crm-shell-mob-breadcrumbs .crm-shell-mob-crumb-home {
        color: #94a3b8;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
    }

    .crm-shell-mob-breadcrumbs .crm-shell-mob-crumb-home i {
        font-size: 0.85rem;
    }

    .crm-shell-mob-breadcrumbs .crm-shell-mob-crumb-sep {
        font-size: 0.5rem;
        color: #cbd5e1;
    }

    .crm-shell-mob-breadcrumbs span {
        color: #64748b;
    }

    .crm-shell-mob-breadcrumbs strong {
        color: #334155;
        font-weight: 600;
    }

    /* Helpdesk: bez mobilního nadpisu a drobečků — modul hned pod fialovou lištou (desktop beze změny). */
    .crm-shell-app[data-active-key="helpdesk_schranky"] #crmShellMobCrumbs,
    .crm-shell-app[data-active-key="helpdesk_nastaveni"] #crmShellMobCrumbs,
    .crm-shell-app[data-active-key="helpdesk"] #crmShellMobCrumbs {
        display: none !important;
    }

    .crm-shell-main {
        width: 100%;
        padding: 0;
        padding-top: var(--crm-shell-mob-top-h);
        box-sizing: border-box;
        /* Snížit pravděpodobnost horizontálního „zpět“ z okraje v PWA / mobilním Chrome */
        overscroll-behavior-x: contain;
    }

    /* Neviditelný levý okraj — tah doprava otevře drawer (app.js). */
    .crm-shell-mob-edge-swipe-rail {
        position: fixed;
        left: 0;
        top: var(--crm-shell-mob-top-h);
        bottom: 0;
        width: max(22px, calc(env(safe-area-inset-left, 0px) + 12px));
        max-width: 40px;
        z-index: 265;
        touch-action: none;
        background: transparent;
        pointer-events: auto;
    }

    .crm-shell-content-wrap {
        padding: 12px var(--crm-shell-inline-pad) calc(15px + var(--safe-area-bottom));
    }

    .crm-shell-main:has(#crmPrekvapkoRoot) .crm-shell-content-wrap {
        padding-bottom: calc(220px + var(--safe-area-bottom));
    }

    .crm-shell-main:has(.crm-helpdesk-full-mount) .crm-shell-content-wrap {
        padding-top: 0;
        padding-bottom: 0;
    }

    .crm-shell-main:has(.crm-helpdesk-full-mount) .crm-shell-content-card {
        padding: 0;
    }

    .crm-shell-sidebar,
    .crm-shell-sidebar.collapsed {
        width: min(320px, 88vw);
        min-width: min(320px, 88vw);
        margin-left: calc(-1 * min(320px, 88vw));
        top: var(--crm-shell-mob-top-h);
        height: calc(var(--app-viewport-height) - var(--crm-shell-mob-top-h));
        z-index: 280;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
        --crm-shell-nav-base: 15px;
        --crm-shell-nav-nested: 13px;
        --crm-shell-nav-row-min: 44px;
        --crm-shell-nav-pad-y: 10px;
        --crm-shell-nav-pad-x: 12px;
    }

    .crm-shell-sidebar.mobile-open {
        margin-left: 0;
    }

    .crm-shell-sidebar .crm-shell-sidebar-navscroll {
        flex: 1;
        min-height: 0;
    }

    .crm-shell-app .sidebar-overlay.active {
        z-index: 270;
        top: var(--crm-shell-mob-top-h);
        height: calc(100% - var(--crm-shell-mob-top-h));
    }

    .crm-shell-sidebar-userfoot {
        display: block;
        flex-shrink: 0;
        padding: 12px 14px calc(14px + var(--safe-area-bottom));
        border-top: 1px solid #e8edf2;
        background: #fafbfc;
    }

    .crm-shell-sidebar-userfoot-btn {
        display: block;
        width: 100%;
        text-align: left;
        padding: 10px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        cursor: pointer;
        font-size: 0.88rem;
        font-weight: 600;
        color: #334155;
        -webkit-tap-highlight-color: transparent;
    }

    .crm-shell-sidebar-userfoot-btn:active {
        background: #f8fafc;
    }

    .crm-shell-content-card {
        padding: 16px;
        min-height: auto;
    }

    .crm-shell-content-card--legacy {
        padding: 0;
    }

    .crm-shell-legacy-frame {
        min-height: calc(var(--app-viewport-height) - var(--crm-shell-mob-top-h) - 120px);
        height: calc(var(--app-viewport-height) - var(--crm-shell-mob-top-h) - 120px);
    }
}

@media (min-width: 769px) and (max-width: 1180px) and (pointer: coarse) {
    .crm-shell-header {
        min-height: calc(var(--crm-shell-header-height) + var(--safe-area-top, 0px));
        height: calc(var(--crm-shell-header-height) + var(--safe-area-top, 0px));
        padding-top: var(--safe-area-top, 0px);
        box-sizing: border-box;
    }

    .crm-shell-header-brand,
    .crm-shell-header-main {
        min-height: var(--crm-shell-header-height);
    }
}
