@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --ink: #12303a;
    --ink-soft: #2f4a54;
    --muted: #5d7179;
    --line: #d5e2e6;
    --line-soft: #e8f0f2;
    --surface: #ffffff;
    --surface-soft: #f3f8f9;
    --canvas-a: #e8f3f4;
    --canvas-b: #f7f4ee;
    --accent: #0f6f6a;
    --accent-deep: #0b5753;
    --accent-soft: #d8efed;
    --accent-glow: rgba(15, 111, 106, 0.14);
    --danger: #b42318;
    --success-bg: #e8f7ef;
    --success-ink: #166534;
    --warn-bg: #fff6e5;
    --warn-ink: #9a6700;
    --info-bg: #e8f1fb;
    --info-ink: #1d4f91;
    --radius: 10px;
    --radius-sm: 8px;
    --shadow: 0 8px 24px rgba(18, 48, 58, 0.07);
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
    --font-display: "Outfit", "Source Sans 3", sans-serif;
    --sidebar-width: 260px;
    color: var(--ink);
    background: var(--canvas-a);
    font: 15px/1.45 var(--font-body);
}

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

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 420px at 0% -5%, rgba(15, 111, 106, 0.14), transparent 55%),
        radial-gradient(800px 360px at 100% 0%, rgba(196, 154, 92, 0.1), transparent 48%),
        linear-gradient(165deg, var(--canvas-a), var(--canvas-b) 60%, #eef5f6);
    color: var(--ink);
}

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

/* ——— Agency shell ——— */
.shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex: 0 0 var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 18px 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid var(--line);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 4px 16px;
    padding: 14px 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(15, 111, 106, 0.1), rgba(255, 255, 255, 0.9));
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--accent-deep);
    text-decoration: none;
}

.brand-mark {
    display: block;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.brand-sub {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 0 4px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 14px;
    width: 100%;
}

.nav-label {
    display: block;
    margin: 0 8px 6px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar nav a {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar nav a:hover {
    background: var(--accent-soft);
    color: var(--accent-deep);
    text-decoration: none;
}

.sidebar nav a.active {
    background: var(--accent-soft);
    color: var(--accent-deep);
    box-shadow: inset 3px 0 0 var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.sidebar-foot {
    flex: 0 0 auto;
    margin-top: 8px;
    padding: 12px 4px 0;
    border-top: 1px solid var(--line-soft);
}

.sidebar-foot a {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #128078, var(--accent));
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 6px 14px var(--accent-glow);
}

.sidebar-foot a:hover {
    filter: brightness(1.05);
    text-decoration: none !important;
}

.workspace {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--line);
}

.topbar-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.topbar-kicker {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-title {
    display: block;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-user {
    color: var(--ink-soft);
    font-weight: 600;
}

.topbar form { margin: 0; }

button.link,
.topbar button.link {
    margin: 0;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--accent-deep);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button.link:hover,
.topbar button.link:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

main { padding: 28px; }

.page-head,
.heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.7rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    margin: 28px 0 10px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
}

.page-lead {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 40rem;
}

.desk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.desk-card {
    min-width: 0;
}

.desk-card h2 {
    margin-top: 0;
}

.desk-card .list {
    margin-top: 0;
    box-shadow: none;
}

.desk-card .list .empty {
    padding: 28px 16px;
}

.desk-card-wide {
    grid-column: 1 / -1;
}

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

.panel,
.card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.list {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; }

th {
    padding: 12px 16px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

td {
    padding: 14px 16px;
    border-top: 1px solid var(--line-soft);
    vertical-align: middle;
}

tr:hover td { background: rgba(216, 239, 237, 0.35); }

.empty {
    margin: 0;
    padding: 40px 16px;
    color: var(--muted);
    text-align: center;
}

.btn,
button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 9px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #128078, var(--accent));
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 14px var(--accent-glow);
}

.btn:hover,
button:hover,
a.button:hover {
    filter: brightness(1.05);
    text-decoration: none;
}

.btn.secondary,
button.secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn.secondary:hover,
button.secondary:hover { background: var(--surface-soft); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

label {
    display: block;
    margin-top: 14px;
    color: var(--ink-soft);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    color: var(--ink);
}

textarea { min-height: 96px; resize: vertical; }

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.page-form { max-width: 720px; }
.page-form .card button,
.page-form .panel button { margin-top: 0; }

dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 16px;
    margin: 0;
}

dt { color: var(--muted); }
dd { margin: 0; }

.success,
.flash {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--accent-soft);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 600;
}

.flash-password {
    font-weight: 500;
}
.flash-password p { margin: 0 0 6px; }
.flash-password code {
    font-size: 15px;
    word-break: break-all;
}

.list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin: 12px 0 16px;
    padding: 10px 0;
}
.list-pagination-range {
    margin: 0;
    font-size: 13px;
    color: var(--muted, #667085);
}
.list-pagination-settings a {
    font-weight: 600;
    color: var(--accent, #0f6f73);
    text-decoration: none;
}
.list-pagination-settings a:hover { text-decoration: underline; }
.pager { margin: 0 0 0 auto; }
.pager-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.pager-list > li {
    display: inline-flex !important;
    list-style: none !important;
    margin: 0;
    padding: 0;
}
.pager-list a,
.pager-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line, #d0d5dd);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink, #101828);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.pager-list a:hover { border-color: var(--accent, #0f6f73); color: var(--accent, #0f6f73); }
.pager-list .is-current span {
    background: var(--accent, #0f6f73);
    border-color: var(--accent, #0f6f73);
    color: #fff;
}
.pager-list .is-disabled span {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}
.pager-list .is-gap span {
    border: 0;
    background: transparent;
    min-width: 0;
    padding: 0 4px;
    box-shadow: none;
}

/* Accent palette — must beat global form label/input rules */
.accent-palette {
    border: 0;
    margin: 0 0 20px;
    padding: 0;
    max-width: none;
}
.accent-palette legend {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    margin: 0 0 4px;
    padding: 0;
}
.accent-palette > .hint {
    margin: 0 0 14px;
}
.accent-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 14px;
    margin: 0;
}
label.accent-swatch {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 !important;
    padding: 0;
    border: 2px solid var(--line, #e2e5ea);
    border-radius: 14px;
    cursor: pointer;
    background: var(--surface, #fff);
    overflow: hidden;
    font-weight: 500;
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
label.accent-swatch:hover {
    border-color: #b8bec8;
    transform: translateY(-1px);
}
label.accent-swatch.is-selected,
label.accent-swatch:has(input:checked) {
    border-color: var(--swatch, var(--accent, #0f6f73));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch, #0f6f73) 28%, transparent);
}
label.accent-swatch input[type="radio"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.accent-swatch-chip {
    display: block;
    width: 100%;
    height: 72px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: var(--swatch) !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    position: relative;
}
.accent-swatch-chip::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #fff;
    opacity: 0;
    transform: scale(0.7);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
label.accent-swatch.is-selected .accent-swatch-chip::after,
label.accent-swatch:has(input:checked) .accent-swatch-chip::after {
    opacity: 1;
    transform: scale(1);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%230f6f73' d='M6.2 11.4 2.8 8l1.1-1.1 2.3 2.3 5-5L12.3 5.3z'/%3E%3C/svg%3E")
        center / 14px 14px no-repeat #fff;
}
.accent-swatch-meta {
    display: grid;
    gap: 2px;
    padding: 10px 12px 12px;
    min-width: 0;
}
.accent-swatch-meta strong {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}
.accent-swatch-meta code {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted, #667085);
}

.muted { color: var(--muted); }

.banner {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--success-bg);
    color: var(--success-ink);
    border: 1px solid rgba(22, 101, 52, 0.12);
}

.error { color: var(--danger); margin: 6px 0 0; }

.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.status-draft,
.status-not_started,
.status-none { background: #eef2f4; color: #475569; }

.status-pending,
.status-pending_payment,
.status-pending_supplier,
.status-requested,
.status-in_review,
.status-unpaid { background: var(--warn-bg); color: var(--warn-ink); }

.status-confirmed,
.status-paid,
.status-approved,
.status-succeeded { background: var(--success-bg); color: var(--success-ink); }

.status-partial,
.status-part_paid { background: var(--info-bg); color: var(--info-ink); }

.status-failed,
.status-rejected,
.status-overdue,
.status-cancelled { background: #fdecea; color: var(--danger); }

.status-reconciliation_required { background: #f3e8ff; color: #6b21a8; }

.status-active { background: var(--success-bg); color: var(--success-ink); }
.status-trial { background: var(--info-bg); color: var(--info-ink); }
.status-suspended,
.status-past_due { background: #fdecea; color: var(--danger); }

.status-submitted,
.status-returned,
.status-pending_approval { background: var(--warn-bg); color: var(--warn-ink); }
.status-reimbursed { background: var(--success-bg); color: var(--success-ink); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.proposal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 24px;
    align-items: start;
    margin-top: 8px;
}

.proposal-summary {
    position: sticky;
    top: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.proposal-summary-total {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}

.proposal-cost {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
}

.proposal-cost summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-soft);
}

.timeline-day {
    margin: 0 0 20px;
    padding: 0 0 4px;
    border-bottom: 1px solid var(--line-soft);
}

.timeline-day h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.timeline-lines {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline-line {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    background: var(--surface-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.timeline-line-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-line-actions button { min-width: 2.25rem; }

.inline-send {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.ops-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 16px;
    align-items: end;
    margin-bottom: 16px;
}

.ops-filter .form-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

    .proposal-summary { position: static; }
}

/* Booking desk sections (UI_UX_DESIGN) */
.desk-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 16px 0 12px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.desk-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
}

.desk-tab:hover {
    color: var(--accent-deep);
    background: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.desk-tab.is-active {
    color: var(--accent-deep);
    background: var(--surface);
    box-shadow: 0 1px 0 var(--line);
}

.desk-tab-select,
.desk-tab-select-control {
    display: none;
}

@media (max-width: 720px) {
    .desk-tabs { display: none; }

    .desk-tab-select {
        display: block;
        margin: 12px 0 4px;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--muted);
    }

    .desk-tab-select-control {
        display: block;
        width: 100%;
        margin-bottom: 12px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--ink);
        font: inherit;
    }
}

dialog {
    width: min(480px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(18, 48, 58, 0.2);
}

dialog::backdrop { background: rgba(18, 48, 58, 0.45); }

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 { margin: 0; }
.modal-body { padding: 4px 20px 20px; }

.icon-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    justify-content: center;
    box-shadow: none;
}

.icon-close:hover { background: var(--surface-soft); }

.guest-body {
    min-height: 100vh;
}

.guest {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 20px;
}

.guest-shell {
    display: grid;
    width: min(920px, 100%);
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 60px rgba(18, 48, 58, 0.12);
}

.guest-brand {
    padding: 40px 36px;
    background:
        radial-gradient(480px 240px at 10% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
        linear-gradient(165deg, #0b5753 0%, #0f6f6a 48%, #145a6e 100%);
    color: #f4fbfa;
}

.guest-brand-mark {
    margin: 0 0 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.78;
}

.guest-brand-title {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
}

.guest-brand-copy {
    margin: 0;
    max-width: 28ch;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1rem;
    line-height: 1.55;
}

.guest-panel {
    padding: 36px 32px 32px;
    background: #fff;
}

.guest-panel .eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.guest-panel h1 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.65rem;
}

.guest-panel .page-lead,
.guest-panel .lead {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.guest-form label { margin-top: 12px; }

.guest-form button {
    width: 100%;
    margin-top: 22px;
    padding: 12px 16px;
}

.guest-alt {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.guest .panel {
    width: min(420px, 100%);
    border: 1px solid var(--line);
}

@media (max-width: 800px) {
    .guest-shell {
        grid-template-columns: 1fr;
    }

    .guest-brand {
        padding: 28px 24px;
    }

    .guest-brand-copy {
        max-width: none;
    }

    .guest-panel {
        padding: 28px 22px;
    }
}

/* ——— Public storefront ——— */
.public {
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 24px 48px;
}

.public .topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    min-height: auto;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.public .topbar a {
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
}

.public .topbar a:first-child {
    margin-right: auto;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.public .topbar a:hover { color: var(--accent); }

.public h1 { margin-bottom: 8px; }

.public .page-head p,
.public > main > p:first-of-type { color: var(--muted); }

.filters {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin: 16px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.85);
}

.filters input,
.filters select { max-width: 220px; }

.note {
    margin: 8px 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
}

.mail-settings {
    max-width: 640px;
}

.mail-settings .field {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 8px 16px;
    align-items: start;
    margin-bottom: 12px;
}

.mail-settings .field label {
    margin-top: 12px;
    font-weight: 600;
    color: var(--ink-soft);
}

.mail-settings .field input,
.mail-settings .field select,
.mail-settings .field textarea {
    margin-top: 0;
}

.mail-settings .field input:disabled,
.mail-settings .field select:disabled,
.mail-settings .field textarea:disabled {
    background: var(--surface-soft);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.85;
}

.mail-settings .mail-alerts-heading {
    margin: 24px 0 12px;
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.mail-settings .field-tall textarea {
    min-height: 120px;
}

.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--info-ink);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

@media (max-width: 640px) {
    .mail-settings .field {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mail-settings .field label {
        margin-top: 0;
    }
}

/* Mobile: keep a single vertical menu — never a 2-column mash */
@media (max-width: 960px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: none;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar nav {
        display: flex;
        flex-direction: column;
        max-height: none;
        overflow: visible;
    }

    .nav-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .sidebar nav a {
        display: block;
        width: 100%;
    }

    main { padding: 18px 16px 28px; }

    .topbar {
        padding: 12px 16px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    dl { grid-template-columns: 1fr; }
}

/* Phase 6 RTL shell (REQ-211). Content packs may still be English. */
html[dir="rtl"] .shell {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sidebar {
    border-right: 0;
    border-left: 1px solid var(--line);
}

html[dir="rtl"] .page-head,
html[dir="rtl"] .toolbar {
    text-align: right;
}
