/* =============================================
   Advenťácký portál – hlavní CSS
   ============================================= */

[x-cloak] { display: none !important; }

.hover-bg:hover { background-color: var(--bs-secondary-bg); cursor: pointer; }

:root {
    --sidebar-width: 240px;
    --navbar-height: 52px;
    --env-bar-height: 28px;
}

/* ENV lišta (zobrazena jen v non-prod prostředí) */
.env-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--env-bar-height);
    background: #ffc107;
    color: #000;
    font-size: .72rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1032; /* nad navbar (1030) */
    letter-spacing: .02em;
}
.has-env-bar .navbar.fixed-top          { top: var(--env-bar-height); }
.has-env-bar body,
.has-env-bar                            { padding-top: calc(var(--navbar-height) + var(--env-bar-height)); }
@media (min-width: 992px) {
    .has-env-bar .sidebar-wrapper       { top: calc(var(--navbar-height) + var(--env-bar-height)); height: calc(100vh - var(--navbar-height) - var(--env-bar-height)); }
}

/* Layout */

body {
    padding-top: var(--navbar-height);
    background: #f8f9fa;
}

/* Sidebar */

.sidebar-wrapper {
    width: var(--sidebar-width);
}

@media (min-width: 992px) {
    .sidebar-wrapper {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        z-index: 100;
        display: flex !important;
        flex-direction: column;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 1.5rem;
    }
}

@media (max-width: 991px) {
    .main-content {
        padding: 1rem;
    }
}

/* Sidebar navigace */

.sidebar-nav {
    padding: 0.25rem 0;
}

.sidebar-section {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #adb5bd;
    padding: 1rem 1rem 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1rem;
    color: #343a40;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.12s;
}

.sidebar-link:hover {
    background: #e9ecef;
    color: #0d6efd;
}

.sidebar-link.active {
    background: #e7f1ff;
    color: #0d6efd;
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
}

.sidebar-link-action {
    font-size: 0.82rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 1.6rem;
    color: #6c757d;
}

/* Vlastní Bootstrap badge barvy */
.bg-orange { background-color: #fd7e14 !important; }

/* Page header */

.page-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

/* Karty */

.card {
    border-radius: 0.5rem;
}

/* Tabulky */

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
}

/* Flash zprávy */

.alert {
    border-radius: 0.5rem;
}

/* Utility */

.text-muted-sm {
    color: #6c757d;
    font-size: 0.8rem;
}

.cursor-pointer {
    cursor: pointer;
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */

[data-bs-theme="dark"] body {
    background: #1a1d21;
}

/* bg-white ve kartách, sidebaru a offcanvasu musí ustoupit dark stylu.
   Používáme secondary-bg (#343a40) místo body-bg (#212529), aby card-header
   měl viditelné oddělení od těla karty. */
[data-bs-theme="dark"] .bg-white {
    background-color: var(--bs-secondary-bg) !important;
}

/* Sidebar */
[data-bs-theme="dark"] .sidebar-link {
    color: #ced4da;
}
[data-bs-theme="dark"] .sidebar-link:hover {
    background: #2b3035;
    color: #6ea8fe;
}
[data-bs-theme="dark"] .sidebar-link.active {
    background: #1c2a3e;
    color: #6ea8fe;
}
[data-bs-theme="dark"] .sidebar-section {
    color: #6c757d;
}

/* Page header */
[data-bs-theme="dark"] .page-header {
    border-color: #495057;
}
[data-bs-theme="dark"] .page-title {
    color: #f8f9fa;
}

/* Tabulky – Bootstrap přiřadí table-light v dark modu příliš tmavou hodnotu
   ($light z dark palety = #495057), záhlaví pak vypadá tmavší než řádky.
   Přebijeme na secondary-bg pro správnou hierarchii (header světlejší než tělo). */
[data-bs-theme="dark"] .table-light {
    --bs-table-color:        var(--bs-body-color);
    --bs-table-bg:           var(--bs-secondary-bg);
    --bs-table-border-color: var(--bs-border-color-translucent);
    --bs-table-hover-bg:     rgba(255, 255, 255, .05);
    --bs-table-active-bg:    var(--bs-secondary-bg);
}
[data-bs-theme="dark"] .table th {
    color: #adb5bd;
}

/* bg-light v dark módu → secondary-bg (jinak bílé pozadí + světlý text = nečitelné) */
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-body-color);
}

/* Stíny */
[data-bs-theme="dark"] .shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .45) !important;
}

