* {
    box-sizing: border-box;
    font-family: Verdana, Arial, Helvetica, sans-serif;
}

body {
    margin: 0;
    padding: 10px;
    background-color: #ffffff;
    color: #000000;
    font-size: 13px;
}

.klem-layout {
    display: flex;
    border: 1px solid #990033;
    min-height: 96vh;
}

/* LEVÝ PANEL */
.sidebar {
    width: 225px;
    min-width: 225px;
    border-right: 1px solid #990033;
    padding: 10px;
    background-color: #fafafa;
}

.sidebar-header-mobile {
    display: none;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #990033;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.sheet-title {
    font-size: 16px;
    font-weight: bold;
    color: #990033;
}

.nadpisk3 {
    font-size: 13px;
    color: #990033;
    margin-top: 6px;
    margin-bottom: 4px;
}

.nav-heading-link {
    color: #990033;
    text-decoration: none;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
}

.nav-heading-link:hover {
    text-decoration: underline;
    background-color: #f0f0f0;
}

.nav-heading-link.active-link {
    color: #ffffff !important;
    background-color: #990033 !important;
    text-decoration: none !important;
}

.nav-divider {
    border: 0;
    height: 1px;
    background-color: #990033;
    margin: 8px 0;
}

/* ROZBALOVACÍ POLOŽKY V MENU */
.nav-group {
    margin-bottom: 4px;
}

.tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    font-size: 13px;
    font-weight: bold;
    color: #111111;
    cursor: pointer;
    border-radius: 3px;
    user-select: none;
    transition: background-color 0.15s ease;
}

.tree-header:hover {
    background-color: #eee;
    color: #990033;
}

.tree-icon {
    display: inline-block;
    width: 14px;
    font-size: 14px;
    font-weight: bold;
    color: #990033;
}

.tree-title {
    flex: 1;
    margin-left: 4px;
}

.tree-arrow {
    font-size: 11px;
    color: #666666;
    transition: transform 0.2s ease;
}

.nav-group.open .tree-header {
    color: #990033;
}

.nav-group.open .tree-icon {
    font-size: 15px;
}

.nav-group.open .tree-arrow {
    transform: rotate(180deg);
}

.tree-subitems {
    display: none;
    padding-left: 18px;
    margin: 3px 0 6px 0;
}

.nav-group.open .tree-subitems {
    display: block;
}

.tree-subitems a {
    display: block;
    color: #003399;
    font-size: 12px;
    text-decoration: none;
    padding: 3px 6px;
    margin: 1px 0;
    border-radius: 3px;
}

.tree-subitems a:hover {
    color: #990033;
    background-color: #f0f0f0;
    text-decoration: underline;
}

.tree-subitems a.group-all-link {
    font-weight: normal;
    color: #555555;
    border-top: 1px dotted #d0d0d0;
    margin-top: 5px;
    padding-top: 4px;
    font-size: 11px;
}

.tree-subitems a.group-all-link:hover {
    color: #990033;
}

.tree-subitems a.active-link,
.uroven2r.active-link {
    color: #ffffff !important;
    background-color: #990033 !important;
    font-weight: bold;
    text-decoration: none !important;
}

.uroven2r {
    color: #990033;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
}

.uroven2r:hover {
    text-decoration: underline;
    background-color: #f0f0f0;
}

/* OBSAHOVÁ ČÁST */
.content-area {
    flex: 1;
    padding: 12px 18px;
    overflow-x: hidden;
}

.header-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.header-titles {
    flex: 1;
}

.nadpisk {
    font-size: 19px;
    color: #990033;
    margin: 0;
    font-weight: bold;
}

.header-titles .nadpisk3 {
    font-size: 15px;
    color: #000000;
    margin: 4px 0 0 0;
}

.active-filter-title {
    font-size: 12px;
    color: #666666;
    margin-top: 4px;
    font-style: italic;
}

.info-note {
    font-size: 11px;
    color: #555555;
    background: #fdfaf6;
    border-left: 3px solid #990033;
    padding: 6px 10px;
    margin-bottom: 14px;
}

.info-note-desktop { display: block; }
.info-note-mobile { display: none; }

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

table.dotabk {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

table.dotabk th {
    background-color: #f5f5f5;
    color: #000000;
    text-align: left;
    padding: 6px 8px;
    border-bottom: 2px solid #990033;
    font-weight: bold;
    white-space: nowrap;
}

table.dotabk th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

table.dotabk th.sortable:hover {
    background-color: #e8e8e8;
    color: #990033;
}

.sort-icon {
    display: inline-block;
    font-size: 10px;
    margin-left: 3px;
    color: #990033;
    width: 10px;
}

table.dotabk td {
    padding: 5px 8px;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}

table.dotabk tr:hover {
    background-color: #fbf6f7;
}

.col-evid { width: 50px; text-align: center; }
.col-pv { width: 65px; text-align: center; }
.col-kat { width: 140px; font-weight: bold; }
.col-datum { width: 115px; white-space: nowrap; }
.col-klub { width: 180px; }
.col-nazev { min-width: 220px; }
.col-misto { width: 160px; }

.evid-link {
    font-weight: bold;
    color: #003399;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding: 2px 4px;
}

.evid-link:hover {
    color: #990033;
    text-decoration: underline;
}

/* DVOUSLOTOVÁ MŘÍŽKA P / V */
.pv-slot-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.btn-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 3px;
    line-height: 1;
}

.btn-slot.btn-p {
    background-color: #0066cc;
    color: #ffffff;
    border: 1px solid #004d99;
    cursor: pointer;
}
.btn-slot.btn-p:hover { background-color: #004d99; }

.btn-slot.btn-v {
    background-color: #2e7d32;
    color: #ffffff;
    border: 1px solid #1b5e20;
    cursor: pointer;
}
.btn-slot.btn-v:hover { background-color: #1b5e20; }

.btn-slot.slot-empty {
    background-color: transparent;
    border: 1px solid transparent;
    visibility: hidden;
}

.no-results {
    padding: 25px;
    text-align: center;
    color: #777777;
    font-style: italic;
}

/* ==========================================================================
   MODÁL DETAILU - OPRAVA PRO MALÉ MOBILY A SCROLL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh; /* Dynamický viewport pro mobilní prohlížeče */
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.open { 
    display: flex; 
}

.modal-content {
    background: #ffffff;
    border-top: 4px solid #990033;
    border-radius: 4px;
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 14px 16px;
    margin: auto; /* Zajišťuje správné vertikální zarovnání i při přetečení */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dddddd;
    padding-bottom: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #990033;
    font-size: 16px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666666;
    padding: 2px 8px;
    line-height: 1;
}

.modal-close-btn:hover { color: #000000; }

/* Tělo modálu s nezávislým plynulým scrollem */
.modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    padding-right: 4px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.detail-table td {
    padding: 6px 4px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.detail-table td:first-child {
    font-weight: bold;
    width: 130px;
    color: #333333;
}

/* KONTEJNER: Číslo vlevo, ikonka sdílet ZCELA VPRAVO */
.evid-share-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.inline-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f2f2f2;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    width: 28px;
    height: 26px;
    color: #555555;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.inline-share-btn:hover {
    background-color: #990033;
    border-color: #990033;
    color: #ffffff;
}

.modal-actions {
    margin-top: 15px;
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.modal-btn.btn-p-full { background: #0066cc; }
.modal-btn.btn-v-full { background: #2e7d32; }

/* Toast notifikace pro schránku */
.copy-toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(30, 30, 30, 0.9);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-toast.show {
    opacity: 1;
}

/* MOBILNÍ LIŠTA: NETUČNÁ, BEZ KAPITÁLEK, S BÍLÝM OVÁLKEM VPRAVO */
.mobile-filter-bar {
    display: none;
    background-color: #ffffff;
    border-bottom: 2px solid #990033;
    padding: 6px 10px;
}

.btn-toggle-menu {
    width: 100%;
    height: 48px;
    background-color: #990033;
    color: #ffffff;
    border: none;
    padding: 0 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-sizing: border-box;
}

.filter-btn-left {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.filter-funnel-icon {
    flex-shrink: 0;
}

/* Netučný text, normální velikost písmen (žádné kapitálky) */
.filter-btn-text {
    font-size: 13px;
    font-weight: normal;
    line-height: 1.15;
    text-transform: none;
    letter-spacing: normal;
}

.filter-btn-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 50%;
}

/* Bílý oválek se zvolenou kategorií */
.filter-pill-badge {
    background-color: #ffffff;
    color: #990033;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    body { padding: 0; }
    .klem-layout { flex-direction: column; border: none; }
    .mobile-filter-bar { display: block; position: sticky; top: 0; z-index: 100; }
    
    .info-note-desktop { display: none; }
    .info-note-mobile { display: block; }

    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 1000;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.4);
        overflow-y: auto;
    }
    .sidebar.mobile-open { display: block; }
    .sidebar-header-mobile { display: flex; }
    .content-area { padding: 10px; }
    .header-box { flex-direction: column; text-align: center; gap: 8px; }

    table.dotabk thead { display: none; }
    table.dotabk, table.dotabk tbody, table.dotabk tr, table.dotabk td { display: block; width: 100%; }
    table.dotabk tr {
        border: 1px solid #dddddd;
        border-radius: 5px;
        margin-bottom: 10px;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        padding: 8px;
    }
    table.dotabk td { border: none; padding: 3px 0; }
    .row-card-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 5px;
        margin-bottom: 4px;
    }
    .card-datum { font-weight: bold; color: #990033; }
    .card-nazev { font-size: 13px; font-weight: bold; color: #111111; margin: 2px 0; }
    .card-meta { font-size: 11px; color: #555555; }
}

/* Červený text pro buňky tabulky a poznámku v detailu */
.text-red {
    color: #d9534f !important;
    font-weight: bold;
}

/* Celý zrušený řádek (písmeno 'z') */
.row-cancelled,
.row-cancelled td {
    color: #d9534f !important;
}
