/* Základný reset a štýl stránky */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: #f0f2f5;
    color: #333;
}

/* Kontajner obklopujúci celú aplikáciu.
 * Flexbox rozdeľuje záložky a obsah vertikálne.
 * Používa minimálnu výšku, aby pozadie pokrývalo celú stránku bez pevnej výšky. */
.container {
    max-width: 1250px;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    /* Odstránená pevná výška – kontajner sa prispôsobí obsahu.
       Pridávame minimálnu výšku pre plné zakrytie pozadia na stránke. */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 30px;
    font-size: 2.2em;
}

h2 {
    color: #0056b3;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 30px;
}

/* Záložkový panel */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    justify-content: space-between;
    width: 100%;
}

.tab-button {
    padding: 10px 18px;
    background: #e9ecef;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.95em;
    color: #555;
    transition: background-color 0.3s ease;
    flex: 1 1 160px; /* rovnomerné rozloženie tlačidiel */
    text-align: center;
}

.tab-button:hover {
    background: #dcdfe3;
}

.tab-button.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* Obal pre obsah záložiek – zaberá zvyšnú výšku kontajnera a je rolovateľný */
.content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    padding-top: 10px;
    margin-top: -10px;
}

/* Všeobecný štýl obsahu záložiek */
.tab-content {
    display: none;
    background: white;
    padding: 10px 30px 30px 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

input:not([type="checkbox"]),
select:not([multiple]),
textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 5px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.9em;
}

/* Multi-select box pre konateľov */
#konatelPodpis {
    height: auto;
    min-height: 80px;
}

/* Akčné tlačidlá */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.action-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

/* Doplňujúce farby tlačidiel – používame vlastné triedy namiesto inline štýlov */
.btn-amber {
    background: #ffc107;
    color: #333;
}
.btn-amber:hover {
    background: #e0a800;
}
.btn-blue {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.btn-blue:hover {
    background: #0056b3;
}
.btn-grey {
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.btn-grey:hover {
    background: #565e64;
}
.btn-red {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.btn-red:hover {
    background: #c82333;
}

.remove-row {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.remove-row:hover {
    background: #c82333;
}

.add-row {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}
.add-row:hover {
    background: #0056b3;
}

/* Tabuľky v aplikácii */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

th,
td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: left;
    vertical-align: middle;
    font-size: 0.85em;
    word-wrap: break-word;
}

th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

/* Súhrnné informácie pod tabuľkou */
.summary {
    margin-top: 15px;
    font-weight: 600;
    font-size: 0.95em;
    background: #eaf6ff;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

/* Akcie pod tabuľkou nových osôb (Pridať + Načítať) */
.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.table-actions button {
    flex: none;
}

/* Kontajner pre tlačidlo Pokračovať */
.continue-container {
    margin-top: 20px;
    text-align: right;
}

/* Login overlay a modal */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal {
    background: #fff;
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 420px;
    text-align: center;
}

/* Responzívny dizajn pre menšie obrazovky */
@media (max-width: 768px) {
    .container {
        height: auto;
        max-width: 100%;
        margin: 10px;
        padding: 10px;
    }
    .tabs {
        flex-wrap: wrap;
    }
    table {
        display: block;
        overflow-x: auto;
    }
    th,
    td {
        min-width: 120px;
    }
}

/* Tooltips a drobné vysvetlivky */
.small-info {
    font-size: 0.85em;
    margin-top: -10px;
    color: #555;
}

/* Vizuálna skupina pre výber konateľov na podpis */
.konatel-select-group {
    margin-top: 25px;
}
.konatel-select-group label {
    margin-top: 0;
}
.konatel-select-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.9em;
    min-height: 120px;
}
.konatel-select-group p {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 0.85em;
    color: #555;
}

/* Rolovanie pre prehľad, ak je obrazovka malá */
#prehlad {
    overflow-x: auto;
}

/* Skrytie textarey vlastnej formulácie pre spôsob konania, zobrazí sa cez JS pri výbere C */
#sposobKonaniaText {
    display: none;
}

/* Oddeľovacie prvky v dynamických sekciách */
.dynamic-section {
    margin-top: 25px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
}

/* Sekcie uznesení a upozornení */
.uznesenie-body {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid #eee;
}

/* Archív – tabuľka v archíve má menšie písmo pre lepšiu prehľadnosť */
#archivTable th,
#archivTable td {
    font-size: 0.9em;
}

/* Zjednotený vzhľad akčných tlačidiel v archíve */
.archiv-actions .btn-load,
.archiv-actions .btn-delete {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.archiv-actions .btn-load {
    background: #007bff;
}
.archiv-actions .btn-load:hover {
    background: #0056b3;
}
.archiv-actions .btn-delete {
    background: #dc3545;
}
.archiv-actions .btn-delete:hover {
    background: #c82333;
}