/* rezervace_admin.css - Styl správy obsazenosti a pokojů pro ubytovatele (/rezervace/) */
:root {
    --primary: #1e3a5f;
    --primary-hover: #152943;
    --accent: #0284c7;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #cbd5e1;
    --text: #1e293b;
    --text-muted: #64748b;
    --free-bg: #f0fdf4;
    --free-border: #bbf7d0;
    --free-text: #166534;
    --booked-bg: #ef4444;
    --booked-border: #dc2626;
    --booked-text: #ffffff;
    --pending-bg: #f59e0b;
    --pending-border: #d97706;
    --pending-text: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.admin-header {
    background: var(--primary);
    color: #fff;
    padding: 0.9rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-brand h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-badge {
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.16);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
}

.admin-header-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #0369a1;
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
}

.btn-success {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.btn-success:hover {
    background: #bbf7d0;
}

.admin-container {
    max-width: 1380px;
    margin: 1.5rem auto;
    padding: 0 1rem 3rem;
}

.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card-title {
    margin: 0 0 0.85rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* Ovládací lišta kalendáře */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}

.mode-btn .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-booked { background: var(--booked-bg); }
.dot-pending { background: var(--pending-bg); }
.dot-closed { background: #64748b; }
.dot-free { background: #22c55e; }

.mode-btn.active[data-mode="1"] {
    border-color: var(--booked-bg);
    background: #fef2f2;
    color: #991b1b;
}

.mode-btn.active[data-mode="2"] {
    border-color: var(--pending-bg);
    background: #fffbeb;
    color: #92400e;
}

.mode-btn.active[data-mode="3"] {
    border-color: #64748b;
    background: #f1f5f9;
    color: #334155;
}

.mode-btn.active[data-mode="0"] {
    border-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.note-input-inline {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 240px;
}

/* Mřížka pokojů a kalendářů */
.room-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.room-section-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #f1f5f9;
}

.room-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.room-section-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
}

.cal-month {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.85rem;
    background: #fafaf9;
}

.cal-month-title {
    text-align: center;
    font-weight: 700;
    font-size: 0.98rem;
    margin-bottom: 0.65rem;
    color: var(--primary);
    text-transform: capitalize;
}

.cal-weekdays, .cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

.cal-day {
    position: relative;
    height: 40px;
    border-radius: 6px;
    border: 1px solid var(--free-border);
    background: var(--free-bg);
    color: var(--free-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.cal-day:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.cal-day.empty {
    background: transparent;
    border-color: transparent;
    cursor: default;
    pointer-events: none;
}

.cal-day.status-1 {
    background: var(--booked-bg);
    border-color: var(--booked-border);
    color: var(--booked-text);
}

.cal-day.status-2 {
    background: var(--pending-bg);
    border-color: var(--pending-border);
    color: var(--pending-text);
}

.cal-day.status-3 {
    background: repeating-linear-gradient(
        -45deg,
        #e2e8f0,
        #e2e8f0 5px,
        #cbd5e1 5px,
        #cbd5e1 10px
    );
    border-color: #94a3b8;
    color: #334155;
}

.cal-day.split-day {
    border-color: #64748b;
    color: #0f172a;
    font-weight: 800;
    text-shadow: 0 0 4px #ffffff, 0 0 6px #ffffff;
}

.cal-day.is-today {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.cal-day.is-selecting-start {
    background: #0284c7 !important;
    border-color: #0369a1 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.35);
    z-index: 3;
}

.admin-selection-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.88rem;
    color: var(--text);
}

.admin-selection-bar.active-selection {
    background: #eff6ff;
    border-color: #38bdf8;
    color: #0369a1;
}

.stay-status-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.stay-status-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background: #f8fafc;
    transition: all 0.12s ease;
}

.stay-status-option:hover {
    border-color: #94a3b8;
}

.cal-day-note-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    margin-top: 2px;
}

/* Formuláře */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
}

textarea.form-control {
    min-height: 95px;
    resize: vertical;
}

/* Mini náhledy fotografií pokojů a nahrávání */
.admin-photo-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.9rem;
    margin-top: 0.25rem;
}

.admin-photo-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.admin-photo-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-photo-thumb-box {
    width: 100%;
    height: 110px;
    background: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
}

.admin-photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-photo-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.admin-photo-upload-btn {
    width: 100%;
    font-size: 0.78rem;
    padding: 0.38rem 0.5rem;
    cursor: pointer;
}

.admin-photo-history-btn {
    width: 100%;
    font-size: 0.78rem;
    padding: 0.38rem 0.5rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 600;
}

.admin-photo-history-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Modální okno pro archiv fotografií */
.photo-history-modal {
    max-width: 820px;
    width: 95%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

#photo-history-modal-content {
    overflow-y: auto;
    max-height: calc(88vh - 170px);
    padding-right: 0.4rem;
}

.photo-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
}

.photo-history-item {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.photo-history-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

.photo-history-item.is-current {
    border-color: #16a34a;
    background: #f0fdf4;
}

.photo-history-item-thumb-box {
    width: 100%;
    height: 105px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-history-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-history-item-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(22, 163, 74, 0.92);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.photo-history-item-archived-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.photo-history-item-info {
    font-size: 0.74rem;
    color: #475569;
    line-height: 1.25;
}

.photo-history-item-filename {
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
    font-size: 0.73rem;
    margin-bottom: 2px;
}

.photo-history-item-btn {
    width: 100%;
    font-size: 0.76rem;
    padding: 0.35rem 0.5rem;
    margin-top: auto;
    font-weight: 600;
}

/* Tabulka termínů s poznámkami */
.booking-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.booking-list-table th,
.booking-list-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.booking-list-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-muted);
}

.status-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-pill.s1 {
    background: #fee2e2;
    color: #991b1b;
}

.status-pill.s2 {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.s3 {
    background: #e2e8f0;
    color: #334155;
}

/* Toast notifikace */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: #0f172a;
    color: #fff;
    padding: 0.75rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.toast.error {
    background: #b91c1c;
}

.toast.success {
    background: #15803d;
}

.login-box {
    max-width: 420px;
    margin: 4rem auto;
}

/* Potvrzovací modální okno proti nechtěnému smazání poznámky */
.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    padding: 1rem;
}

.confirm-modal-backdrop.open {
    display: flex;
}

.confirm-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    border-top: 5px solid #dc2626;
}

.confirm-modal-title {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    color: #991b1b;
}

.confirm-modal-text {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    color: var(--text);
}

.confirm-modal-note-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: #7f1d1d;
    font-weight: 600;
    word-break: break-word;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
}

@media (max-width: 640px) {
    .admin-header {
        padding: 0.7rem 1rem;
        gap: 0.6rem;
    }

    .admin-brand h1 {
        font-size: 1.02rem;
    }

    .admin-badge {
        font-size: 0.7rem;
        padding: 0.18rem 0.5rem;
    }

    .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 7px;
    }

    .tab-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.82rem;
    }

    .mode-btn {
        padding: 0.36rem 0.65rem;
        font-size: 0.8rem;
    }

    .note-input-inline {
        min-width: 100%;
        font-size: 0.84rem;
    }

    .card,
    .room-section {
        padding: 0.9rem;
    }

    .cal-day {
        height: 35px;
        font-size: 0.81rem;
    }
}

