:root {
    --bg-color: #0b0b0e;
    --surface-color: rgba(20, 20, 26, 0.75);
    --surface-hover: rgba(30, 30, 38, 0.85);
    --primary-color: #e53935; /* Fire Red */
    --primary-hover: #ff4a46;
    --secondary-color: #ff9800; /* Fire Orange */
    --text-main: #f5f5f7;
    --text-muted: #8e8e93;
    --success-color: #34c759;
    --danger-color: #ff3b30;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 20px rgba(229, 57, 53, 0.15);
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(229, 57, 53, 0.03), transparent 400px);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utils */
.hidden { display: none !important; }
.mobile-hidden { display: none !important; }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }

/* Typography */
h1, h2, h3 { font-weight: 600; margin-bottom: 1rem; letter-spacing: -0.02em; }
h1 { font-size: 2.2rem; color: var(--text-main); }
h2 { font-size: 1.6rem; color: var(--text-main); border-bottom: 2px solid rgba(255, 255, 255, 0.03); padding-bottom: 0.5rem; margin-bottom: 1.5rem; }

/* Buttons */
.btn {
    background-color: var(--surface-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px; /* Touch target minimum */
}

.btn:hover {
    background-color: #23232c;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #c62828);
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.35);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #f57c00);
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ffb74d, var(--secondary-color));
    transform: translateY(-1px);
}

.btn-sm {
    min-height: 38px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background-color: rgba(10, 10, 12, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    min-height: 50px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(15, 15, 20, 0.9);
    box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Login View */
#login-view {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 100vh;
    background: radial-gradient(circle at center, #16161e 0%, #08080a 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    background: rgba(20, 20, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.login-header {
    text-align: center;
    margin-bottom: 2.2rem;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
}

/* App View */
#app-view {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: rgba(20, 20, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.03em;
}

.nav-brand span {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.6rem 0.9rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item .material-symbols-rounded {
    font-size: 1.25rem;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background-color: rgba(229, 57, 53, 0.12);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.mobile-more-btn {
    display: none; /* Hidden by default on desktop */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.badge {
    background-color: var(--secondary-color);
    color: #000;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.admin {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(25, 25, 32, 0.6) 0%, rgba(20, 20, 26, 0.8) 100%);
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stat-value.positive { color: var(--success-color); }
.stat-value.negative { color: var(--danger-color); }

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-error {
    background-color: rgba(255, 59, 48, 0.08);
    border-left-color: var(--danger-color);
    color: #ffb3b0;
}

.alert-success {
    background-color: rgba(52, 199, 89, 0.08);
    border-left-color: var(--success-color);
    color: #b3ffc9;
}

/* Mobilní menu "Více" (drawer) a overlay */
.mobile-more-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1100;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

.mobile-more-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #121216;
    border-top: 1px solid var(--border-color);
    border-radius: 24px 24px 0 0;
    padding: 1.5rem;
    z-index: 1200;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.mobile-more-overlay.hidden {
    display: block !important;
    opacity: 0;
    pointer-events: none;
}

.mobile-more-menu.hidden {
    display: block !important;
    transform: translateY(100%);
}

.mobile-more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.mobile-more-header h3 {
    margin-bottom: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-close:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding-bottom: 1rem;
}

.mobile-more-grid .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    color: var(--text-main);
    width: 100%;
}

.mobile-more-grid .nav-item.active {
    background-color: rgba(229, 57, 53, 0.1);
    border-color: rgba(229, 57, 53, 0.3);
    color: var(--primary-color);
}

.mobile-more-grid .nav-item .material-symbols-rounded {
    font-size: 1.75rem;
}

.mobile-more-grid .nav-text {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0.6rem 1rem;
        height: 56px;
    }
    
    .nav-brand {
        font-size: 1.15rem;
    }

    .user-name {
        display: none;
    }

    #logout-btn {
        padding: 0;
        width: 36px;
        height: 36px;
        min-height: auto;
        border-radius: 50%;
    }

    #logout-btn .btn-text {
        display: none;
    }

    #logout-btn .material-symbols-rounded {
        margin: 0;
        font-size: 1.1rem;
    }
    
    /* Mobilní spodní navigační lišta */
    .nav-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(18, 18, 22, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        padding: 0.5rem 0.2rem;
        z-index: 1000;
        margin: 0;
        width: 100%;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
    }
    
    .nav-menu .nav-item {
        font-size: 0.65rem;
        padding: 0.3rem 0.1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        flex: 1 1 0;
        min-width: 0;
        border-radius: 8px;
        text-align: center;
        color: var(--text-muted);
    }

    .nav-menu .nav-item.active {
        background-color: transparent;
        color: var(--primary-color);
    }

    .nav-menu .nav-item .material-symbols-rounded {
        font-size: 1.4rem;
    }

    .nav-menu .nav-item.mobile-more-btn {
        display: flex; /* Zobrazí se na mobilu */
    }

    .main-content {
        padding: 1rem;
        padding-bottom: 85px; /* Místo pro spodní menu */
    }

    .grid-2, .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Zmenšení tabulek pro mobily */
    th, td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }

    /* Akční tlačítka v tabulce - zachovat vedle sebe a menší */
    td .btn, td button {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.75rem !important;
        margin-bottom: 0.2rem;
    }

    /* Všechna hlavní tlačítka roztažená přes celou šířku pro snadné klikání */
    form .btn {
        width: 100%;
        margin-top: 0.5rem;
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* Převod tabulek na karty na mobilu */
    .table-responsive table {
        display: block;
        border: none;
        margin-top: 0.5rem;
    }
    .table-responsive thead {
        display: none;
    }
    .table-responsive tbody {
        display: block;
    }
    .table-responsive tr {
        display: block;
        background-color: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-sm);
    }
    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.6rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-align: right;
        font-size: 0.9rem;
    }
    .table-responsive td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top: 0.8rem;
    }
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-align: left;
        margin-right: auto;
    }
}

/* Kalendář */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    min-width: 600px;
}

.calendar-day-head {
    background-color: var(--surface-hover);
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
}

.calendar-day {
    background-color: var(--surface-color);
    min-height: 90px;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-day.today {
    background-color: rgba(229, 57, 53, 0.05);
}

.calendar-day.empty {
    background-color: transparent;
}

.day-number {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: bold;
}

.cleaner-tag {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cleaner-tag .delete-btn {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.cleaner-tag .delete-btn:hover {
    background: rgba(0,0,0,0.4);
}

.reservation-tag {
    background-color: var(--secondary-color) !important;
    color: #000 !important;
    font-weight: 500;
}

/* Pagination */
.pagination-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pagination .page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.pagination .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
