/* ==============================================================
   LEGLOG - CORE STYLES (FIMAK DESIGN)
============================================================== */

.leglog-app-wrap * { box-sizing: border-box; }
.leglog-app-wrap {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #e2e8f0;
    background-color: #0f172a !important;
    min-height: 100vh;
    padding-bottom: 80px;
    padding-top: 0px !important;
    margin-top: 0 !important;
}

.leglog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* iOS overscroll */
html {
    background-color: #020617 !important;
    overscroll-behavior: none;
}
body {
    background-color: #020617 !important;
}

/* ==============================================================
   TOPBAR
============================================================== */
.leglog-topbar {
    background-color: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.leglog-brand { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.leglog-brand span { color: #06b6d4; }

.leglog-topbar-actions { display: flex; gap: 15px; align-items: center; flex-wrap: nowrap; }

.leglog-user-info {
    border-left: 1px solid #334155;
    margin-left: 10px;
    padding-left: 25px;
    display: flex;
    gap: 20px;
    align-items: center;
    white-space: nowrap;
}

.leglog-username { font-size: 0.9rem; color: #94a3b8; }

/* TLAČÍTKA */
.leglog-btn {
    border: none;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}
.leglog-topbar-actions .leglog-btn { padding: 10px 18px !important; font-size: 0.95rem !important; white-space: nowrap; }
.leglog-btn-primary { background: linear-gradient(to right, #06b6d4, #3b82f6) !important; color: #fff !important; }
.leglog-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3); }
.leglog-btn-outline { background: transparent !important; border: 1px solid #334155 !important; color: #e2e8f0 !important; }
.leglog-btn-outline:hover { background: #334155 !important; color: #fff !important; }
.leglog-logout-btn {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
    text-decoration: none !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}
.leglog-logout-btn:hover { background: #ef4444 !important; color: #fff !important; }

@media (max-width: 768px) {
    .leglog-topbar { padding: 15px 20px; flex-direction: column; align-items: flex-start; }
    .leglog-topbar-actions { flex-direction: column; align-items: stretch; width: 100%; gap: 10px; }
    .leglog-topbar-actions .leglog-btn { width: 100%; }
    .leglog-user-info {
        border-left: none; border-top: 1px solid #334155;
        margin-left: 0; padding-left: 0; padding-top: 15px; margin-top: 5px;
        width: 100%; justify-content: space-between;
    }
}

/* ==============================================================
   ZÁLOŽKY
============================================================== */
.leglog-nav-tabs { background-color: #1e293b !important; border-bottom: 1px solid #334155 !important; padding-top: 15px; }
.leglog-tab-btn {
    background: transparent !important; border: none !important; color: #94a3b8 !important;
    font-size: 1rem !important; font-weight: 600 !important; padding: 10px 20px 15px 20px !important;
    cursor: pointer; border-bottom: 3px solid transparent !important; transition: all 0.2s;
}
.leglog-tab-btn:hover { color: #fff !important; }
.leglog-tab-btn.active { color: #06b6d4 !important; border-bottom: 3px solid #06b6d4 !important; }
.leglog-tab-content { display: none; }
.leglog-tab-content.active { display: block; animation: leglogFadeIn 0.3s ease; }
@keyframes leglogFadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ==============================================================
   OBSAH A KARTY
============================================================== */
.leglog-page-header { margin: 40px 0 30px 0; }
.leglog-title { font-size: 2.2rem !important; font-weight: 800 !important; color: #fff !important; margin: 0 0 8px 0 !important; padding: 0 !important; }
.leglog-subtitle { color: #94a3b8 !important; font-size: 1.05rem !important; margin: 0 !important; }

.leglog-card {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
}

/* ==============================================================
   TABULKY - OBECNÉ
============================================================== */
.leglog-card table, .leglog-card th, .leglog-card td {
    border-left: none !important; border-right: none !important; border-top: none !important;
}
.leglog-card thead tr { background-color: transparent !important; border-bottom: 2px solid #334155 !important; }
.leglog-card th { color: #cbd5e1 !important; font-weight: 600 !important; font-size: 0.95rem !important; padding: 16px 12px !important; }
.leglog-card tbody tr { border-bottom: 1px solid #1e293b !important; }
.leglog-card tbody tr:last-child { border-bottom: none !important; }
.leglog-card td { padding: 16px 12px !important; vertical-align: middle !important; }

/* ==============================================================
   TABULKA HODIN - MOBILE CARD LAYOUT
============================================================== */
@media (max-width: 768px) {

    /* Skryje thead - labely přebírají data-label */
    .leglog-hours-table thead {
        display: none !important;
    }

    /* Každý řádek = karta */
    .leglog-hours-table tbody tr {
        display: block !important;
        background: #0f172a !important;
        border: 1px solid #334155 !important;
        border-radius: 10px !important;
        margin-bottom: 12px !important;
        padding: 12px 14px !important;
    }

    /* Každá buňka = řádek label: hodnota */
    .leglog-hours-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        padding: 6px 0 !important;
        border: none !important;
        font-size: 0.9rem !important;
        gap: 10px;
        border-bottom: 1px solid rgba(51, 65, 85, 0.5) !important;
    }

    .leglog-hours-table td:last-child {
        border-bottom: none !important;
        padding-top: 10px !important;
    }

    /* Label vlevo */
    .leglog-hours-table td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        white-space: nowrap;
        flex-shrink: 0;
        padding-top: 2px;
    }

    /* Popis - přes celou šířku */
    .leglog-hours-table td[data-label="Popis"] {
        flex-direction: column !important;
        gap: 4px !important;
    }
    .leglog-hours-table td[data-label="Popis"]::before {
        margin-bottom: 2px;
    }

    /* Tlačítko Smazat - celá šířka */
    .leglog-hours-table td:last-child {
        justify-content: flex-end !important;
    }
    .leglog-hours-table .leglog-delete-hour {
        width: 100% !important;
        text-align: center !important;
        margin-top: 4px;
    }
}

/* ==============================================================
   MODÁLNÍ OKNA - PC
============================================================== */
.leglog-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(5px);
    overflow: auto;
    align-items: center;
    justify-content: center;
}

.leglog-modal-content {
    background-color: #1e293b !important;
    margin: 10vh auto;
    padding: 30px;
    border: 1px solid #334155;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: leglogModalPop 0.3s ease-out;
}

@keyframes leglogModalPop {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.leglog-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 15px; margin-bottom: 25px; }
.leglog-modal-header h2 { margin: 0; color: #fff; font-size: 1.4rem; }
.leglog-modal-close { color: #94a3b8; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; transition: 0.2s; }
.leglog-modal-close:hover { color: #f87171; }

.leglog-form .leglog-input-group { margin-bottom: 20px; }
.leglog-form .leglog-input-group label { color: #06b6d4; font-weight: 600; display: block; margin-bottom: 8px; }

.leglog-form select,
.leglog-form input[type="text"],
.leglog-form input[type="date"],
.leglog-form input[type="number"],
.leglog-form textarea {
    width: 100% !important;
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #fff !important;
    padding: 12px !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    box-sizing: border-box;
    outline: none;
    transition: 0.2s;
    box-shadow: none !important;
}

.leglog-form select:focus,
.leglog-form input:focus,
.leglog-form textarea:focus { border-color: #06b6d4 !important; box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15) !important; }

.leglog-form-actions { display: flex; justify-content: flex-end; gap: 15px; margin-top: 30px; }

/* ==============================================================
   MODÁLNÍ OKNA - MOBIL
============================================================== */
@media (max-width: 768px) {

    .leglog-modal[style*="flex"] {
        align-items: flex-end !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .leglog-modal-content {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 20px 16px 34px 16px !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
        animation: leglogModalSlideUp 0.3s ease-out !important;
    }

    @keyframes leglogModalSlideUp {
        from { opacity: 0; transform: translateY(60px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .leglog-form div[style*="display:flex"],
    .leglog-form div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
    }

    .leglog-form div[style*="flex: 1"] {
        margin-bottom: 20px !important;
    }

    .leglog-form-actions {
        flex-direction: column-reverse !important;
        gap: 10px !important;
        margin-top: 20px !important;
    }
    .leglog-form-actions .leglog-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 14px !important;
    }
}
