/* JSDH Portal – UI 2025 */

/* =============== GLOBAL ================== */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body.jsdh-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    background: radial-gradient(circle at top, #243b55 0%, #141e30 45%, #050810 100%);
    color: #f8f9fa;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: hidden;
}

/* =============== TOPBAR ================== */

.jsdh-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(to bottom, #d10000 0%, #9e0000 60%, #8e0000 100%);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

.jsdh-logo {
    height: 48px;
    margin-right: 12px;
}

.jsdh-title {
    font-size: 1.32rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.jsdh-subtitle {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
}

.jsdh-user-name {
    font-size: 1rem;
    font-weight: 600;
}

/* =============== MAIN LAYOUT ============= */

.jsdh-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;       /* zabraňuje přetékání */
}

/* Sidebar */
.jsdh-sidebar {
    width: 230px;
    flex-shrink: 0;
    background: rgba(3, 10, 22, 0.96);
    padding: 1rem 0.75rem;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
}

.jsdh-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
}

.jsdh-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.75rem;
    border-radius: 0.45rem;
    color: #d0d5dd;
    text-decoration: none;
    font-size: 0.93rem;
    transition: 0.15s ease;
}

.jsdh-sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.jsdh-sidebar-emoji {
    width: 1.4rem;
    text-align: center;
}

.jsdh-sidebar-logout {
    margin-top: auto;
    opacity: 0.85;
}

/* Content */
.jsdh-main {
    flex: 1 1 auto;
    padding: 1.5rem;
    overflow-y: auto;   /* JEDINÝ scroll */
    overflow-x: hidden;
    position: relative;
    z-index: 20;
}

/* Footer */
.jsdh-footer {
    text-align: center;
    padding: 12px;
    color: rgba(255,255,255,0.6);
    background: transparent;
    font-size: 0.9rem;
    position: relative;
    z-index: 5;
}

/* =============== CARDS & TABLES ========== */

.card {
    border-radius: 1rem;
    background: rgba(12, 20, 38, 0.92);
    border: 1px solid rgba(255,255,255,0.07);
    color: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.card-title {
    font-weight: 600;
}

.table {
    font-size: 0.9rem;
    color: #ffffff;
}

.table-dark.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255,255,255,0.03);
}

.table-dark.table-striped tbody tr:nth-of-type(even) {
    background: rgba(255,255,255,0.06);
}

.table td,
.table th {
    vertical-align: middle;
}

/* =============== FORMS ==================== */

.form-control,
.form-select {
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.25);
    color: #ffffff;
}

.form-control:focus,
.form-select:focus {
    background: rgba(0,0,0,0.45);
    color: #ffffff;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 0 0.2rem rgba(99,102,241,0.35);
}

/* =============== BUTTONS ================== */

.btn-primary {
    background: linear-gradient(135deg, #ff512f, #dd2476);
    border: none;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: #c62828;
    border: none;
}

.btn-danger:hover {
    filter: brightness(1.2);
}

/* aby akční tlačítka byla vždy klikací */
table a,
table button {
    position: relative;
    z-index: 1000;
    pointer-events: auto !important;
}

/* =============== RYCHLÁ VOLBA SMĚNY ====== */

.shift-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shift-option input[type="radio"] {
    display: none;
}

.shift-box {
    background: #202020;
    border: 2px solid #444;
    padding: 10px 15px;
    border-radius: 8px;
    transition: 0.2s ease;
}

.shift-option input[type="radio"]:checked + .shift-box {
    border-color: #d9534f;
    background: #2b2b2b;
    box-shadow: 0 0 10px rgba(217,83,79,0.55);
}

/* =============== RESPONSIVE ============== */

@media (max-width: 768px) {
    .jsdh-layout {
        flex-direction: column;
    }

    .jsdh-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .jsdh-sidebar-nav {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .jsdh-sidebar-logout {
        margin-top: 0;
        margin-left: auto;
    }
}

/* =============== MODAL FIX ============== */

.modal,
.modal * {
    pointer-events: auto !important;
}

.modal-backdrop {
    position: fixed !important;
    z-index: 4000 !important;
}

.modal {
    position: fixed !important;
    z-index: 5000 !important;
}

.jsdh-main {
    z-index: auto !important;
    overflow: visible !important;
}

/* ===========================================
   MEMBERS – čistá, stabilní, přehledná tabulka
   =========================================== */

.table-jsdh {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #e5e7eb;
}

.table-jsdh thead th {
    background: #1f273a;
    color: #ffffff;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid #2f3a52;
    white-space: nowrap;
}

.table-jsdh tbody tr {
    background: #263044;
    transition: 0.15s ease;
}

.table-jsdh tbody tr:nth-child(even) {
    background: #2a3550;
}

.table-jsdh tbody tr:hover {
    background: #32415c;
}

.table-jsdh td {
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
}

/* Email + telefon */
.member-email,
.member-phone {
    font-size: 12px;
    opacity: 0.85;
    margin: 2px 0;
}

/* Funkce */
.badge-funkce {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-funkce-velitel {
    background: rgba(250,204,21,0.18);
    color: #facc15;
}

.badge-funkce-strojnik {
    background: rgba(56,189,248,0.18);
    color: #7dd3fc;
}

.badge-funkce-hasic {
    background: rgba(248,113,113,0.18);
    color: #fca5a5;
}

/* Role systému */
.badge-role {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-role-admin {
    background: rgba(248,113,113,0.2);
    color: #fecaca;
}

.badge-role-vj {
    background: rgba(74,222,128,0.2);
    color: #bbf7d0;
}

.badge-role-user {
    background: rgba(148,163,184,0.25);
    color: #e5e7eb;
}

/* Telegram indikátor */
.telegram-dot {
    font-size: 11px;
    margin-right: 5px;
}

.telegram-dot.on {
    color: #4ade80;
}

.telegram-dot.off {
    color: #f87171;
}

/* Odkazy na QR / Upravit */
.btn-action-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.btn-action-link:hover {
    text-decoration: underline;
}
input.form-control:disabled,
input.form-control[disabled] {
    color: #000000 !important;
    background-color: #f0f0f0 !important; /* aby černá byla čitelná */
    opacity: 1 !important;
}

/* ===================== LOGIN PAGE ===================== */

body.login-wrapper {
    background: radial-gradient(circle at top, #243b55 0%, #141e30 45%, #050810 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    color: #ffffff;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    text-align: center;
}

.login-logo img {
    width: 80px;
    margin-bottom: 20px;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #ffffff;
}

.login-subtitle {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-bottom: 18px;
}

.login-error {
    background: rgba(255, 0, 0, 0.25);
    border-left: 4px solid #ff4d4d;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #ffb3b3;
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 14px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    font-size: 1rem;
    outline: none;
}

.login-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

.btn-login {
    width: 100%;
    p
