/* --- Import přátelského fontu z Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;900&display=swap');

/* --- Základní styly a reset --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    padding: 20px;
}

/* --- Téma pozadí pro profil.php --- */
body.theme-bg {
    background: linear-gradient(to bottom, #a0d2eb, #e5eaf5);
    position: relative;
    overflow-x: hidden;
}

body.theme-bg::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23b3d9a0" fill-opacity="1" d="M0,224L48,208C96,192,192,160,288,165.3C384,171,480,213,576,240C672,267,768,277,864,256C960,235,1056,181,1152,160C1248,139,1344,149,1392,154.7L1440,160L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom center;
    background-size: cover;
    z-index: 0;
}

/* --- Hlavní kontejner --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

h1 {
    color: #2c5282;
    margin-bottom: 20px;
    text-align: center;
}

.sekce h2, .sekce h3 {
    color: #2c5282;
    margin-bottom: 20px;
    text-align: left;
}

hr { border: none; border-top: 1px solid #e0e7ee; margin: 30px 0; }

/* --- Styly pro zprávy (úspěch/chyba) --- */
.zprava { padding: 15px; border-radius: 8px; margin-bottom: 20px; text-align: center; }
.uspech { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.chyba { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Formuláře a tlačítka --- */
input, select, textarea, button, .button {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-size: 1em;
    width: 100%;
}

button, .button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

button:hover, .button:hover {
    background-color: #2980b9;
}

.button-smazat {
    background-color: #e74c3c;
}

.button-smazat:hover {
    background-color: #c0392b;
}

.button-small {
    padding: 8px 12px;
    font-size: 0.9em;
}

.header-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.header-buttons .button {
    width: auto;
    flex-grow: 1;
}

/* --- Tabulka --- */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e7ee;
    vertical-align: middle;
}
th {
    background-color: #f0f4f8;
    color: #6a7f9a;
    font-weight: 700;
}
tbody tr:nth-child(even) {
    background-color: #f9fafb;
}
.radka-zvyraznena {
    background-color: #fffbe6 !important;
    border-left: 5px solid #f6ad55;
}

/* =========================================== */
/* === STYLY PRO PROFIL.PHP (STRÁNKA DÍTĚTE) === */
/* =========================================== */
.header {
    text-align: center;
    border-bottom: 2px solid #e0e7ee;
    padding-bottom: 15px;
    position: relative;
}
.header h1 { font-size: 2.5em; font-weight: 900; }
.header p { color: #6a7f9a; font-size: 1.1em; }

.prehled {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}
.stat-box {
    background-color: #ffffff;
    border: 2px solid #e0e7ee;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(44, 82, 130, 0.1);
}
.stat-box h2 { font-size: 1.2em; color: #6a7f9a; border: none; font-weight: 700; text-align: center; }
.points { font-size: 3.5em; font-weight: 900; color: #f6ad55; line-height: 1; }

.progress-bar-container {
    width: 100%;
    background-color: #e0e7ee;
    border-radius: 10px;
    height: 25px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background-color: #f6ad55;
    transition: width 0.5s ease-in-out, background-color 0.5s ease-in-out;
}
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 700;
    font-size: 0.9em;
    text-shadow: 0 0 3px rgba(255,255,255,0.7);
    white-space: nowrap;
}

/* =========================================== */
/* === STYLY PRO ADMIN.PHP (ADMINISTRACE) ==== */
/* =========================================== */
.sekce {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #fdfdff;
    border-radius: 12px;
    border: 1px solid #e0e7ee;
    overflow: hidden;
}

.admin-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 992px) {
    .admin-wrapper {
        grid-template-columns: 1fr 1fr;
    }
    .sekce-full-width {
        grid-column: 1 / -1;
    }
}

/* Styly pro různé formulářové gridy */
.form-grid,
.form-grid-dite,
.form-grid-odmena,
.form-grid-odznak,
.form-grid-nastenka,
.form-grid-prirazeni {
    display: grid;
    gap: 15px;
    align-items: center;
}
.form-grid { grid-template-columns: 1fr auto; }
.form-grid-dite .skener-wrapper { display: flex; gap: 10px; }

/* Dvousloupcové rozvržení pro stránku přidávání bodů */
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}
@media (max-width: 600px) {
    .form-row-grid {
        grid-template-columns: 1fr;
    }
}
.hidden-textarea {
    display: none;
    margin-top: 10px;
}
.form-skupina label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #333;
}
/* ... zbytek vašich existujících stylů ... */
.form-grid { grid-template-columns: 1fr auto; }
.form-grid-dite .skener-wrapper { display: flex; gap: 10px; }
.seznam-kodu { display: flex; flex-wrap: wrap; gap: 5px 10px; background-color: #eef2f7; padding: 10px; border-radius: 8px; margin-top: 15px; }
.seznam-kodu span { background-color: #fff; padding: 2px 6px; border-radius: 4px; font-family: monospace; border: 1px solid #d1dce8; overflow-wrap: break-word; word-break: break-all; }

/* Styly pro dvousloupcové rozložení na mobilu */
@media (min-width: 400px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}


/* Dvousloupcové rozvržení pro stránku přidávání bodů */
.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}
@media (max-width: 600px) {
    .form-row-grid {
        grid-template-columns: 1fr;
    }
}
.hidden-textarea {
    display: none;
    margin-top: 10px;
}


/* =========================================== */
/* ======== SYSTÉM ZÁLOŽEK A ZPRÁV =========== */
/* =========================================== */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #e0e7ee;
    margin-bottom: 20px;
    justify-content: space-around;
}
.tab-link {
    padding: 12px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1.5em;
    font-family: 'Nunito', sans-serif;
    color: #6a7f9a;
    font-weight: 700;
    position: relative;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    flex-grow: 1;
    text-align: center;
}
.tab-link.active {
    color: #2c5282;
    border-bottom-color: #3498db;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Notifikace */
.notifikace-tecka {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background-color: #e74c3c;
    border-radius: 50%;
    animation: puls 1.5s infinite;
}
@keyframes puls { 0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); } 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }}
.notifikace-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat */
.chat-wrapper { display: flex; border: 1px solid #e0e7ee; border-radius: 12px; overflow: hidden; min-height: 60vh; flex-direction: column; }
.chat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e0e7ee; background-color: #f9fafb; }
.chat-sidebar ul { list-style: none; padding: 0; margin: 0; display: flex; overflow-x: auto; }
.chat-sidebar li { flex-shrink: 0; }
.chat-sidebar li a { display: block; padding: 15px; text-decoration: none; color: #333; border-right: 1px solid #e0e7ee; position: relative; white-space: nowrap; }
.chat-sidebar li.active a, .chat-sidebar li a:hover { background-color: #e5eaf5; }
.neprecteno-badge { background-color: #e74c3c; color: white; font-size: 0.8em; padding: 2px 7px; border-radius: 10px; margin-left: 8px; }
.chat-main { flex-grow: 1; display: flex; flex-direction: column; }
.chat-box { flex-grow: 1; padding: 20px; overflow-y: auto; background-color: #fdfdff; }
.zprava-bublina { max-width: 80%; padding: 10px 15px; border-radius: 18px; margin-bottom: 10px; clear: both; }
.zprava-bublina.odeslana { background-color: #3498db; color: white; float: right; border-bottom-right-radius: 4px; }
.zprava-bublina.prijata { background-color: #e0e7ee; color: #333; float: left; border-bottom-left-radius: 4px; }
.cas-zpravy { font-size: 0.75em; color: #666; display: block; margin-top: 5px; text-align: right; }
.zprava-bublina.odeslana .cas-zpravy { color: #f1f1f1; }
.chat-form { display: flex; border-top: 1px solid #e0e7ee; padding: 10px; }
.chat-form textarea { flex-grow: 1; resize: none; height: 50px; }
.chat-form button { margin-left: 10px; width: auto; }

@media (min-width: 768px) {
    .chat-wrapper { flex-direction: row; }
    .chat-sidebar { width: 250px; border-right: 1px solid #e0e7ee; border-bottom: none; }
    .chat-sidebar ul { display: block; }
    .chat-sidebar li a { border-right: none; border-bottom: 1px solid #e0e7ee; }
    .neprecteno-badge { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); margin-left: 0; }
}


/* =========================================== */
/* ===== JEDNOTNÁ RESPONZIVITA PRO MOBIL ===== */
/* =========================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px 20px;
    }

    h1 {
        font-size: 1.8em;
    }
    
    .header h1 {
        font-size: 2.2em;
    }
    
/* Styly pro hromadné přidávání bodů */
.hromadne-body-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.hromadne-body-item {
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hromadne-body-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hromadne-body-item-header input[type="checkbox"] {
    width: auto;
}
.hromadne-body-item-header label {
    font-weight: bold;
    margin: 0;
}
.body-inputs {
    display: flex;
    gap: 10px;
}
.mobile-input {
    flex: 1;
}    

    /* Všechny formulářové gridy budou pod sebou */
    .form-grid,
    .form-grid-dite,
    .form-grid-odmena,
    .form-grid-odznak,
    .form-grid-nastenka,
    .form-grid-prirazeni,
    .form-grid-odznak {
        grid-template-columns: 1fr;
    }
    
    .form-grid-setkani-detail {
        grid-template-columns: 1fr !important;
    }

    /* Zajištění, aby prvky skeneru byly pod sebou a plně široké */
    .skener-wrapper {
        flex-direction: column;
    }
    
    /* Zmenšení ikon v záložkách profilu pro úsporu místa */
    .tab-link {
        font-size: 1.3em;
        padding: 10px;
    }
    
    .admin-tab-link {
        font-size: 1.2em;
        padding: 12px 8px;
    }

    /* ======================================= */
    /* === RESPONZIVNÍ STYLY PRO TABULKY === */
    /* ======================================= */
    .table-responsive {
        border: 0;
    }
    
    .table-responsive thead {
        display: none;
    }

    /* Většina tabulek dostane tento styl */
    .table-responsive tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e7ee;
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid #f0f4f8;
        padding: 10px 0;
    }
    .table-responsive td:last-child {
        border-bottom: none;
    }
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: bold;
        text-align: left;
        padding-right: 15px;
        color: #2c5282;
    }
    
    /* Zjednodušená tabulka pro hromadné body na mobilu */
    #tab-body .table-responsive tr {
        display: block;
        padding: 0;
        border: none;
        margin-bottom: 10px;
    }
    
    #tab-body .table-responsive tr td {
        display: block;
        text-align: left;
        padding: 8px;
        border-bottom: none;
    }
    
    #tab-body .table-responsive tr td.body-input-row {
        padding-left: 30px; /* Odsazení pro lepší přehlednost */
    }
    
    #tab-body .table-responsive tr td::before {
        content: none;
    }
    
    #tab-body .body-inputs {
        display: flex;
        gap: 10px;
    }
    #tab-body .mobile-input {
        width: 100%;
        box-sizing: border-box;
    }


    /* Výjimka pro specifické tabulky, kde chceme klasické zobrazení */
    #historie .table-responsive thead,
    .odmeny-wrapper .table-responsive thead,
    .nastenka-admin-item .table-responsive thead,
    .odznaky-wrapper .table-responsive thead {
        display: table-header-group;
    }
    #historie .table-responsive tr,
    .odmeny-wrapper .table-responsive tr,
    .nastenka-admin-item .table-responsive tr,
    .odznaky-wrapper .table-responsive tr {
        display: table-row;
        margin-bottom: 0;
        border: none;
        padding: 0;
        box-shadow: none;
    }
    #historie .table-responsive td,
    .odmeny-wrapper .table-responsive td,
    .nastenka-admin-item .table-responsive td,
    .odznaky-wrapper .table-responsive td {
        display: table-cell;
        text-align: left;
        border-bottom: 1px solid #e0e7ee;
        padding: 12px;
    }
     #historie .table-responsive td::before,
    .odmeny-wrapper .table-responsive td::before,
    .nastenka-admin-item .table-responsive td::before,
    .odznaky-wrapper .table-responsive td::before {
        content: none;
    }
    
    /* Vlastní nastavení pro tabulku žebříčku */
    #tabulka-deti thead {
        display: none;
    }
    #tabulka-deti tr {
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        grid-template-areas: 
            "misto jmeno body heslo"
            "akce  akce  akce akce";
        gap: 5px 15px;
        align-items: center;
        border-bottom: 1px solid #e0e7ee;
        padding: 10px 0;
        margin-bottom: 0;
        box-shadow: none;
        border-radius: 0;
    }
    #tabulka-deti tr:last-child {
        border-bottom: none;
    }
    #tabulka-deti td::before {
        display: none;
    }
    #tabulka-deti td {
        display: flex;
        padding: 5px 0;
        border: none;
        background-color: transparent !important;
    }
    #tabulka-deti td[data-label="Místo"] { grid-area: misto; font-weight: bold; }
    #tabulka-deti td[data-label="Jméno"] { grid-area: jmeno; }
    #tabulka-deti td[data-label="Body"] { grid-area: body; font-weight: bold; color: #3498db; }
    #tabulka-deti td[data-label="Heslo"] { grid-area: heslo; justify-content: center; }
    #tabulka-deti td[data-label="Akce"] { grid-area: akce; justify-content: center; padding-top: 10px; }
    #tabulka-deti td[data-label="QR Kód"] {
        display: none;
    }
}
/* =========================================== */
/* --- Konec responzivních stylů pro mobil --- */
/* =========================================== */

/* --- Nástěnka --- */
.nastenka-zprava {
    background-color: #fdfdff;
    border: 1px solid #e0e7ee;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.nastenka-zprava h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c5282;
    font-size: 1.3em;
}

.nastenka-zprava p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.nastenka-info {
    font-size: 0.9em;
    color: #6a7f9a;
    text-align: right;
    border-top: 1px solid #eef2f7;
    padding-top: 10px;
    margin-top: 15px;
}

/* =========================================== */
/* === STYLY PRO NÁSTĚNKU (PROFIL DÍTĚTE) ==== */
/* =========================================== */

.nastenka-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nastenka-prispevek {
    background-color: #ffffff;
    border: 1px solid #e0e7ee;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.nastenka-prispevek:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.nastenka-prispevek h4 {
    color: #2c5282;
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.nastenka-prispevek small {
    color: #6a7f9a;
    font-size: 0.85em;
    margin-bottom: 15px;
    display: block;
}

.nastenka-prispevek p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}

.odznaky-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    padding-top: 20px;
    justify-content: center;
}

/* ================================================= */

/* ======================================================== */
/* === DEFINITIVNÍ OPRAVA PRO ODKAZY STYLOVANÉ JAKO TLAČÍTKA === */

/* Cíl: Všechny odkazy (<a>), které mají být tlačítkem */
a.button, a.button-smazat {
    display: inline-block;
    text-align: center !important;
    text-decoration: none !important;
    color: white !important;
    vertical-align: middle;
    line-height: 1.5;
}

/* Cíl: Specificky řešíme problém "navštívených" odkazů */
a.button:link,
a.button:visited,
a.button-smazat:link,
a.button-smazat:visited {
    color: white !important;
    text-decoration: none !important;
}

/* ======================================================== */

/* 1. Hlavní kontejner pro akce v tabulce */
.td-akce {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 2. Jednotný styl pro VŠECHNA kulatá tlačítka s ikonou */
a.button-icon,
button.button-icon {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 50%;
    flex-shrink: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

/* 3. Zajištění, aby formulář pro smazání nepřekážel */
.td-akce form {
    margin: 0;
    padding: 0;
    line-height: 0;
}

/* ======================================================== */
/* === STYLY PRO STRÁNKU PŘIDÁNÍ BODŮ (pridat_body.php) === */
/* ======================================================== */

.sprava-bodu-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* Kontejner, který drží dva formulářové prvky vedle sebe */
.form-sekce-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* Pravidlo, které aktivuje dva sloupce pro zařízení s šířkou 400px a více */
@media (min-width: 400px) {
    .form-sekce-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Styly pro formulářové skupiny */
.form-skupina {
    margin-bottom: 0;
}

.form-skupina label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #333;
    font-size: 0.9em;
}

/* Vzhled polí s body */
.point-input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.point-input-wrapper input[type="number"] {
    text-align: center;
    font-size: 1.5em; /* Zmenšený font */
    font-weight: bold;
    border: 2px solid #ccc;
    pointer-events: none;
    background-color: #f9f9f9;
    width: 60px; /* Zmenšená šířka */
    height: 40px; /* Zmenšená výška */
    border-radius: 8px;
}

.point-btn-group {
    display: flex;
    flex-direction: column;
    margin-left: 0;
}

.point-btn {
    width: 35px; /* Zmenšená šířka tlačítek */
    height: 20px; /* Zmenšená výška tlačítek */
    font-size: 1em; /* Zmenšený font */
    font-weight: bold;
    border: 2px solid #ccc;
    color: #555;
    background-color: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: background-color 0.2s, transform 0.1s;
}

/* Na desktopu se zobrazí dva sloupce pro oba hlavní kontejnery */
@media (min-width: 992px) {
    .sprava-bodu-wrapper {
        grid-template-columns: 1fr 1.5fr;
    }
}

/* =========================================== */
/* === ADMINISTRACE - SYSTÉM ZÁLOŽEK (MOBIL) === */
/* =========================================== */

.admin-tab-nav {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.admin-tab-nav::-webkit-scrollbar {
    display: none;
}

.admin-tab-nav {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.admin-tab-link {
    padding: 12px 15px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1.5em;
    color: #6a7f9a;
    position: relative;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-bottom-color 0.3s;
    flex-grow: 1;
    text-align: center;
}

.admin-tab-link.active {
    color: #2c5282;
    border-bottom-color: #3498db;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* ======================================================== */
/* === STYLY PRO KLIKACÍ ODZNAK ODMĚNY A TOOLTIP (MOBIL) === */
.odmena-info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    vertical-align: middle;
    margin-left: 8px;
    padding: 0;
}

.tooltip-popup {
    position: absolute;
    background-color: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: 'Nunito', sans-serif;
    z-index: 1000;
    width: max-content;
    max-width: 220px;
    text-align: center;
    display: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tooltip-popup.active {
    display: block;
}

/* Styly pro jednotlivé odměny na profilu */
.odmena-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e0e7ee;
    margin-bottom: 20px; /* Zde je klíčová úprava pro mezeru */
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.odmena-item h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #2c5282;
}

.odmena-info p {
    margin-bottom: 10px;
    color: #555;
}

.odmena-info small {
    display: block;
    color: #6a7f9a;
}

/* =========================================== */
/* === STYLY PRO NÁSTĚNKU V ADMINISTRACI   ==== */
.nastenka-admin-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e7ee;
}
.nastenka-admin-list .nastenka-admin-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.nastenka-admin-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.nastenka-admin-actions .button,
.nastenka-admin-actions .button-smazat {
    width: auto;
}

.form-grid-nastenka textarea {
    min-height: 120px;
    resize: vertical;
}

.sekce.warning-today-points {
    border: 3px solid #e74c3c;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    position: relative;
    margin-top: 20px;
}

.sekce.warning-today-points::before {
    content: "POZOR: Dítě již dnes body obdrželo!";
    display: block;
    background-color: #e74c3c;
    color: white;
    padding: 10px;
    margin: -17px -17px 15px -17px;
    font-weight: bold;
    text-align: center;
    border-radius: 6px 6px 0 0;
}

.sorting-controls {
    margin-bottom: 15px;
    font-size: 16px;
}

.sorting-controls a {
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 10px;
    color: #3498db;
    border: 1px solid #3498db;
}

.sorting-controls a.active {
    background-color: #3498db;
    color: white;
    font-weight: bold;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.stat-box {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #3498db;
}
.stat-label {
    font-size: 1em;
    color: #555;
    margin-top: 5px;
}

.filter-controls {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-controls span {
    font-weight: bold;
    color: #555;
    margin-right: 5px;
}

.filter-controls a {
    text-decoration: none;
    color: #3498db;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease-in-out;
}

.filter-controls a:hover {
    background-color: #f1f1f1;
    border-color: #ccc;
}

.filter-controls a.active {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
    font-weight: bold;
}

.seznam-ctenaru {
    margin-top: 10px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    font-size: 0.9em;
}
.seznam-ctenaru strong {
    color: #333;
}
.seznam-ctenaru small {
    color: #555;
}

/* Zvýraznění řádku v logu, pokud skenoval admin */
.log-admin-scan {
    background-color: #e8f4fd;
}

.odznak-nahled {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.form-grid-setkani-detail {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}
.form-grid-setkani-detail .form-polozka {
    display: flex;
    flex-direction: column;
}
.form-grid-setkani-detail .form-polozka.plna-sirka {
    grid-column: 1 / -1;
}
.form-grid-setkani-detail label {
    margin-bottom: 5px;
    font-weight: bold;
}

/* Styly pro novou záložku Akce */
.akce-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.akce-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.akce-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #34495e;
}

.akce-item p {
    margin: 10px 0 0;
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
}

.akce-termin {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.akce-termin i {
    color: #3498db;
}

.upozorneni-udalosti {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.seznam-udalosti {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.udalost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.udalost-item strong {
    font-weight: 600;
    color: #333;
}

.udalost-item small {
    color: #555;
    font-weight: bold;
}

/* Styl pro proběhlé události */
.udalost-item.probehle {
    opacity: 0.65;
    background-color: #f1f3f5;
    border-left-color: #adb5bd;
}

.udalost-item.probehle strong {
    text-decoration: line-through;
}

.skener-wrapper { display: flex; gap: 10px; }

.info-dnes, .info-zitra, .info-tyden {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    margin-right: 8px;
}

.info-dnes {
    background-color: #e74c3c;
}

.info-zitra {
    background-color: #f39c12;
}

.info-tyden {
    background-color: #3498db;
}

/* === NOVÉ STYLY PRO IKONY V HLAVIČCE PROFILU === */
.header-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f4f8;
    border-radius: 10px;
}

.notifikace-ikona {
    font-size: 1.8em;
    color: #6a7f9a;
    cursor: pointer;
}

.form-grid-setkani-detail input[type="date"],
.form-grid-setkani-detail input[type="time"] {
    width: auto;
    display: inline-block;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f4f8;
}

.login-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
}

.login-container h1 {
    margin-bottom: 25px;
}

.login-container form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.login-container form input {
    margin-bottom: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.top-performers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.performer-item {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
}

.performer-rank {
    font-size: 1.5em;
    margin-right: 15px;
}

.performer-name {
    flex-grow: 1;
    font-weight: bold;
}

.performer-points {
    font-weight: bold;
    font-size: 1.1em;
    color: #27ae60;
}

/* Kontejner, který drží dva formulářové prvky vedle sebe */
.flex-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 15px; /* Mezera mezi prvky */
  margin-bottom: 15px;
}

/* Nastavení šířky pro každou skupinu, aby se vešly dvě vedle sebe */
.flex-wrapper .form-skupina {
  flex: 0 0 calc(50% - 15px / 2); /* 50% šířky minus polovina mezery, pro přesné zarovnání */
}

/* Media query pro mobilní telefony - prvky se zobrazí pod sebou */
@media (max-width: 600px) {
  .flex-wrapper .form-skupina {
    flex: 0 0 100%; /* Na mobilu zaberou 100 % šířky */
  }
}

/* Zajištění funkčního posouvání u textových polí */
textarea {
    resize: vertical; /* Umožňuje vertikální roztahování */
    overflow-y: auto; /* Zobrazí posuvník jen, když je potřeba */
    min-height: 120px; /* Zajistí minimální výšku */
    max-height: 300px; /* Omezí maximální výšku */
}

/* ============================================= */
/* Styly pro modální okno (Zobrazit přihlášené) */
/* ============================================= */

.modal-overlay {
    /* Překryje celou obrazovku */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);

    /* Centrování obsahu (vertikálně i horizontálně) */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Zajistí, že bude vždy navrchu */
    z-index: 1000;

    /* Přidáme přechod pro plynulejší zobrazení */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* Skrytý stav, který budeme ovládat JavaScriptem */
.modal-overlay:not([style*="display: flex"]) {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 8px;
    
    /* Responzivita pro mobily */
    width: 90%;
    max-width: 500px;
    
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    
    /* Přidáme animaci pro "vyskočení" */
    transform: scale(1);
    transition: transform 0.2s ease-in-out;
}

.modal-overlay:not([style*="display: flex"]) .modal-content {
    transform: scale(0.9);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}

.modal-close:hover {
    color: #000;
}

#modal-seznam-prihlasenych ol {
    list-style-type: decimal;
    padding-left: 20px;
    margin-top: 15px;
}

#modal-seznam-prihlasenych li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

#modal-seznam-prihlasenych li:last-child {
    border-bottom: none;
}

/* Zvýraznění řádků s poznámkou v historii bodů */
.radek-s-poznamkou {
    cursor: pointer;
    position: relative;
}

.radek-s-poznamkou:hover {
    background-color: #f9f9f9; /* Nebo jiná barva pro zvýraznění */
}

/* Styl pro malou ikonu poznámky */
.info-ikona {
    margin-left: 8px;
    color: #3498db;
    font-size: 0.9em;
    opacity: 0.7;
}

.form-grid-editace-dite {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
.form-grid-editace-dite fieldset {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}
.form-grid-editace-dite legend {
    padding: 0 10px;
    font-weight: bold;
    color: #555;
}

.info-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    color: #3498db;
    cursor: pointer;
}
.dynamic-tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 1000;
    width: 300px;
    font-size: 0.9em;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none; /* Důležité, aby tooltip nepřekážel myši */
}

.dynamic-tooltip a {
    color: #8ab4f8; /* lépe viditelná modrá na tmavém pozadí */
    text-decoration: none;
}

.dynamic-tooltip a:hover {
    text-decoration: underline;
}

.dynamic-tooltip strong {
    color: #fff;
}

.info-box {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}
.info-box h4 {
    margin-top: 0;
    color: #333;
}
.info-box p {
    margin: 5px 0;
    line-height: 1.4;
}
.info-box a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.nastenka-obsah img,
.nastenka-admin-item .nastenka-obsah img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
}