/* =========================================================
   COREIDON.AI — Admin Console
   Independent stylesheet. Do not share with other pages.
   ========================================================= */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;

    /* Light theme */
    --bg-canvas: #FFFFFF;
    --bg-section: #F8F5F0;
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-input-hover: #F8F5F0;
    --bg-table-head: #F8F5F0;
    --bg-overlay: rgba(9, 28, 58, 0.55);

    --text-primary: #000000;
    --text-secondary: #2B303B;
    --text-muted: rgba(43, 48, 59, 0.7);
    --text-inverse: #FFFFFF;

    --accent-navy: #091C3A;
    --accent-navy-hover: #0C2550;
    --accent-cyan: #0284C7;
    --accent-cyan-hover: #0369A1;
    --accent-cyan-soft: rgba(2, 132, 199, 0.1);

    --color-success: #16A34A;
    --color-success-soft: rgba(22, 163, 74, 0.12);
    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;
    --color-danger-soft: rgba(220, 38, 38, 0.08);

    --border-subtle: #E5E7EB;
    --border-strong: #2B303B;
    --border-focus: #0284C7;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --brand-fill: #091C3A;

    --shadow-card: 0 1px 2px rgba(9, 28, 58, 0.04);
    --shadow-overlay: 0 24px 48px rgba(9, 28, 58, 0.18);

    --transition-snap: 120ms ease;
    --transition-swift: 180ms ease;
}

[data-theme="dark"] {
    --bg-canvas: #0A1220;
    --bg-section: #0A1220;
    --bg-surface: #121B2A;
    --bg-elevated: #243447;
    --bg-input: #121B2A;
    --bg-input-hover: #1F2A3C;
    --bg-table-head: #1F2A3C;
    --bg-overlay: rgba(4, 9, 18, 0.7);

    --text-primary: #FFFFFF;
    --text-secondary: rgba(248, 245, 240, 0.75);
    --text-muted: rgba(248, 245, 240, 0.45);
    --text-inverse: #0A1220;

    --accent-navy: #091C3A;
    --accent-navy-hover: #0C2550;
    --accent-cyan: #38BDF8;
    --accent-cyan-hover: #7DD3FC;
    --accent-cyan-soft: rgba(56, 189, 248, 0.14);

    --color-success: #34D399;
    --color-success-soft: rgba(52, 211, 153, 0.14);
    --color-danger: #FB7185;
    --color-danger-hover: #F43F5E;
    --color-danger-soft: rgba(251, 113, 133, 0.12);

    --border-subtle: #1F2A3C;
    --border-strong: #2D3D52;
    --border-focus: #38BDF8;

    --brand-fill: #F8F5F0;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-overlay: 0 32px 64px rgba(0, 0, 0, 0.55);
}

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

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-section);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

a { color: var(--accent-cyan); text-decoration: none; transition: color var(--transition-snap); }
a:hover { color: var(--accent-cyan-hover); text-decoration: underline; }

/* ---------- Topbar ---------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    background: var(--bg-canvas);
    border-bottom: 1px solid var(--border-subtle);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--brand-fill);
}

.brand-logo {
    width: 28px;
    height: 28px;
    display: inline-flex;
    color: var(--brand-fill);
}

.brand-logo svg { width: 100%; height: 100%; }

.brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theme toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color var(--transition-snap), color var(--transition-snap), background var(--transition-snap);
}
.theme-toggle:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Loading state ---------- */
.loading-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-section);
}
.loading-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}
.loading-brand .brand-logo {
    width: 56px;
    height: 56px;
    animation: loading-pulse 1.4s ease-in-out infinite;
}
.loading-brand h1 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 1.5rem;
    margin: 0;
}
.loading-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}
@keyframes loading-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ---------- Layout ---------- */
.admin-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-display);
}

.admin-header h1::before {
    content: "Admin / ";
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 0.25rem;
}

.admin-header .header-logo,
.admin-header img.header-logo {
    height: 48px;
    width: auto;
    filter: none;
}

[data-theme="dark"] .admin-header img.header-logo {
    filter: invert(1) brightness(1.1);
}

/* ---------- Dashboard shell (sidebar + panels) ---------- */
.admin-shell {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.admin-sidebar {
    position: sticky;
    /* Clear the sticky .app-topbar (~73px) so nav items aren't hidden behind it. */
    top: 5.5rem;
    flex: 0 0 220px;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-nav-item {
    width: 100%;
    text-align: left;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.dash-nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.dash-nav-item.active {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.admin-content {
    flex: 1 1 auto;
    min-width: 0;
}

.dash-panel { display: none; }
.dash-panel.active { display: block; }

/* On wide desktops, spread the dense multi-card panels (General, Reservations)
   into two masonry columns so they use the full width instead of one tall,
   stuffed column. break-inside keeps each card whole. Columns are ~700px here,
   well above the 768px point where tables collapse to card mode. Display and
   Analytics stay single-column (their report/table want the full width). */
@media (min-width: 1200px) {
    .dash-panel[data-group="general"],
    .dash-panel[data-group="reservations"] {
        column-count: 2;
        column-gap: 1.75rem;
    }
    .dash-panel[data-group="general"] > .admin-section,
    .dash-panel[data-group="reservations"] > .admin-section {
        break-inside: avoid;
    }
}

@media (max-width: 820px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar {
        position: static;
        width: 100%;
        flex: 0 0 auto;
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        margin-bottom: 0.5rem;
    }
    .dash-nav-item { width: auto; white-space: nowrap; }
}

/* ---------- Sections ---------- */
.admin-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
}

.admin-section h2 {
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.admin-section h3 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 2rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle) !important;
}

.admin-section p {
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
}

/* ---------- Forms ---------- */
form { display: flex; flex-direction: column; gap: 1rem; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 100%;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1 1 180px; }

label {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.field-help {
    margin: 0.25rem 0 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.field-help code,
.admin-section p code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82em;
    padding: 0.1rem 0.35rem;
    background: var(--bg-input-hover);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    white-space: nowrap;
}

.input-with-action {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.input-with-action input {
    flex: 1 1 240px;
    min-width: 0;
}
.input-with-action .btn {
    flex-shrink: 0;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-primary);
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-navy);
    cursor: pointer;
    margin: 0;
}

.form-row.is-disabled { opacity: 0.45; pointer-events: none; }
.form-row.is-disabled input { cursor: not-allowed; }

/* --- Analytics widget dashboard --- */
.dd-analytics-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.dd-analytics-toolbar .form-group { margin: 0; }

.dd-analytics-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 1.75rem 0 0.85rem;
}

.dd-analytics-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.dd-w { min-width: 0; }
.dd-w coreidon-widget { display: block; height: 100%; min-height: 120px; }
.dd-w-small  { grid-column: span 3; }
.dd-w-medium { grid-column: span 6; }
.dd-w-large  { grid-column: span 12; }

@media (max-width: 1100px) {
    .dd-w-small  { grid-column: span 6; }
    .dd-w-medium { grid-column: span 12; }
}
@media (max-width: 680px) {
    .dd-w-small { grid-column: span 12; }
}

/* --- Bookings Report (legacy, kept for any lingering references) --- */
.report-rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.report-room-option {
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-xs);
    transition: background var(--transition-snap);
}
.report-room-option:hover { background: var(--bg-input-hover); }

.report-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.report-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.report-total {
    font-size: 1rem;
}

.report-total strong {
    color: var(--accent-cyan);
}

.report-table th,
.report-table td {
    font-size: 0.88rem;
    padding: 0.65rem 0.75rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-snap), box-shadow var(--transition-snap), background var(--transition-snap);
}

input[readonly] {
    background: var(--bg-input-hover);
    color: var(--text-muted);
    cursor: not-allowed;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-cyan-soft);
}

input[type="file"] {
    padding: 0.5rem;
    cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.82rem;
    text-transform: uppercase;
    padding: 0.7rem 1.1rem;
    min-height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-snap), border-color var(--transition-snap),
                color var(--transition-snap), transform var(--transition-snap), box-shadow var(--transition-snap);
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-cyan-soft); }

.btn-primary {
    background: var(--accent-navy);
    color: #FFFFFF;
    border-color: var(--accent-navy);
}
.btn-primary:hover {
    background: var(--accent-navy-hover);
    border-color: var(--accent-navy-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}
.btn-secondary:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.btn-danger {
    background: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background: var(--color-danger);
    color: #FFFFFF;
}

.btn-icon {
    min-height: 32px;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition-snap);
}
.btn-icon:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* ---------- Tables ---------- */
.room-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.room-table th,
.room-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    vertical-align: top;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.room-table th {
    background: var(--bg-table-head);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.room-table tr:last-child td { border-bottom: none; }

.room-table td strong { color: var(--text-primary); font-weight: 600; }
.room-table td small { color: var(--text-muted); font-size: 0.82rem; }
.room-table td b { color: var(--text-secondary); font-weight: 600; }

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.actions-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.action-buttons {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* View-links */
.view-links,
.url-links,
.config-and-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
}

.view-links a,
.url-links a,
.config-and-links a {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

.view-links a:hover {
    color: var(--accent-cyan-hover);
}

.mail-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-swift);
}

.modal.visible { display: flex; }
.modal.visible.show { opacity: 1; }

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    width: min(100%, 500px);
    margin: 1rem;
    box-shadow: var(--shadow-overlay);
    color: var(--text-primary);
}

.modal-content h2 {
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1rem;
}

.modal-form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------- In-app dialogs (confirm/prompt) ---------- */
.dd-dialog-message {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.dd-dialog-input {
    width: 100%;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font: inherit;
}

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2000;
    pointer-events: none;
    padding: 0 1rem;
}

.toast {
    min-width: 200px;
    max-width: 440px;
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    background: var(--accent-navy);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    box-shadow: var(--shadow-overlay);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition-swift), transform var(--transition-swift);
    pointer-events: auto;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--success { background: var(--color-success); }
.toast--error { background: var(--color-danger); }

/* ---------- Logo preview ---------- */
#logo-preview {
    padding: 1rem !important;
    border: 1px dashed var(--border-strong) !important;
    background: var(--bg-input-hover) !important;
    border-radius: var(--radius-sm) !important;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

#logo-preview svg,
#logo-preview img {
    max-height: 150px;
    max-width: 100%;
    color: var(--brand-fill);
}

/* ---------- Customer-app (PWA) icon ---------- */
.app-icon-preview {
    width: 96px;
    height: 96px;
    border: 1px dashed var(--border-strong);
    background: var(--bg-input-hover);
    border-radius: 22px; /* mimic an iOS/Android home-screen icon */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.app-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-icon-empty {
    font-size: 0.7rem;
    text-align: center;
    padding: 0 0.5rem;
    color: var(--text-muted);
}

.app-icon-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Activities & equipment (room edit modal) ---------- */
/* Keep the (now taller) edit modal within the viewport. */
.modal-content { max-height: 90vh; overflow-y: auto; }

.form-hint {
    margin: 0 0 0.6rem 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.btn-sm {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.75rem !important;
}

#rename-room-activities .ae-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ae-activity {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    padding: 0.6rem 0.7rem;
}

.ae-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ae-actions { display: inline-flex; gap: 0.35rem; }

.ae-activity-title { display: inline-flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }

.ae-activity-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ae-equipment-list {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ae-equipment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.ae-equipment-empty,
.ae-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

.ae-add-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.7rem;
    flex-wrap: wrap;
}

.ae-add-row input {
    flex: 1;
    min-width: 7rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
}

/* The price / min-time number inputs are narrow next to the name field. */
.ae-add-row input.ae-num {
    flex: 0 0 auto;
    width: 6rem;
    min-width: 0;
}

/* ---------- Reservation detail / cost breakdown ---------- */
.reservation-detail-row > td {
    background: var(--bg-input);
    padding: 0.85rem 1rem;
}

.reservation-detail-row .rd-line { margin: 0 0 0.4rem; }

.reservation-message {
    margin: 0 0 0.6rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-secondary);
}

.reservation-photo {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.12));
    display: block;
    margin: 0 0 0.6rem;
}

.reservation-breakdown {
    max-width: 420px;
    font-size: 0.9rem;
}

.reservation-breakdown .bd-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.2rem 0;
    color: var(--text-secondary);
}

.reservation-breakdown .bd-row small { color: var(--text-muted); }

.reservation-breakdown .bd-amount {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.reservation-breakdown .bd-discount { color: var(--color-success, #16A34A); }

.reservation-breakdown .bd-total {
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border-subtle);
    font-weight: 700;
    color: var(--text-primary);
}

/* ---------- Promo videos ---------- */
#promo-video-upload {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
    padding: 0.7rem !important;
    border-radius: var(--radius-sm) !important;
}

#promo-video-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

#promo-video-list > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem !important;
    background: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-primary);
}

.video-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.progress-item { margin-bottom: 0.6rem; }
.progress-item p { margin: 0 0 0.25rem 0; font-size: 0.85rem; color: var(--text-secondary); }
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-input-hover);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-cyan);
    transition: width 240ms ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .app-topbar { padding: 0.75rem 1rem; }
    .admin-container { padding: 1.25rem 1rem 3rem; }
    .admin-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .admin-header h1 { font-size: 1.25rem; }
    .admin-section { padding: 1.1rem; }
    .form-row { flex-direction: column; gap: 0.75rem; }

    /* Stacked table */
    .room-table { display: block; border: none; }
    .room-table thead { display: none; }
    .room-table tbody, .room-table tr, .room-table td { display: block; width: 100%; }
    .room-table tr {
        margin-bottom: 0.8rem;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        background: var(--bg-surface);
        overflow: hidden;
    }
    .room-table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
    }
    .room-table tr td:last-child { border-bottom: none; }

    .modal-actions { flex-direction: column; align-items: stretch; }
    .modal-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .admin-header h1::before { display: block; }
    .brand-mark { font-size: 0.95rem; }
}

/* ─── Recurring ("occurring") events ─────────────────────────────────────── */

.recurring-weekday-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.recurring-weekday {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}
.recurring-weekday input { margin: 0; }

.recurring-summary {
    margin: 1rem 0;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
}
.recurring-summary.all-clear {
    background: var(--color-success-soft);
    color: var(--color-success);
}
.recurring-summary.has-conflicts {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* Calendar */
.recurring-calendar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.recurring-cal-month {
    flex: 0 1 340px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.recurring-cal-title {
    padding: 0.5rem 0.75rem;
    background: var(--bg-section);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: capitalize;
}
.recurring-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-subtle);
}
.recurring-cal-dow {
    background: var(--bg-surface);
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.3rem 0;
}
.recurring-cal-cell {
    background: var(--bg-surface);
    min-height: 48px;
    padding: 0.25rem 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.recurring-cal-cell.empty { background: var(--bg-section); }
.recurring-cal-daynum { font-size: 0.72rem; color: var(--text-muted); }
.recurring-cal-chip {
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-xs, 4px);
    padding: 0.05rem 0.25rem;
    line-height: 1.3;
}
.recurring-cal-cell.is-ok .recurring-cal-chip { background: var(--accent-cyan-soft); color: var(--accent-cyan); }
.recurring-cal-cell.is-shifted .recurring-cal-chip { background: var(--color-success-soft); color: var(--color-success); }
.recurring-cal-cell.is-skipped .recurring-cal-chip { background: var(--bg-section); color: var(--text-muted); text-decoration: line-through; }
.recurring-cal-cell.is-conflict { cursor: pointer; }
.recurring-cal-cell.is-conflict .recurring-cal-chip { background: var(--color-danger-soft); color: var(--color-danger); }
.recurring-cal-cell.is-conflict:hover { outline: 2px solid var(--color-danger); outline-offset: -2px; }

/* Conflict / occurrence list */
.recurring-list-title {
    margin: 1.1rem 0 0.5rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--text-muted);
}
.recurring-occurrence {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
}
.recurring-occurrence.is-conflict { border-left: 3px solid var(--color-danger); }
.recurring-occurrence.is-skipped { opacity: 0.6; }
.recurring-occurrence.flash { animation: recurring-flash 1.2s ease; }
@keyframes recurring-flash {
    0%, 100% { background: var(--bg-surface); }
    30% { background: var(--accent-cyan-soft); }
}
.recurring-occ-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 180px; }
.recurring-occ-time { font-size: 0.82rem; color: var(--text-muted); }
.recurring-occ-block { font-size: 0.8rem; color: var(--color-danger); }
.recurring-shift-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.recurring-shift-controls .btn {
    padding: 0.35rem 0.6rem;
    min-height: 30px;
    font-size: 0.72rem;
}
/* `input.` keeps these compact rules winning over the shared input[type="time"]
   rule (equal specificity, later in the file); width:auto undoes its width:100%. */
input.recurring-time-input {
    width: auto;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg-input, var(--bg-surface));
    color: var(--text-primary);
}
.recurring-skip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    cursor: pointer;
}
.recurring-skip-toggle input { margin: 0; }

/* Status badges (series list + detail) */
.recurring-badge {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0.1rem 0.15rem 0.1rem 0;
    white-space: nowrap;
}
.recurring-badge--scheduled { background: var(--accent-cyan-soft); color: var(--accent-cyan); }
.recurring-badge--shifted { background: var(--color-success-soft); color: var(--color-success); }
.recurring-badge--skipped { background: var(--bg-section); color: var(--text-muted); }
.recurring-badge--attention { background: var(--color-danger-soft); color: var(--color-danger); }

.recurring-detail-card {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-section);
}
.recurring-detail-card h4 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.dd-recurring-error { color: var(--color-danger); font-size: 0.9rem; }
.recurring-pin-cell {
    font-family: monospace;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.1rem 0.45rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs, 4px);
    background: var(--bg-section);
    white-space: nowrap;
}
.recurring-pin-display {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 0.4rem 0 0.8rem;
    color: var(--accent-cyan);
}

/* Occurrence rows become clickable (open the day editor) */
.recurring-occ-clickable { cursor: pointer; transition: border-color var(--transition-snap), background var(--transition-snap); }
.recurring-occ-clickable:hover { border-color: var(--accent-cyan); background: var(--accent-cyan-soft); }
.recurring-occ-edit { font-size: 0.78rem; font-weight: 700; color: var(--accent-cyan); white-space: nowrap; }

/* ─── Day-editor popover (anchored) + visual timeline ────────────────────── */

.dd-popover {
    position: fixed;
    z-index: 1100;
    width: min(92vw, 520px);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-overlay);
    padding: 1rem;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity var(--transition-swift), transform var(--transition-swift);
}
.dd-popover.show { opacity: 1; transform: translateY(0); }

.recurring-daypop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}
.recurring-daypop-x {
    border: none;
    background: transparent;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.25rem;
}
.recurring-daypop-x:hover { color: var(--text-primary); }

/* Vertical day timeline (calendar-style) */
.recurring-vt {
    position: relative;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-section);
    padding: 0.4rem 0;
}
.recurring-vt-inner { position: relative; }
.recurring-vt-hour {
    position: absolute;
    left: 0;
    width: 40px;
    text-align: right;
    transform: translateY(-0.5em);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.recurring-vt-line {
    position: absolute;
    left: 46px;
    right: 0;
    border-top: 1px solid var(--border-subtle);
    opacity: 0.55;
}
.recurring-vt-track {
    position: absolute;
    left: 46px;
    right: 10px;
    top: 0;
    bottom: 0;
}
.recurring-vt-busy {
    position: absolute;
    left: 0;
    right: 0;
    background: var(--color-danger-soft);
    border: 1px solid var(--color-danger);
    border-left-width: 3px;
    border-radius: var(--radius-xs, 4px);
    overflow: hidden;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
}
.recurring-vt-busy span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-danger);
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.recurring-vt-event {
    position: absolute;
    left: 0;
    right: 0;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    border-radius: var(--radius-sm);
    background: var(--accent-cyan);
    cursor: grab;
    box-shadow: var(--shadow-overlay);
    touch-action: none;
    user-select: none;
    overflow: hidden;
    z-index: 3;
}
.recurring-vt-event:active { cursor: grabbing; }
.recurring-vt-event.is-free { background: var(--color-success); }
.recurring-vt-event.is-conflict { background: var(--color-danger); }
.recurring-vt-grip {
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 3px 0 rgba(255, 255, 255, 0.85), 0 -3px 0 rgba(255, 255, 255, 0.85);
    flex: 0 0 auto;
}

.recurring-tl-status {
    margin: 0.6rem 0;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-block;
}
.recurring-tl-status.is-free { background: var(--color-success-soft); color: var(--color-success); }
.recurring-tl-status.is-conflict { background: var(--color-danger-soft); color: var(--color-danger); }

.recurring-daypop-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}
.recurring-daypop-controls .btn { padding: 0.35rem 0.55rem; min-height: 30px; font-size: 0.72rem; }
.recurring-daypop-controls .recurring-time-input { flex: 0 0 auto; }
.recurring-daypop-actions { justify-content: space-between; align-items: center; }
.recurring-daypop-commit { display: inline-flex; gap: 0.4rem; }

/* Mobile bottom sheet (the day editor on phones) */
.dd-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity var(--transition-swift);
}
.dd-sheet-backdrop.show { opacity: 1; }
.dd-sheet {
    width: 100%;
    max-height: 88vh;
    display: flex;            /* column: grab · head · timeline(scroll) · status · controls · actions */
    flex-direction: column;
    overflow: hidden;         /* the sheet itself never scrolls — only the timeline does */
    background: var(--bg-surface);
    border-radius: 16px 16px 0 0;
    padding: 0.5rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    box-shadow: var(--shadow-overlay);
    transform: translateY(100%);
    transition: transform var(--transition-swift);
}
.dd-sheet-backdrop.show .dd-sheet { transform: translateY(0); }
.dd-sheet-grab {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-subtle);
    margin: 0.25rem auto 0.85rem;
}
/* Only the timeline scrolls; everything else (header + footer controls/actions)
   stays pinned so SĂRI / RESETEAZĂ / APLICĂ are always reachable. */
.dd-sheet .recurring-vt { flex: 1 1 auto; min-height: 0; max-height: none; }
.dd-sheet > .dd-sheet-grab,
.dd-sheet .recurring-daypop-head,
.dd-sheet .recurring-tl-status,
.dd-sheet .recurring-daypop-controls,
.dd-sheet .recurring-daypop-actions { flex: 0 0 auto; }
.dd-sheet .recurring-tl-status { align-self: flex-start; }   /* keep the pill from stretching full width */

@media (max-width: 600px) {
    .recurring-daypop-actions { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .recurring-daypop-commit { display: flex; gap: 0.5rem; }
    .recurring-daypop-commit .btn { flex: 1; }
    .recurring-daypop-controls .btn { flex: 1; }
    .recurring-daypop-controls .recurring-time-input { flex: 1 1 100%; }
}
