/* ===== Globální styly ===== */
body {
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    background: #f5f6f8;
    margin: 40px;
    color: #2d2d2d;
}

h1 {
    font-weight: 600;
    color: #1f2937;
}

/* ===== Tlačítka ===== */
.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
    min-width: 90px;
    line-height: 1.2;
    height: 40px /* menší výška pro základní tlačítka */
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* varianty */
.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #ef4444;
    color: white;
}

.btn-secondary:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid #9ca3af;
    color: #374151;
}

.btn-outline:hover {
    background: #374151;
    color: white;
}

btn-edit,
btn-delete {
    height: 34px;
    width: 34px;
}

btn-cancel {
    height: 34px;
}

.btn-logout,
.btn-update {
    height: 40px; /* stejná výška jako input */
    padding: 0 18px; /* srovnaný text na střed */
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}


.btn-logout {
    background-color: #e0e0e0;
    color: #333;
}

.btn-logout:hover {
    background-color: #d5d5d5;
    transform: translateY(-1px);
}

.btn-logout:active {
    background-color: #c9c9c9;
    transform: translateY(0);
}

.btn-login {
    background-color: #e0e0e0;
    color: #333;
    margin-top: 6px;
}

.btn-login:hover {
    background-color: #d5d5d5;
    transform: translateY(-1px);
}

.btn-login:active {
    background-color: #c9c9c9;
    transform: translateY(0);
}

/* Update zelený */
.btn-update {
    background-color: #d6f5d6;
    color: #2d6a2d;
}

.btn-update:hover {
    background-color: #c2eac2;
    transform: translateY(-1px);
}

.btn-update:active {
    background-color: #b3e0b3;
    transform: translateY(0);
}

.btn:disabled,
.btn:disabled:hover {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
    transform: none;
}

.btn-add-row {
    margin-top: 20px;
}

/* ===== Inputy ===== */
input[type="text"],
input[type="password"] {
    width: 100%;
    /*padding: 10px 12px;*/
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    height: 36px; /* sjednocená výška */
    text-align: center;
}

input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.searchDiv{
    width: 25%;
}
/* ===== Hlavička stránky ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

    .header h1 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
        color: #333;
    }

.header-actions {
    display: flex;
    gap: 10px;
}

/* ===== Tabulka firem ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

thead {
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f9fafb;
}

.actions {
    display: flex;
    gap: 8px;
}

/* prázdný (neaktivní) řádek */
tr.inactive {
    color: #9ca3af;
}

    tr.inactive input {
        background: #f3f4f6;
        color: #9ca3af;
        pointer-events: auto;
    }

/* ===== Zvýraznění ===== */
.highlight-row {
    background-color: #fff5f5 !important;
    border-left: 4px solid #dc2626;
}

.highlight-cell {
    background-color: #ffe4e6 !important;
    border-radius: 4px;
    font-weight: 600;
    color: #b91c1c;
}

/* ===== Přihlašovací stránka ===== */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.login-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    width: 320px;
    text-align: center;
}

    .login-card h1 {
        font-size: 22px;
        margin-bottom: 25px;
    }

/* ===== Hlásky ===== */
.alert-error {
    background-color: #ffecec;
    border: 1px solid #ffb3b3;
    color: #a94442;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.95rem;
}

.alert-success {
    background-color: #e8f9ee;
    border: 1px solid #b3e6c1;
    color: #2d7a42;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.95rem;
}

/* ===== Stránka Aktualizace ===== */
.update-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.update-card {
    text-align: center;
    padding: 24px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    min-width: 280px;
}

    .update-card h1 {
        margin: 0 0 10px 0;
        font-size: 20px;
        font-weight: 600;
        color: #1f2937;
    }

.update-timer {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* skrytý text pro čtečky */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,1px,1px);
    white-space: nowrap;
    border: 0;
}

/* ===== Sekce Filtr ===== */
.filter-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

    .filter-card h2 {
        margin-top: 0;
        font-size: 1.2rem;
        margin-bottom: 15px;
        color: #1f2937;
    }

.filter-section {
    margin-bottom: 15px;
}

    .filter-section p {
        margin: 0 0 8px;
        font-weight: 500;
        color: #374151;
    }

/* Grid pro možnosti */
.filter-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

    .filter-options label,
    .filter-toggle label {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 10px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #f9fafb;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 14px;
    }

    .filter-options input[type="checkbox"],
    .filter-toggle input[type="checkbox"] {
        accent-color: #2563eb;
    }

    .filter-options label:hover,
    .filter-toggle label:hover {
        background: #f3f4f6;
    }


.filter-toggle {
    display: flex;
    gap: 10px;
}

    /* ===== Toggle styl pro filtry ===== */
    .filter-options label,
    .filter-toggle label {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 8px 12px;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #f9fafb;
        cursor: pointer;
        font-size: 14px;
        transition: all 0.2s ease;
        user-select: none;
    }

    .filter-options input,
    .filter-toggle input {
        display: none; /* schováme checkbox */
    }

    .filter-options span,
    .filter-toggle span {
        pointer-events: none; /* kliká se na celé tlačítko */
    }

    /* Hover efekt */
    .filter-options label:hover,
    .filter-toggle label:hover {
        background: #f3f4f6;
    }

    /* Aktivní stav */
    /* Aktivní stav – jen změna barvy */
    .filter-options label input:checked + span + label,
    .filter-toggle label input:checked + span + label {
        background: #e5e7eb;
        color: white;
        font-weight: 600;
        border-radius: 6px;
    }

.filter-options label {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    background: #fff;
}


.filter-options input:checked + span::before {
    content: ""; /* jen hack aby byl selektor použitý */
}

    /* Základní styl labelu */
.filter-options label,
.filter-toggle label {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Hover efekt */
.filter-options label:hover,
.filter-toggle label:hover {
  background: #f3f4f6;
}

/* Skryj samotné inputy */
.filter-options input,
.filter-toggle input {
  display: none;
}

.edit-row td {
    background: #f9fafb;
    padding: 16px;
}

.edit-buildings h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 600;
}

.filter-section input[type="text"], .filter-card input[type="text"] {
    width: 10rem;
}
label:has([type="checkbox"]:checked) {
    background: #d6f5d6;
}

label:has([type="radio"]:checked) {
    background: #d6f5d6;
}

/* Schování sloupců Budovy (6) a Typ (7) */
#companyTable th:nth-child(7),
#companyTable td:nth-child(7),
#companyTable th:nth-child(8),
#companyTable td:nth-child(8) {
    display: none;
}
