/* ═══════════════════════════════════════════════
   ADMIN PANEL — global stylesheet
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Wrapper ─────────────────────────────────── */
.admin-wrap {
    display: flex;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Sidebar ─────────────────────────────────── */
.admin-sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.admin-sidebar-brand {
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar-brand img {
    height: 40px;
    width: auto;
    display: block;
}
.admin-sidebar-brand small {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,.45);
    margin-top: 7px;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.admin-nav {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    flex: 1;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a i { font-size: 16px; width: 18px; text-align: center; }

.admin-sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar-user {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-bottom: 10px;
    word-break: break-all;
}
.admin-logout-btn {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.85);
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 13px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 7px;
}
.admin-logout-btn:hover { background: rgba(255,255,255,.14); }

/* ── Mobile top bar ──────────────────────────── */
.admin-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #1a1a2e;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 200;
}
.admin-hamburger {
    background: none;
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    flex-shrink: 0;
}
.admin-topbar img {
    height: 28px;
    width: auto;
    display: block;
}
.admin-topbar-logout {
    background: none;
    border: none;
    color: rgba(255,255,255,.75);
    font-size: 22px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    flex-shrink: 0;
}

/* ── Backdrop ────────────────────────────────── */
.admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.48);
    z-index: 150;
}

/* ── Main content ────────────────────────────── */
.admin-main {
    flex: 1;
    padding: 32px;
    background: #f8f9fa;
    overflow: auto;
    min-width: 0;
}

/* ── Responsive helpers for child pages ─────── */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-cal-outer  { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-cal-inner  { min-width: 0; width: 100%; }

/* ── Calendar cells ─────────────────────────── */
.cal-hdr {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.cal-cell {
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 3px 5px;
    height: 52px;
    cursor: pointer;
    user-select: none;
}
.cal-bar-ovl {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    position: absolute;
    top: 26px;
    left: 0;
    right: 0;
    height: 24px;
    pointer-events: none;
}
.cal-bar {
    height: 22px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 7px;
    overflow: hidden;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 600;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* Customer name label shown on first day of reservation */
.cal-cell-name {
    font-size: 10px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .cal-cell-name { display: none; }
}

/* ── Reservation cards (mobile) ─────────────── */
.res-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.09);
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #dee2e6;
}
.res-card.status-confirmed { border-left-color: #198754; }
.res-card.status-pending   { border-left-color: #ffc107; }
.res-card.status-cancelled { border-left-color: #dc3545; }

.res-card-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.res-card-id      { font-size: 13px; color: #888; font-weight: 600; }
.res-badge        { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; }
.res-card-name    { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.res-card-phone   { font-size: 13px; color: #555; margin-bottom: 10px; }
.res-card-dates   { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.res-date-box     { background: #f8f9fa; border-radius: 6px; padding: 8px 10px; }
.res-date-label   { font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.res-date-value   { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.res-card-meta    { display: flex; gap: 16px; font-size: 13px; color: #555; margin-bottom: 12px; flex-wrap: wrap; }
.res-meta-item span { display: block; font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: .4px; }
.res-card-actions { display: flex; gap: 8px; }
.res-btn-edit     { flex: 1; padding: 9px; background: #1a1a2e; color: #fff; border: none; border-radius: 6px;
                    text-align: center; text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer; }
.res-btn-delete   { padding: 9px 14px; background: #fff; color: #dc3545; border: 1px solid #dc3545;
                    border-radius: 6px; font-size: 13px; cursor: pointer; }

/* Desktop: table visible, cards hidden */
.res-table-wrap { display: block; }
.res-cards      { display: none; }

/* ── Mobile breakpoint ───────────────────────── */
@media (max-width: 768px) {
    .admin-wrap { flex-direction: column; }

    .admin-topbar { display: flex; }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 240px;
        height: 100%;
        z-index: 300;
        transition: left .25s ease;
        overflow-y: auto;
    }
    .admin-sidebar.is-open { left: 0; }
    .admin-backdrop.is-open { display: block; }

    .admin-main { padding: 14px; }

    /* Single-column on form grids */
    .admin-form-grid { grid-template-columns: 1fr !important; }

    /* 2-col stat cards */
    .admin-stat-grid { grid-template-columns: 1fr 1fr !important; }

    /* Calendar compact */
    .cal-hdr          { font-size: 9px; padding: 4px 0; letter-spacing: 0; }
    .cal-cell         { height: 40px; padding: 3px 3px; }
    .dash-legend-hint { display: none; }

    /* Mobile: cards visible, table hidden */
    .res-table-wrap { display: none; }
    .res-cards      { display: block; }
}

/* ── Google Calendar error modal ─────────────── */
.gcal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.gcal-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 16px 48px rgba(0,0,0,.22);
    text-align: center;
}
.gcal-modal-icon {
    font-size: 2.8rem;
    color: #f59e0b;
    margin-bottom: 14px;
    line-height: 1;
}
.gcal-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
}
.gcal-modal-sub {
    font-size: .9rem;
    color: #555;
    margin: 0 0 16px;
    line-height: 1.5;
}
.gcal-modal-error {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .8rem;
    color: #78350f;
    font-family: monospace;
    text-align: left;
    word-break: break-word;
    margin-bottom: 14px;
    max-height: 130px;
    overflow-y: auto;
}
.gcal-modal-hint {
    font-size: .82rem;
    color: #888;
    margin: 0 0 22px;
    line-height: 1.4;
}
.gcal-modal-btn {
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 28px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background .2s;
}
.gcal-modal-btn:hover { background: #0d0d1a; }

/* ════════════════════════════════════════════════
   SETTINGS PAGE  (mobile-first)
   ════════════════════════════════════════════════ */

/* Page wrapper */
.st-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 780px;
}

/* ── Toast notification ────────────────────── */
.st-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
    animation: st-slide-in .25s ease;
    white-space: nowrap;
    max-width: calc(100vw - 32px);
}
.st-toast--ok  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.st-toast--err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.st-toast i    { font-size: 1.1rem; flex-shrink: 0; }
.st-toast-close {
    background: none; border: none; cursor: pointer;
    font-size: 1rem; color: inherit; opacity: .6;
    margin-left: 6px; padding: 0 2px; line-height: 1;
}
.st-toast-close:hover { opacity: 1; }
@keyframes st-slide-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Section card ──────────────────────────── */
.st-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    overflow: hidden;
}

/* Section header */
.st-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.st-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f0f7f6;
    color: #134943;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.st-section-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
    line-height: 1.2;
}
.st-section-sub {
    font-size: .78rem;
    color: #999;
    margin-top: 2px;
}

/* ── Price tiles ───────────────────────────── */
.st-price-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 18px 20px 4px;
}
.st-price-tile {
    background: #f8fffe;
    border: 1px solid #d4ede9;
    border-radius: 10px;
    padding: 14px 14px 12px;
}
.st-price-tile-label {
    font-size: .78rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.st-price-tile-label i { color: #134943; font-size: .9rem; }
.st-price-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    overflow: hidden;
    transition: border-color .2s;
}
.st-price-input-wrap:focus-within { border-color: #134943; }
.st-price-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    background: transparent;
    min-width: 0;
    width: 100%;
}
.st-price-suffix {
    padding: 0 10px 0 4px;
    font-size: .78rem;
    color: #999;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Generic field ─────────────────────────── */
.st-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.st-label {
    font-size: .75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.st-input {
    border: 1px solid #d1d5db;
    border-radius: 7px;
    padding: 9px 12px;
    font-size: .9rem;
    color: #1a1a2e;
    outline: none;
    width: 100%;
    transition: border-color .2s;
    background: #fff;
}
.st-input:focus { border-color: #134943; }
.st-input-url   { font-size: .8rem; }

/* ── List of cards (iCal / promos) ──────────── */
.st-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px 4px;
}
.st-list-card {
    display: flex;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 12px 14px 14px;
    align-items: flex-start;
}
.st-list-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Promo: price + 2 dates in a row */
.st-promo-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

/* ── Delete button ─────────────────────────── */
.st-btn-remove {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #fca5a5;
    background: #fff;
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
    margin-top: 22px;
}
.st-btn-remove:hover { background: #fee2e2; }

/* ── Actions row ───────────────────────────── */
.st-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px 18px;
    flex-wrap: wrap;
}
.st-btn-save {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #134943;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.st-btn-save:hover { background: #0d302c; }
.st-btn-add {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #134943;
    border: 1.5px dashed #134943;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.st-btn-add:hover { background: #f0f7f6; }

/* ── Mobile overrides ──────────────────────── */
@media (max-width: 600px) {
    .st-price-grid { grid-template-columns: 1fr; gap: 10px; }

    .st-promo-row { grid-template-columns: 1fr; }

    .st-actions { flex-direction: column; }
    .st-btn-save,
    .st-btn-add  { width: 100%; justify-content: center; padding: 13px; }

    .st-section-head { padding: 14px 14px 12px; }
    .st-price-grid   { padding: 14px 14px 4px; }
    .st-list         { padding: 12px 14px 4px; }
    .st-actions      { padding: 12px 14px 16px; }
}
