/* ==========================================================================
   Jotto administrace - layout shell (sidebar na desktopu, horní lišta + spodní navigace na mobilu)
   Struktura převzatá z BDW_TasksMobileManager (bdw-shell.css), barvy z JottoTheme.cs:
   brandová oranžová #E24B19, --jotto-orange-fill (PrimaryDarken) je pozadí sidebaru, aby bílý text
   prošel kontrastem, --jotto-orange-ink je text na bílé aktivní položce.
   ========================================================================== */

:root {
    --jotto-orange: #e24b19;
    --jotto-orange-fill: #b93a11;
    --jotto-orange-ink: #8f2b0a;
    --jotto-orange-tint: #fbe7de;
    --jotto-bg: #f7f5f3;
    --jotto-border: #e3ded9;
    --jotto-ink: #2b2b2b;
    --jotto-muted: #5d5a57;
    --jotto-danger: #b3200a;
    --jotto-display: 'Bricolage Grotesque', 'Inter', 'Helvetica', 'Arial', sans-serif;
}

.jotto-shell {
    min-height: 100vh;
    display: flex;
    background: var(--jotto-bg);
    color: var(--jotto-ink);
}

.jotto-frame {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* --- Společné prvky ------------------------------------------------------ */

.jotto-shell a:focus-visible,
.jotto-shell button:focus-visible {
    outline: 2px solid var(--jotto-orange-fill);
    outline-offset: 2px;
}

.jotto-sidebar a:focus-visible,
.jotto-sidebar button:focus-visible,
.jotto-appbar a:focus-visible,
.jotto-appbar button:focus-visible {
    outline-color: #ffffff;
}

.jotto-shell .mud-icon-root {
    flex-shrink: 0;
}

/* --- Sidebar (jen desktop) ---------------------------------------------- */

.jotto-sidebar {
    display: none;
}

.jotto-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 12px 22px;
    color: #ffffff;
    text-decoration: none;
    font-family: var(--jotto-display);
    font-size: 22px;
    font-weight: 700;
}

    .jotto-sidebar-logo img {
        height: 36px;
        width: auto;
        display: block;
    }

.jotto-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jotto-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #ffffff;
    text-decoration: none;
    text-align: left;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

    .jotto-nav-item:hover {
        background: rgba(255, 255, 255, 0.14);
        color: #ffffff;
    }

    .jotto-nav-item.active {
        background: #ffffff;
        color: var(--jotto-orange-ink);
        font-weight: 700;
    }

.jotto-nav-label {
    flex-grow: 1;
}

.jotto-nav-chevron {
    flex: none;
    transition: transform 0.15s ease;
}

    .jotto-nav-chevron.is-open {
        transform: rotate(180deg);
    }

@media (prefers-reduced-motion: reduce) {
    .jotto-nav-chevron {
        transition: none;
    }
}

.jotto-nav-sub {
    margin: 0 0 4px 21px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.jotto-nav-subitem {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

    .jotto-nav-subitem:hover {
        background: rgba(255, 255, 255, 0.14);
        color: #ffffff;
    }

    .jotto-nav-subitem.active {
        background: #ffffff;
        color: var(--jotto-orange-ink);
        font-weight: 700;
    }

/* Odznak s počtem nevyřízených položek u podpoložky menu (např. Ukončení odběru). */
.jotto-nav-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    box-sizing: border-box;
    padding: 0 6px;
    border-radius: 10px;
    background: #ffffff;
    color: var(--jotto-orange-ink);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .jotto-nav-subitem.active .jotto-nav-badge {
        background: var(--jotto-orange-ink);
        color: #ffffff;
    }

.jotto-nav-divider {
    height: 1px;
    margin: 8px 12px;
    background: rgba(255, 255, 255, 0.26);
}

.jotto-sidebar-spacer {
    flex-grow: 1;
}

.jotto-sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.jotto-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px;
}

.jotto-user-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jotto-user-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.jotto-user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jotto-user-role {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jotto-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 10px;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

    .jotto-logout-btn:hover {
        background: rgba(255, 255, 255, 0.14);
    }

/* --- Horní lišta na mobilu ---------------------------------------------- */

.jotto-appbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    height: 56px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 16px;
    background: var(--jotto-orange-fill);
    color: #ffffff;
    font-family: var(--jotto-display);
    font-size: 20px;
    font-weight: 700;
}

.jotto-appbar-logo {
    height: 30px;
    width: auto;
    display: block;
}

.jotto-appbar-spacer {
    flex-grow: 1;
}

.jotto-avatar-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.jotto-avatar-ring {
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Horní lišta na desktopu -------------------------------------------- */

.jotto-topbar {
    display: none;
}

.jotto-topbar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid #d3cbc4;
    border-radius: 10px;
    background: #ffffff;
    color: var(--jotto-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

    .jotto-topbar-btn:hover {
        background: var(--jotto-bg);
    }

/* --- Obsah -------------------------------------------------------------- */

.jotto-content {
    flex: 1 0 auto;
    box-sizing: border-box;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* --- Spodní navigace na mobilu ------------------------------------------ */

.jotto-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    height: calc(72px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    display: flex;
    padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid var(--jotto-border);
}

.jotto-bn-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--jotto-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.jotto-bn-pill {
    width: 58px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jotto-bn-item.active {
    color: var(--jotto-orange-ink);
    font-weight: 700;
}

    .jotto-bn-item.active .jotto-bn-pill {
        background: var(--jotto-orange-tint);
    }

/* --- Spodní panel „Více“ na mobilu -------------------------------------- */

.jotto-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1250;
    padding: 0;
    border: 0;
    background: rgba(43, 43, 43, 0.55);
    cursor: default;
}

.jotto-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1251;
    max-height: 88vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: #ffffff;
    color: var(--jotto-ink);
    display: flex;
    flex-direction: column;
    animation: jotto-sheet-in 0.18s ease-out;
}

@keyframes jotto-sheet-in {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jotto-sheet {
        animation: none;
    }
}

.jotto-sheet-handle {
    align-self: center;
    width: 40px;
    height: 4px;
    margin-bottom: 14px;
    border-radius: 2px;
    background: #d3cbc4;
}

.jotto-sheet-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 4px 14px;
}

.jotto-sheet-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--jotto-orange-fill);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jotto-sheet-user-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.jotto-sheet-user-name {
    font-size: 17px;
    font-weight: 700;
}

.jotto-sheet-user-role {
    font-size: 14px;
    color: var(--jotto-muted);
}

.jotto-sheet-item {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    padding: 0 4px;
    border: 0;
    border-top: 1px solid var(--jotto-border);
    background: transparent;
    color: var(--jotto-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

    .jotto-sheet-item .mud-icon-root {
        color: var(--jotto-orange-ink);
    }

    .jotto-sheet-item.is-danger {
        color: var(--jotto-danger);
        font-weight: 600;
    }

        .jotto-sheet-item.is-danger .mud-icon-root {
            color: var(--jotto-danger);
        }

.jotto-sheet-item-label {
    flex-grow: 1;
}

/* --- Desktop ------------------------------------------------------------ */

@media (min-width: 960px) {
    .jotto-sidebar {
        display: flex;
        flex-direction: column;
        flex: 0 0 272px;
        width: 272px;
        height: 100vh;
        position: sticky;
        top: 0;
        box-sizing: border-box;
        padding: 22px 14px 16px;
        background: var(--jotto-orange-fill);
        color: #ffffff;
        overflow-y: auto;
    }

    .jotto-appbar,
    .jotto-bottomnav,
    .jotto-sheet,
    .jotto-sheet-overlay {
        display: none;
    }

    .jotto-topbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        height: 60px;
        flex-shrink: 0;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        padding: 0 32px;
        background: #ffffff;
        border-bottom: 1px solid var(--jotto-border);
    }

    .jotto-content {
        padding-bottom: 0;
    }
}

/* --- Zpětná vazba: plovoucí tlačítko a panel (ZpetnaVazbaTlacitko.razor) ---- */

.vazba-tlacitko {
    position: fixed;
    right: 1rem;
    bottom: 4.5rem; /* nad tlačítkem "Instalovat aplikaci" (app.css) v pravém dolním rohu */
    z-index: 1090;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: #ffffff;
    background: var(--jotto-orange-fill);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.vazba-tlacitko:hover { background: var(--jotto-orange-ink); }
.vazba-tlacitko:focus-visible { outline: 2px solid var(--jotto-orange-fill); outline-offset: 3px; }

.vazba-panel {
    position: fixed;
    right: 1rem;
    bottom: calc(4.5rem + 54px);
    z-index: 1090;
    width: min(400px, calc(100vw - 32px));
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
    border-radius: 18px;
    background: #ffffff;
    color: var(--jotto-ink);
    border: 1px solid var(--jotto-border);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

.vazba-panel h2 { margin: 0; font-family: var(--jotto-display); font-size: 1.25rem; }
.vazba-panel p { margin: 0; }
.vazba-panel label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }

.vazba-panel textarea {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--jotto-border);
    border-radius: 10px;
    resize: vertical;
}

.vazba-panel textarea:focus-visible { outline: 2px solid var(--jotto-orange-fill); outline-offset: 1px; }

.vazba-tlumene { font-size: 0.85rem; color: var(--jotto-muted); }
.vazba-chyba { padding: 10px 14px; border-radius: 10px; background: #fdecea; color: var(--jotto-danger); font-weight: 500; }
.vazba-radek, .vazba-snimek-radek { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.vazba-prepinac { display: inline-flex; align-self: flex-start; border: 1px solid var(--jotto-border); border-radius: 999px; overflow: hidden; }
.vazba-prepinac button { border: 0; background: transparent; padding: 6px 14px; font: inherit; cursor: pointer; color: var(--jotto-ink); }
.vazba-prepinac button[aria-pressed="true"] { background: var(--jotto-orange-fill); color: #ffffff; font-weight: 600; }

.vazba-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid var(--jotto-border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--jotto-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.vazba-btn.primarni { background: var(--jotto-orange-fill); border-color: var(--jotto-orange-fill); color: #ffffff; }
.vazba-btn:disabled { opacity: 0.5; cursor: default; }
.vazba-stitek { padding: 4px 12px; border-radius: 999px; background: var(--jotto-orange-tint); color: var(--jotto-orange-ink); font-weight: 600; font-size: 0.85rem; }

.snimek-tlacitko { position: relative; flex-direction: row !important; }
.snimek-tlacitko:focus-within { outline: 2px solid var(--jotto-orange-fill); outline-offset: 2px; }
.vazba-skryte { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* Na mobilu je dole spodní navigace (72px) a tlačítko "Instalovat aplikaci" (84px) - jen ikona, nad nimi. */
@media (max-width: 959px) {
    .vazba-tlacitko { bottom: calc(136px + env(safe-area-inset-bottom)); padding: 0 12px; }
    .vazba-tlacitko span { display: none; }
    .vazba-panel { bottom: calc(190px + env(safe-area-inset-bottom)); max-height: calc(100vh - 260px); }
}

@media print { .vazba-tlacitko, .vazba-panel { display: none !important; } }

/* --- Číslo verze (odkaz na Novinky) -------------------------------------- */

.jotto-version-link {
    align-self: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

    .jotto-version-link:hover {
        text-decoration: underline;
    }

.jotto-sheet-version {
    display: block;
    padding: 12px 4px 4px;
    text-align: center;
    font-size: 13px;
    color: var(--jotto-muted);
    text-decoration: none;
}
