:root {
    --clr-bg: #F4F3F0;
    --clr-card: #FFFFFF;
    --clr-primary: #C69F7A;
    --clr-primary-dark: #A8815E;
    --clr-text: #373533;
    --clr-text-light: #7E7A75;
    --clr-border: #D1CEC6;
    --clr-danger: #e74c3c;
    --clr-success: #2ecc71;
    --font-main: 'Outfit', sans-serif;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: var(--clr-bg); color: var(--clr-text); line-height: 1.5; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.hl { color: var(--clr-primary); }

/* Login */
.admin-login-screen { display: flex; height: 100vh; align-items: center; justify-content: center; background: #2C2B2A; padding: 1rem; }
.login-card { background: white; padding: 2.5rem; border-radius: var(--radius); width: 100%; max-width: 400px; text-align: center; }
.login-card h2 { margin-bottom: 0.5rem; }
.login-card p { color: var(--clr-text-light); margin-bottom: 1.5rem; font-size: 0.95rem; }

/* Dashboard Header */
.admin-header { background: #2C2B2A; color: white; padding: 1rem 0; }
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.3rem; font-weight: 700; }

/* Fix logout button in dark header */
.admin-header .btn-outline {
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.4);
}
.admin-header .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
}

/* Tabs */
.admin-tabs { display: flex; gap: 0.5rem; margin: 1.5rem 0 1rem; border-bottom: 2px solid var(--clr-border); padding-bottom: 0.5rem; flex-wrap: wrap; }
.tab-btn { background: none; border: none; font-size: 0.95rem; font-weight: 600; padding: 0.6rem 1rem; cursor: pointer; color: var(--clr-text-light); border-radius: 6px; }
.tab-btn.active, .tab-btn:hover { color: var(--clr-primary); background: rgba(198, 159, 122, 0.1); }

.tab-content { display: none; margin-bottom: 3rem; }
.tab-content.active { display: block; }

.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

/* Form Controls */
.form-group { margin-bottom: 1.2rem; text-align: left; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.45rem; font-size: 0.92rem; color: #373533; }
.form-group input, .form-group textarea, .form-group select { 
    width: 100%; 
    padding: 0.8rem 1rem; 
    border: 1.5px solid var(--clr-border); 
    border-radius: 10px; 
    font-family: inherit; 
    font-size: 0.95rem; 
    color: #373533;
    background: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--clr-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(198, 159, 122, 0.2);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Suffix wrappers (min, Kč) */
.input-suffix-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-suffix-wrapper input {
    padding-right: 3.5rem;
}
.input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--clr-text-light);
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
}

/* Emoji Presets */
.emoji-presets {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.emoji-btn {
    background: #FFFFFF;
    border: 1.5px solid var(--clr-border);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
}
.emoji-btn:hover {
    border-color: var(--clr-primary);
    background: #FDF9F4;
    transform: scale(1.15);
}

/* Toggle Card with Switch */
.toggle-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    background: #F9F8F6;
    border: 1.5px solid #E3E0D8;
    border-radius: 10px;
    margin: 1.2rem 0;
}
.toggle-text {
    display: flex;
    flex-direction: column;
}
.toggle-text strong {
    font-size: 0.95rem;
    color: var(--clr-text);
}
.toggle-text span {
    font-size: 0.82rem;
    color: var(--clr-text-light);
}

/* iOS-style Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #D1CEC6;
    transition: .3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
input:checked + .slider {
    background-color: var(--clr-primary);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* Buttons */
.btn { padding: 0.6rem 1.4rem; border-radius: 50px; border: none; font-weight: 600; cursor: pointer; display: inline-block; text-align: center; transition: all 0.2s; }
.btn-primary { background: var(--clr-primary); color: white; }
.btn-primary:hover { background: var(--clr-primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--clr-border); color: var(--clr-text); }
.btn-outline:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.btn-full { width: 100%; }
.btn-danger { background: var(--clr-danger); color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }

/* Tables */
.table-responsive { overflow-x: auto; background: white; border-radius: var(--radius); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th, .admin-table td { padding: 1rem; border-bottom: 1px solid var(--clr-bg); font-size: 0.95rem; }
.admin-table th { background: #EBEAE6; font-weight: 600; }

.status-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.status-badge.confirmed { background: #e8f8f5; color: #27ae60; }
.status-badge.cancelled { background: #fadbd8; color: #c0392b; }

/* Services List */
.services-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.service-admin-card { background: white; padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--clr-border); }
.service-admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.service-admin-title { font-weight: 700; font-size: 1.1rem; }

/* Schedule */
.schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.schedule-card { background: white; padding: 1.5rem; border-radius: var(--radius); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

/* iCal Box */
.ical-box { background: white; padding: 2rem; border-radius: var(--radius); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.copy-input-group { display: flex; gap: 0.5rem; margin: 1rem 0; }
.copy-input-group input { flex: 1; padding: 0.7rem; border: 1px solid var(--clr-border); border-radius: 8px; font-family: monospace; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay[style*="flex"] { display: flex !important; }
.modal-box { background: white; padding: 2rem; border-radius: var(--radius); width: 95%; max-width: 500px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

.alert-error { background: #f8d7da; color: #721c24; padding: 0.75rem 1rem; border-radius: 8px; margin-top: 1rem; font-size: 0.9rem; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; padding: 0.75rem 1rem; border-radius: 8px; margin-top: 1rem; font-size: 0.9rem; border: 1px solid #c3e6cb; }

/* ──── CALENDAR ─────────────────────────────────────────────── */
.cal-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.cal-nav h3 { flex: 1; text-align: center; font-size: 1.25rem; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--clr-border); border-radius: var(--radius); overflow: hidden; }
.cal-header-cell { background: #2C2B2A; color: white; text-align: center; padding: 0.6rem; font-size: 0.85rem; font-weight: 600; }
.cal-day { background: white; min-height: 100px; padding: 0.5rem; position: relative; }
.cal-day.other-month { background: #F9F8F6; }
.cal-day.today { background: #FDF9F4; }
.cal-day-num { font-size: 0.85rem; font-weight: 600; color: var(--clr-text-light); margin-bottom: 0.3rem; display: flex; align-items: center; justify-content: flex-start; }
.cal-day.today .cal-day-num span { background: var(--clr-primary); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-event { background: var(--clr-primary); color: white; font-size: 0.72rem; padding: 3px 5px; border-radius: 4px; margin-bottom: 2px; cursor: pointer; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.15s; }
.cal-event:hover { opacity: 0.85; }
.cal-event.cancelled { background: #AFAAA3; }
.cal-event.blocked { background: #e74c3c; }

/* ──── RESERVATION MODAL ────────────────────────────────────── */
.res-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 1000; }
.res-modal.active { display: flex; }
.res-modal-box { background: white; padding: 2rem; border-radius: var(--radius); width: 95%; max-width: 540px; max-height: 90vh; overflow-y: auto; }
.res-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.res-modal-header h3 { margin: 0; font-size: 1.2rem; }
.close-btn { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--clr-text-light); line-height: 1; }
.close-btn:hover { color: var(--clr-text); }

/* ──── DETAIL MODAL ─────────────────────────────────────────── */
.detail-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 1000; }
.detail-modal.active { display: flex; }
.detail-box { background: white; padding: 2rem; border-radius: var(--radius); width: 95%; max-width: 450px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--clr-bg); font-size: 0.95rem; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--clr-text-light); font-size: 0.88rem; }

/* ──── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .schedule-grid { grid-template-columns: 1fr; gap: 1.2rem; }
    .form-row { grid-template-columns: 1fr; gap: 0.8rem; }
    .admin-tabs { gap: 0.3rem; }
    .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.88rem; }
    .cal-day { min-height: 65px; padding: 0.35rem; }
    .cal-event { font-size: 0.65rem; padding: 2px 4px; }
    .cal-header-cell { font-size: 0.75rem; padding: 0.4rem 0.2rem; }
    .modal-actions { flex-direction: column; gap: 0.6rem; }
    .modal-actions .btn { width: 100%; text-align: center; }
}

@media (max-width: 640px) {
    .res-modal, .detail-modal {
        align-items: flex-end;
    }
    .res-modal-box, .detail-box {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 18px 18px 0 0;
        padding: 1.3rem 1.1rem calc(1.3rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .admin-header .logo { font-size: 1.1rem; }
    .admin-header .btn-outline { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
    .cal-nav h3 { font-size: 1.1rem; }
}

/* ──── DAY VIEW ─────────────────────────────────────────────── */
.cal-day { cursor: pointer; transition: background 0.15s; }
.cal-day:hover { background: #FDF5ED !important; }

.day-view-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 900;
    opacity: 0; animation: dvFadeIn 0.2s ease forwards;
}
@keyframes dvFadeIn { to { opacity: 1; } }

.day-view-box {
    background: white; border-radius: var(--radius);
    width: 95%; max-width: 700px; max-height: 88vh;
    overflow-y: auto; padding: 1.5rem;
    transform: scale(0.85); animation: dvZoomIn 0.22s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes dvZoomIn { to { transform: scale(1); } }

@media (max-width: 640px) {
    .day-view-overlay {
        align-items: flex-end;
    }
    .day-view-box {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 18px 18px 0 0;
        padding: 1.2rem 1rem;
        transform: translateY(100%);
        animation: dvSlideUp 0.25s cubic-bezier(.25,.8,.25,1) forwards;
    }
    @keyframes dvSlideUp { to { transform: translateY(0); } }
}

.day-view-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.2rem; padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--clr-border);
}
.day-view-header h3 { font-size: 1.2rem; margin: 0; }

.timeline { position: relative; }
.timeline-row {
    display: grid; grid-template-columns: 48px 1fr;
    min-height: 52px; border-bottom: 1px solid var(--clr-bg);
}
.timeline-row:last-child { border-bottom: none; }
.timeline-time {
    font-size: 0.78rem; font-weight: 600; color: var(--clr-text-light);
    padding: 0.5rem 0.4rem 0 0; text-align: right;
    border-right: 2px solid var(--clr-border); margin-right: 0.6rem;
}
.timeline-slot { padding: 0.35rem 0; }

.timeline-event {
    background: var(--clr-primary); color: white;
    border-radius: 8px; padding: 0.5rem 0.75rem;
    margin-bottom: 0.3rem; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.timeline-event:hover { transform: translateX(3px); box-shadow: 0 4px 12px rgba(198,159,122,0.4); }
.timeline-event.cancelled { background: #AFAAA3; }
.timeline-event.blocked-slot { background: #e74c3c; cursor: default; }
.timeline-event:hover.blocked-slot { transform: none; }
.timeline-event-name { font-weight: 700; font-size: 0.88rem; }
.timeline-event-detail { font-size: 0.75rem; opacity: 0.9; margin-top: 1px; }

.timeline-empty { color: var(--clr-text-light); font-size: 0.85rem; font-style: italic; padding: 1rem; text-align: center; }

/* ──── BULK DELETE SECTION ─────────────────────────────────── */
.bulk-delete-card {
    background: #FFF;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.bulk-delete-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.bulk-delete-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.bulk-delete-row .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 160px;
}

/* ──── CLIENT SEARCH TAB ──────────────────────────────────── */
.search-bar-wrapper {
    background: #FFF;
    padding: 1.2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}
.search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    border: 2px solid var(--clr-border);
    border-radius: 10px;
    outline: none;
    font-family: inherit;
}
.search-input:focus {
    border-color: var(--clr-primary);
}
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
}
.client-card {
    background: #FFF;
    border-radius: var(--radius);
    padding: 1.3rem;
    border: 1px solid var(--clr-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.6rem;
}
.client-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2C2B2A;
}
.client-badge {
    background: rgba(198, 159, 122, 0.15);
    color: var(--clr-primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}
.client-detail-row {
    font-size: 0.9rem;
    color: var(--clr-text-light);
    margin-bottom: 0.35rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.client-detail-row a {
    color: var(--clr-text);
    text-decoration: none;
}
.client-detail-row a:hover {
    color: var(--clr-primary);
}
.client-card-actions {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid #F0EEE9;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* ──── ANALYTICS TAB ───────────────────────────────────────── */
.analytics-filter-bar {
    background: #FFF;
    border-radius: var(--radius);
    padding: 1rem 1.4rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.8rem;
}
.kpi-card {
    background: #FFF;
    border-radius: var(--radius);
    padding: 1.3rem;
    border: 1px solid var(--clr-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--clr-primary);
}
.kpi-label {
    font-size: 0.85rem;
    color: var(--clr-text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2C2B2A;
}
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.8rem;
}
.chart-card {
    background: #FFF;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--clr-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.chart-card h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
    color: #2C2B2A;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}
.chart-card-full {
    grid-column: 1 / -1;
}

/* Tax report box */
.tax-report-card {
    background: #FFF;
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--clr-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    margin-top: 1.5rem;
}
.tax-badge-fo {
    background: #E8F4F8;
    color: #1A5276;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

/* Odd/Even Schedule Tabs */
.week-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.week-tab-btn {
    padding: 0.45rem 0.9rem;
    border: 1.5px solid var(--clr-border);
    border-radius: 8px;
    background: #FFF;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--clr-text-light);
}
.week-tab-btn.active {
    background: var(--clr-primary);
    color: #FFF;
    border-color: var(--clr-primary);
}

@media (max-width: 900px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}


