/* ==========================================================================
   JROpava.css - UNIVERZÁLNÍ MODERNÍ STYL (MDPO Design)
   Plně napojeno na CSS proměnné z modern.css
   ========================================================================== */

/* --- 0. TÉMA MĚSTA (Lze jednoduše měnit v jiných souborech) --- */
:root {
    --primary: #E3001B; /* Opava červená */
    --accent: #c20017; /* Opava tmavší hover */
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --text: #333333;
}

/* --- 1. ZÁKLADNÍ NASTAVENÍ A TYPOGRAFIE --- */
* {
    box-sizing: border-box;
}

body, div, table, td, th, a, span, input, select, button {
    font-family: "Open Sans", "Segoe UI", 'Inter', Roboto, Helvetica, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 10px;
    font-size: 14px;
}

/* --- 2. HLAVNÍ NAVIGAČNÍ MENU A ZÁLOŽKY --- */
#secondary-nav {
    margin: 0 0 20px 0;
    padding: 0;
    z-index: 100;
}

    #secondary-nav ul {
        display: flex;
        flex-wrap: wrap;
        list-style: none;
        padding: 0;
        margin: 0;
        background: var(--card-bg);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        overflow: hidden;
        border: 1px solid #e0e0e0;
    }

    #secondary-nav li {
        display: block;
        margin: 0;
        border-right: 1px solid #f0f0f0;
    }

        #secondary-nav li:last-child {
            border-right: none;
        }

    #secondary-nav a {
        display: block;
        padding: 12px 25px;
        color: #555;
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    #secondary-nav li:hover a {
        background-color: #f8f9fa;
        color: var(--primary);
    }

    #secondary-nav li.active a, #secondary-nav li.active:hover a {
        background-color: var(--primary);
        color: #ffffff;
        font-weight: bold;
    }

/* Záložky uvnitř jr-container (modern-nav) */
.modern-nav {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    gap: 8px; /* Trochu větší mezera mezi záložkami */
    margin-bottom: 30px; /* Větší odstup od samotné karty */
    padding: 0;
    list-style: none;
    border-bottom: 4px solid #e2e8f0; /* Silnější a modernější spodní linka */
}

    .modern-nav li {
        margin-bottom: -3px;
    }

        .modern-nav li a {
            display: block;
            padding: 12px 20px;
            text-decoration: none;
            color: #666;
            font-weight: 700;
            border-bottom: 3px solid transparent;
            transition: all 0.2s ease;
            border-radius: 8px 8px 0 0;
        }

        .modern-nav li.active a {
            color: var(--primary);
            border-bottom-color: var(--primary);
            background: var(--card-bg);
        }

        .modern-nav li a:hover:not(.active) {
            color: var(--primary);
            background: #f9f9f9;
            border-bottom-color: #ddd;
        }

/* --- 3. HLAVNÍ OBALY A KONTEJNERY --- */
.jr-container {
    width: 100%;
    max-width: 100%; /* Zrušení původního limitu 900px */
    margin: 0 auto;
    padding: 15px;
    font-family: sans-serif;
    box-sizing: border-box; /* Zaručí, že padding nevyteče z okna */
}

/* --- BĚŽNÉ OBSAHOVÉ BLOKY (Zachován původní vzhled) --- */
.content_div {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    padding: 20px;
    width: 100%;
    margin-bottom: 20px;
    display: block;
}

/* --- RÁM OKOLO SAMOTNÉHO JÍZDNÍHO ŘÁDU --- */
.div_pozadikomplex {
    background: var(--card-bg, #ffffff) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08) !important;
    border: 2px solid var(--primary) !important;
    padding: 20px !important;
    /* Rám obepne jen obsah a vycentruje se */
    width: fit-content !important;
    max-width: 100% !important;
    margin: 15px auto !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
}

/* Úprava rámu pro mobily */
@media (max-width: 768px) {
    .div_pozadikomplex {
        padding: 10px !important;
        border-width: 1px !important;
        width: 100% !important; /* Na úzkém mobilu ať využije celou šířku */
    }
}

.modern-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #f0f0f0;
    /* NOVĚ PŘIDÁNO: Využití plné šířky */
    width: 100%;
    box-sizing: border-box;
    display: block; /* Ujistí se, že se chová jako standardní blokový element */
}

/* --- 4. FORMULÁŘE, VÝBĚRY A COMBOBOXY --- */
.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.form-label, .label {
    flex: 0 0 140px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.div_vyber_combo, .div_vyber {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

div.vyber {
    width: 100%;
    cursor: pointer;
    padding: 10px 0;
}

    div.vyber a {
        display: block;
        text-decoration: none;
        color: var(--text);
        font-weight: bold;
        width: 100%;
        outline: none;
    }

select.vyber, input.vyber, .vyber_combo {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: var(--card-bg);
    font-weight: bold;
    color: var(--text);
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

    select.vyber:focus, input.vyber:focus, .vyber_combo:focus {
        border-color: var(--primary);
        box-shadow: 0 0 5px rgba(227,0,27,0.2);
    }

.custom-input-wrapper {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: var(--card-bg);
    padding: 0 15px;
    box-sizing: border-box;
    transition: all 0.2s;
}

    .custom-input-wrapper:focus-within {
        border-color: var(--primary);
        box-shadow: 0 0 5px rgba(227,0,27,0.2);
    }

    .custom-input-wrapper i {
        color: var(--primary);
        margin-right: 10px;
        font-size: 16px;
        pointer-events: none;
    }

    .custom-input-wrapper .vyber {
        border: none;
        background: transparent;
        padding: 0;
        min-height: 40px;
        display: flex;
        align-items: center;
        box-shadow: none;
    }

        .custom-input-wrapper .vyber a {
            display: block;
            padding: 10px 0;
            line-height: 20px;
        }

input.custom-time-input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 15px;
    font-weight: bold;
    color: var(--text);
    padding: 10px 0;
}

.group {
    margin-bottom: 15px;
}

.div_separator, .separator {
    margin: 15px 0;
    border-top: 1px solid #eee;
    height: 1px;
}

/* --- 5. HLAVIČKY A NÁZVY LINEK --- */
div.div_header_linka {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
}

a.a_nazev_linky, a.a_nazev_linky:hover {
    font-size: 48px;
    font-weight: 800;
    text-decoration: none;
    margin: 0 15px 0 0;
    color: var(--primary);
    line-height: 1;
}

a.a_nazev_linky1, a.a_nazev_linky1:hover {
    font-size: 32px;
    font-weight: 700;
    text-decoration: none;
    margin: 0 15px 0 0;
    color: var(--primary);
}

div.div_header_smer {
    margin-top: 10px;
    margin-bottom: 15px;
}

a.a_smer_linky_label, a.a_smer_linky_label:hover {
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

a.a_smer_linky, a.a_smer_linky:hover {
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

/* --- 6. IKONY DOPRAVY --- */
div.div_logo_doprava_T, div.div_logo_doprava_O, div.div_logo_doprava_A {
    width: 60px;
    height: 50px;
    float: left;
    margin-right: 15px;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
}

div.div_logo_doprava_T {
    background-image: url(image/autobus.png);
}

div.div_logo_doprava_O {
    background-image: url(image/trolejbus.png);
}

div.div_logo_doprava_A {
    background-image: url(image/tramvaj.png);
}

/* --- 7. TABULKY ODJEZDŮ A ZASTÁVEK --- */
table.t_in, table.table_JR1, table.tablejr1, table.table_time_JR {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

table, tr, td {
    border: none;
    vertical-align: middle;
}

    table.t_in td {
        padding: 6px 10px;
    }

    table.table_time_JR tr {
        height: 35px;
        border-bottom: 1px solid #f0f0f0;
    }

    td.cell_zastavky_zastavka_suda_focused, td.cell_zastavky_zastavka_licha_focused {
        font-weight: 700;
        color: var(--primary);
        background-color: #fff4f4;
        padding: 6px 10px;
    }

    td.cell_zastavky_zastavka_suda, td.cell_zastavky_zastavka_licha {
        padding: 6px 10px;
        color: var(--text);
        transition: color 0.2s;
        cursor: pointer;
    }

        td.cell_zastavky_zastavka_suda:hover, td.cell_zastavky_zastavka_licha:hover {
            color: var(--primary);
        }

    td.cell_zastavky_zastavka_suda_disabled, td.cell_zastavky_zastavka_licha_disabled {
        color: #aaa;
        padding: 6px 10px;
        cursor: default;
    }

/* --- 8. TABULKA ČASŮ (Samotný Jízdní řád) --- */
div.div_header_jr {
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 10px;
}

a.a_header_jr {
    color: var(--text);
    font-size: 16px;
}

td.cell_hour_jr {
    font-size: 18px;
    font-weight: 700;
    padding: 5px 15px;
    background: #f8f9fa;
    color: var(--primary);
    text-align: right;
    border-right: 2px solid #e0e0e0;
    width: 1%;
}

a.a_hour_jr {
    color: var(--primary);
}

td.cell_time_jr_licha, td.cell_time_jr_suda {
    background-color: var(--card-bg);
    border-bottom: 1px solid #f0f0f0;
    padding: 5px 10px;
}

tr.licha, tr.suda, tr.licha_jr, tr.suda_jr {
    background: var(--card-bg);
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

    tr.licha:hover, tr.suda:hover, tr.licha_jr:hover, tr.suda_jr:hover {
        background: #fafafa;
    }

a.a_time_jr, a.a_time_jr_disabled, a.a_time_jr_separator {
    font-size: 16px;
    color: var(--text);
    font-weight: 600;
    padding: 4px 8px;
    display: inline-block;
    border-radius: 4px;
    transition: all 0.2s;
}

    a.a_time_jr:hover {
        background-color: var(--primary);
        color: #ffffff !important;
        text-decoration: none;
        cursor: pointer;
    }

a.a_time_jr_active, td #time_jr_active {
    font-weight: 800;
    background-color: var(--primary);
    color: #ffffff;
    border-radius: 4px;
    padding: 4px 8px;
}

a.a_pozn {
    font-size: 11px;
    color: #666;
    vertical-align: super;
    margin-left: 1px;
    font-weight: bold;
    cursor: pointer;
}

div.div_FS, div.div_separ {
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
    padding-top: 10px;
}

/* --- 9. MAPY A OSTATNÍ PLOVOUCÍ OKNA --- */
.div_ram, .div_ram_nobackground, .td_ram_nobackground, .div_ram_nobackgroundtransparent {
    border-radius: 4px;
    border: none;
    background: #f8f9fa;
    padding: 8px;
    margin-top: 5px;
    color: var(--text);
}

.movediv {
    background-color: var(--text);
    border-radius: 8px 8px 0 0;
    height: 35px;
    padding: 5px 10px;
    cursor: move;
}

.firstHeading {
    text-align: left;
    color: var(--primary);
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 10px;
}

.a_linka {
    cursor: pointer;
    color: var(--text);
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

    .a_linka:hover {
        background-color: var(--primary);
        color: #fff;
    }

#divRoute {
    width: 100%;
    margin-top: 20px;
    position: relative;
}

#divJR {
    width: 100%;
    margin-top: 20px;
}

/* --- TLAČÍTKA --- */
.btn-primary, .formButton, button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-primary:hover, .formButton:hover, button:hover {
        background-color: var(--accent);
        transform: translateY(-1px);
    }

.btn-secondary {
    background: #555;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

    .btn-secondary:hover {
        background: #333;
    }

.btn-outline {
    background: #f8f9fa;
    color: #444;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .btn-outline:hover {
        background: #e9ecef;
        border-color: #ccc;
    }

.btn-swap {
    background: var(--card-bg);
    color: #555;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 10px 0 10px 155px;
}

    .btn-swap:hover {
        background: #f0f0f0;
        color: var(--primary);
    }

/* --- 10. MODERNÍ VYSKAKOVACÍ KALENDÁŘ --- */
.div_vyber_kalend {
    background: var(--card-bg);
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    height: 100%;
    font-size: 14px;
}

.ram_kalendar {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    display: inline-block;
    border-radius: 12px;
    border: 1px solid #eaeaea;
    text-align: center;
    background-color: var(--card-bg);
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 100000;
    width: 270px;
}

.table_kalendar {
    border-collapse: collapse;
    border: none;
    width: 100%;
}

.table_dny {
    border-collapse: collapse;
    border: none;
    margin: 10px 0px 0px 0px;
    width: 100%;
    table-layout: fixed;
}

.td_dny {
    padding: 5px 0;
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
    font-weight: bold;
    color: #888;
}

.days {
    height: 32px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    border-radius: 8px;
    color: #444;
    transition: all 0.2s ease;
}

    .days:hover {
        cursor: pointer;
        background-color: #f0f0f0;
        color: var(--primary);
        font-weight: bold;
    }

.today {
    height: 32px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    border-radius: 8px;
    background-color: var(--primary);
    color: #ffffff !important;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(227, 0, 27, 0.4);
    transition: all 0.2s ease;
}

    .today:hover {
        cursor: pointer;
        background-color: var(--accent);
    }

.div_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    background-color: #f8f9fa;
    color: var(--text);
    font-weight: bold;
    min-height: 28px;
    padding: 5px 10px;
    margin-bottom: 5px;
}

.div_prev, .div_next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background-color: transparent;
    background-image: none !important;
    height: 26px;
    width: 26px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .div_prev:hover, .div_next:hover {
        background-color: #e9ecef;
        background-image: none !important;
    }

    .div_prev::after {
        content: '';
        border: solid #555;
        border-width: 0 2px 2px 0;
        display: inline-block;
        padding: 4px;
        transform: rotate(135deg);
        margin-left: 4px;
    }

    .div_next::after {
        content: '';
        border: solid #555;
        border-width: 0 2px 2px 0;
        display: inline-block;
        padding: 4px;
        transform: rotate(-45deg);
        margin-right: 4px;
    }

.vyber_kalendar, .vyber_kalend {
    width: auto;
    border: 1px solid #ddd;
    background-color: var(--card-bg);
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-weight: bold;
}

    .vyber_kalendar:focus, .vyber_kalend:focus {
        border-color: var(--primary);
    }

.div_ram_den_old, .div_ram_den {
    border: none;
    background: transparent;
}

/* ==========================================================================
   Mobilní média - BEZPEČNÁ ÚPRAVA POUZE PRO MALÉ DISPLEJE
   ========================================================================== */
@media (max-width: 768px) {
    /* Zarovnání štítků, aby neblokovaly místo, ale zachovaly flex vlastnosti */
    .form-label, .label {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }

    /* Na mobilech zaberou inputy a wrappery 100% šířky přirozeně, bez agresivního flex-direction */
    select.vyber, input.vyber, .vyber_combo, .custom-input-wrapper {
        flex: 1 1 100%;
        min-width: 100%;
    }

    /* Tlačítka se přizpůsobí flexu sítě */
    .btn-outline, .btn-secondary, .btn-primary {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
        width: 100%;
        margin-top: 5px;
    }

    .btn-swap {
        margin: 10px 0;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Navigace umožňuje horizontální scrollování, pokud je příliš mnoho položek */
    /* Záložky uvnitř jr-container (modern-nav) */
    .modern-nav {
        display: flex;
        flex-wrap: wrap;
        width: 100%; /* NOVĚ PŘIDÁNO: Plná šířka kontejneru */
        box-sizing: border-box; /* NOVĚ PŘIDÁNO: Bezpečné počítání rozměrů */
        gap: 5px;
        margin-bottom: 25px;
        padding: 0;
        list-style: none;
        border-bottom: 3px solid #f0f0f0;
    }

        .modern-nav li {
            flex: 0 0 auto;
            text-align: center;
        }

            .modern-nav li a {
                padding: 10px 15px;
                font-size: 14px;
            }
}

/* ==========================================================================
   Mobilní média - BEZPEČNÁ ÚPRAVA POUZE PRO MALÉ DISPLEJE
   ========================================================================== */
@media (max-width: 768px) {
    /* Zarovnání štítků, aby neblokovaly místo, ale zachovaly flex vlastnosti */
    .form-label, .label {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }

    /* Na mobilech zaberou inputy a wrappery 100% šířky přirozeně, bez agresivního flex-direction */
    select.vyber, input.vyber, .vyber_combo, .custom-input-wrapper {
        flex: 1 1 100%;
        min-width: 100%;
    }

    /* Tlačítka se přizpůsobí flexu sítě */
    .btn-outline, .btn-secondary, .btn-primary {
        flex: 1 1 100%;
        text-align: center;
        justify-content: center;
        width: 100%;
        margin-top: 5px;
    }

    .btn-swap {
        margin: 10px 0;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Navigace umožňuje horizontální scrollování, pokud je příliš mnoho položek */
    .modern-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }

        .modern-nav li {
            flex: 0 0 auto;
            text-align: center;
        }

            .modern-nav li a {
                padding: 10px 15px;
                font-size: 14px;
            }
}
.div_pozadikomplex {
    padding: 10px !important;
    border-width: 1px !important;
    width: 100% !important; /* Na úzkém mobilu ať využije celou šířku */
}
/* ==========================================================================
   TISKOVÉ STYLY (@media print) - Tmavě šedé hlavičky, zachované bílé písmo a ikony
   ========================================================================== */
@media print {
    /* 1. ABSOLUTNÍ VYNUCENÍ POZADÍ A IKON DO TISKÁRNY */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    @page {
        size: landscape;
        margin: 10mm;
    }

    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 2. Skrytí ovládacích prvků */
    .modern-nav, .modern-card, .wclose, .fa-print,
    .fa-location-dot, .fa-right-left, .btn-swap,
    #divKalendar_select_datum {
        display: none !important;
    }

    /* 3. Hlavní rám JŘ - Tmavě šedý */
    .div_pozadikomplex {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        border: 2px solid #475569 !important; /* Tmavě šedá */
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    /* =========================================================
       4. PŘEBÍJENÍ INLINE STYLŮ (TMAVĚ ŠEDÁ MÍSTO ČERVENÉ)
       ========================================================= */

    /* HLAVNÍ HLAVIČKA (Linka 211) -> Tmavě šedé pozadí (bílé písmo zůstává) */
    #movediv {
        background: #475569 !important;
        background-color: #475569 !important;
    }

        /* Bílý čtvereček s ikonou v hlavičce -> Přebarvíme červenou ikonu na tmavě šedou */
        #movediv div[style*="background: white"] {
            color: #475569 !important;
            border: 1px solid #475569 !important;
        }

            #movediv div[style*="background: white"] * {
                color: #475569 !important;
            }

    /* NADPISY SLOUPCŮ (Pracovní dny...) -> O něco světlejší tmavě šedá (bílé písmo zůstává) */
    div[style*="background: var(--primary)"] {
        background: #64748b !important;
        background-color: #64748b !important;
        border: 1px solid #475569 !important;
    }

    /* =========================================================
       5. PŘITAŽENÍ FONTU S IKONAMI (FontAwesome) DO TISKU
       ========================================================= */
    .fa, .fa-solid, .fa-regular {
        font-family: 'Font Awesome 6 Free' !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        visibility: visible !important;
        display: inline-block !important;
    }

    /* 6. Zákaz trhání tabulek na dvě stránky */
    table, tr, td, th {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}