/* Staff Dashboard — polished management UI */
:root {
    --bg: #f4f4f9;
    --paper: #ffffff;
    --ink: #333333;
    --muted: #5d6670;
    --line: #d9dee6;
    --accent: #1c69a7;
    --accent-strong: #144a73;
    --sky: #1c69a7;
    --mint: #138f74;
    --amber: #c27f14;
    --rose: #b13f4a;
    --slate: #5f6f7c;
    --card-shadow: 0 12px 34px rgba(20, 40, 52, 0.08);
    --soft-shadow: 0 4px 14px rgba(23, 34, 45, 0.07);
    --radius-lg: 18px;
    --radius-md: 12px;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    position: relative;
    background: var(--bg);
    color: var(--ink);
    font: clamp(15px, 0.45vw + 14px, 18px)/1.55 "DM Sans", "Segoe UI", sans-serif;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(8px);
    opacity: 0.5;
}

body::before {
    width: 360px;
    height: 360px;
    right: -160px;
    top: 100px;
    display: none;
}

body::after {
    width: 300px;
    height: 300px;
    left: -150px;
    bottom: 120px;
    display: none;
}

a {
    color: var(--sky);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

.top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 22px;
    background: var(--accent);
    border-bottom: 0;
    color: #ffffff;
}

.top-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: clamp(180px, 20vw, 280px);
    height: clamp(56px, 6vw, 78px);
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left center;
}

.brand-copy {
    min-width: 0;
}

.brand-title {
    color: #ffffff;
    font: 700 clamp(14px, 1.25vw, 20px)/1.1 "Space Grotesk", "DM Sans", sans-serif;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.brand-sub {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font: 500 clamp(11px, 0.82vw, 13px)/1.15 "DM Sans", sans-serif;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand-logo-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: transparent;
}

.tabs {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.tab {
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font: 600 clamp(14px, 0.35vw + 13px, 16px)/1 "DM Sans", sans-serif;
    cursor: pointer;
    transition: all 180ms ease;
}

.tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
}

.tab.is-active {
    color: var(--accent);
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.top-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.who {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: clamp(13px, 0.25vw + 12px, 15px);
    color: rgba(255, 255, 255, 0.88);
}

.who img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(23, 34, 45, 0.12);
}

.btn-link {
    color: #ffffff;
    font-weight: 600;
}

.btn-link:hover {
    color: #d9ecff;
    text-decoration: none;
}

.sync-readout {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 10px;
    color: rgba(255, 255, 255, 0.92);
    font: 500 11px/1.25 "DM Sans", sans-serif;
    text-align: right;
    white-space: nowrap;
}

.sync-readout-row {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    justify-content: flex-end;
    font-variant-numeric: tabular-nums;
}

.sync-readout-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.7;
}

.sync-readout-value {
    font-weight: 600;
    font-size: 12px;
}

@media (max-width: 720px) {
    .sync-readout {
        font-size: 10px;
    }
    .sync-readout-value {
        font-size: 11px;
    }
}

.page {
    max-width: 1480px;
    margin: 0 auto;
    padding: 22px 24px 52px;
}

.view { display: none; }
.view.is-active { display: block; }

.toolbar {
    display: grid;
    grid-template-columns: minmax(200px, auto) 1fr minmax(140px, auto);
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--soft-shadow);
    animation: rise-in 260ms ease both;
}

.datepick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: clamp(13px, 0.28vw + 12px, 15px);
}

.datepick label {
    font-weight: 700;
    color: var(--ink);
}

.datepick input[type="date"],
.search input[type="search"],
.search select {
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #ffffff;
    color: var(--ink);
    font: 500 clamp(14px, 0.3vw + 13px, 16px)/1 "DM Sans", sans-serif;
}

.datepick input[type="date"] {
    padding: 0 10px;
}

.chip {
    height: 42px;
    padding: 0 14px;
    border: 1px solid #b8cad8;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fb 100%);
    color: #23465a;
    font: 700 clamp(13px, 0.22vw + 12px, 15px)/1 "DM Sans", sans-serif;
    cursor: pointer;
    transition: all 150ms ease;
}

.chip:hover {
    border-color: #8db3c9;
    transform: translateY(-1px);
}

.chip-edit {
    height: 24px;
    padding: 0 9px;
    margin-left: 6px;
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    border-color: #8fb0c8;
    color: #1a4f75;
    background: linear-gradient(180deg, #f8fcff 0%, #eaf4fb 100%);
}

.chip-receipt {
    height: 24px;
    padding: 0 9px;
    margin-left: 6px;
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    border-color: #9ec1a4;
    color: #1d5a36;
    background: linear-gradient(180deg, #f7fbf8 0%, #e8f4ec 100%);
}

.card-booked {
    color: #8aa1b3;
    font-size: 0.92em;
}

.edit-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
}

.edit-modal.is-open {
    display: block;
}

.edit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 23, 31, 0.46);
    backdrop-filter: blur(2px);
}

.edit-modal-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 16px;
    border: 1px solid #c8d7e2;
    background: #f7fbff;
    box-shadow: 0 20px 48px rgba(10, 26, 37, 0.28);
    padding: 14px;
}

.edit-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
}

.edit-modal-head h3 {
    margin: 0;
    color: #193545;
    font: 700 18px/1.2 "Space Grotesk", sans-serif;
}

.edit-modal-head p {
    margin: 3px 0 0;
    color: #557185;
    font-size: 12px;
}

.edit-close {
    border: 1px solid #b4c8d7;
    border-radius: 10px;
    background: #ffffff;
    color: #1f4a63;
    padding: 6px 10px;
    font: 700 12px/1 "DM Sans", sans-serif;
    cursor: pointer;
}

.edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.edit-choice {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid #cad8e3;
    border-radius: 12px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

.edit-choice:hover {
    border-color: #8db3c9;
    background: #f3f9ff;
}

.edit-choice-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    border: 1px solid #9fc0d5;
    background: linear-gradient(180deg, #f7fcff 0%, #e8f2fa 100%);
    color: #1f4d67;
    font: 700 13px/1 "Space Grotesk", sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.edit-choice-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.edit-choice-copy strong {
    color: #1a394b;
    font-size: clamp(13px, 0.25vw + 12px, 15px);
}

.edit-choice-copy small {
    color: #617b8c;
    font-size: clamp(11px, 0.22vw + 10px, 13px);
}

.edit-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #c6d5e1;
}

.edit-form-inner {
    display: grid;
    gap: 8px;
}

.edit-hint {
    margin: 4px 0 4px;
    color: #5f7689;
    font-size: 12px;
    font-style: italic;
}

.discount-list-wrap {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
}

.discount-list-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.discount-list-head h4 {
    margin: 0 auto 0 0;
    color: #274b60;
    font: 700 13px/1 "Space Grotesk", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.discount-list-body {
    max-height: 220px;
    overflow-y: auto;
}

.discount-list-empty {
    color: #627989;
    font-size: 13px;
    padding: 10px 4px;
    text-align: center;
}

.discount-list-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 12.5px;
}

.discount-list-table th,
.discount-list-table td {
    border-bottom: 1px solid #e6ecf1;
    padding: 7px 8px;
    text-align: left;
    color: #25485e;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.discount-list-table th {
    color: #395c72;
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f5f9fc;
    position: sticky;
    top: 0;
    z-index: 1;
}

.discount-list-table tbody tr:nth-child(even) td {
    background: #fafcfd;
}

.discount-list-table tbody tr:last-child td {
    border-bottom: 0;
}

.discount-list-table code {
    font: 700 12.5px/1.1 "Space Grotesk", "DM Sans", monospace;
    color: #1c69a7;
    background: #eaf2f8;
    padding: 2px 6px;
    border-radius: 6px;
}

.edit-label {
    color: #274b60;
    font-size: clamp(12px, 0.2vw + 11px, 14px);
    font-weight: 700;
}

.edit-form input,
.edit-form select,
.edit-form textarea {
    width: 100%;
    border: 1px solid #bfd0dc;
    border-radius: 10px;
    background: #ffffff;
    color: #1d2f3a;
    font: 500 clamp(13px, 0.25vw + 12px, 15px)/1.45 "DM Sans", sans-serif;
    padding: 8px 10px;
}

.edit-note {
    margin: 0;
    color: #7a5a1a;
    font-size: clamp(11px, 0.2vw + 10px, 13px);
}

.edit-actions {
    display: flex;
    gap: 8px;
}

.audit-list {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.audit-entry {
    border: 1px solid #cad8e3;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 12px;
}

.audit-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    color: #183645;
    font-size: 14px;
}

.audit-head span {
    color: #648092;
    font-size: 12px;
}

.audit-meta,
.audit-reason,
.audit-source,
.audit-changes {
    margin-top: 4px;
    color: #385565;
    font-size: 13px;
    line-height: 1.45;
}

.audit-changes {
    color: #22485c;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(105px, 1fr));
    gap: 8px;
}

.kpi {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, #ffffff 0%, #f4f8fb 100%);
    padding: 8px 10px;
    text-align: center;
}

.kpi-label {
    display: block;
    color: var(--muted);
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.kpi-value {
    display: block;
    margin-top: 2px;
    color: #193445;
    font: 700 clamp(24px, 0.9vw + 20px, 30px)/1 "Space Grotesk", sans-serif;
}

.status-line {
    justify-self: end;
    color: var(--muted);
    font-size: clamp(12px, 0.25vw + 11px, 14px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.sync-status {
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    color: #6f8190;
}

.search {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 8px;
}

.search input[type="search"] {
    padding: 0 14px;
}

.search select {
    padding: 0 10px;
}

.columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.col,
.upcoming {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    animation: rise-in 300ms ease both;
}

.col:nth-child(1) { animation-delay: 40ms; }
.col:nth-child(2) { animation-delay: 90ms; }
.col:nth-child(3) { animation-delay: 140ms; }

.col-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fb 100%);
}

.col-head h2 {
    margin: 0 auto 0 0;
    color: #274b60;
    font: 700 clamp(13px, 0.25vw + 12px, 15px)/1 "Space Grotesk", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.count {
    min-width: 26px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid #bfd0dc;
    background: #ffffff;
    color: #30536b;
    font: 700 clamp(12px, 0.2vw + 11px, 14px)/1 "DM Sans", sans-serif;
    text-align: center;
}

.col-body {
    min-height: 100px;
    padding: 10px;
}

.upcoming {
    margin-top: 14px;
    animation-delay: 180ms;
}

.strip {
    display: flex;
    gap: 10px;
    padding: 10px;
    overflow-x: auto;
}

.strip::-webkit-scrollbar {
    height: 10px;
}

.strip::-webkit-scrollbar-thumb {
    background: #c6d5df;
    border-radius: 999px;
}

.strip .card { min-width: 305px; }

.results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 10px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.report-filters {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.report-filters label {
    color: #355466;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.report-filters input[type="date"] {
    height: 38px;
    border: 1px solid #bfd0dc;
    border-radius: 9px;
    background: #ffffff;
    color: #1d3a4b;
    font: 600 13px/1 "DM Sans", sans-serif;
    padding: 0 8px;
}

.report-kpi {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fb 100%);
    box-shadow: var(--soft-shadow);
    padding: 10px 12px;
}

.report-kpi-label {
    color: #567084;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.report-kpi-value {
    margin-top: 4px;
    color: #193445;
    font: 700 24px/1 "Space Grotesk", sans-serif;
}

.report-block {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--soft-shadow);
    overflow: hidden;
    margin-bottom: 14px;
}

.report-table-wrap {
    overflow-x: auto;
    padding: 10px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: #ffffff;
    border: 1px solid #d5e0e8;
    border-radius: 12px;
}

.report-table th,
.report-table td {
    border-bottom: 1px solid #e1e8ed;
    padding: 9px 10px;
    text-align: left;
    color: #25485e;
    font-size: 13px;
    white-space: nowrap;
}

.report-table th {
    color: #395c72;
    background: #f5f9fc;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}

.report-table tr:last-child td {
    border-bottom: 0;
}

.empty-cell {
    color: #627989;
    text-align: center;
}

#reportRecentTable td:nth-child(2),
#reportRecentTable td:nth-child(3),
#reportEventsTable td:nth-child(4),
#reportCodesTable td:nth-child(2) {
    white-space: normal;
}

.report-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #c8d7e2;
    background: #eef4f8;
    color: #36576c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.report-pill.is-alert {
    background: #fdebd3;
    border-color: #f0c788;
    color: #a4660d;
}

.report-flag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #bfe0d2;
    background: #e7f4ee;
    color: #1f7a61;
    font-size: 11px;
    font-weight: 700;
}

.report-flag.is-alert {
    border-color: #efc2c8;
    background: #fce8eb;
    color: #b13f4a;
}

/* ----- KPI delta line ----- */
.report-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font: 700 11px/1 "DM Sans", sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    min-height: 14px;
}

.report-kpi-delta.is-good { color: #1f7a61; }
.report-kpi-delta.is-bad  { color: #b13f4a; }
.report-kpi-delta.is-flat { color: #788c99; }

.report-kpi-arrow {
    font-size: 10px;
    line-height: 1;
}

/* ----- Sparkline strip ----- */
.sparkline-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.spark-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fb 100%);
    box-shadow: var(--soft-shadow);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spark-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.spark-title {
    color: #567084;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.spark-last {
    color: #1d3a4b;
    font: 700 16px/1 "Space Grotesk", sans-serif;
}

.spark-svg {
    width: 100%;
    height: 56px;
    display: block;
}

.spark-line {
    stroke: var(--accent);
    stroke-width: 1.6;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.spark-area {
    fill: rgba(28, 105, 167, 0.14);
    stroke: none;
}

.spark-dot {
    fill: var(--accent-strong);
    stroke: #ffffff;
    stroke-width: 1.4;
}

.spark-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #627989;
    font-size: 11px;
}

.spark-range {
    font-variant-numeric: tabular-nums;
    color: #8497a4;
}

/* ----- Needs Attention callout ----- */
.report-block.needs-attention {
    border-color: #f0c788;
    background: linear-gradient(180deg, #fff8ec 0%, #fff 100%);
}

.report-block.needs-attention .col-head {
    background: linear-gradient(180deg, #fdebd3 0%, #fff5e1 100%);
    border-bottom-color: #f0c788;
}

.report-block.needs-attention .col-head h2 {
    color: #8a4f0a;
}

.report-block.is-hidden {
    display: none;
}

.needs-attention-body {
    padding: 6px 0;
}

.attention-row {
    display: grid;
    grid-template-columns: 96px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f5e6cd;
}

.attention-row:last-child { border-bottom: 0; }

.attention-when-date {
    color: #8a4f0a;
    font: 700 13px/1.2 "Space Grotesk", sans-serif;
}

.attention-when-type {
    color: #a86a1f;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.attention-guest {
    color: #1f3a4b;
    font: 700 15px/1.2 "Space Grotesk", sans-serif;
}

.attention-meta {
    color: #5d6f7c;
    font-size: 12px;
    margin-top: 2px;
}

.attention-tags {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    text-align: right;
}

.attention-reason {
    color: #8a4f0a;
    font-size: 11px;
}

.attention-amount {
    color: #1d3a4b;
    font: 700 16px/1 "Space Grotesk", sans-serif;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

/* ----- Table polish: numerics + zebra + hover ----- */
.report-table tbody tr:nth-child(even) td {
    background: #fafcfd;
}

.report-table tbody tr:hover td {
    background: #eef4f8;
}

.report-table td,
.report-table th {
    font-variant-numeric: tabular-nums;
}

#reportStatusTable td:nth-child(2),
#reportStatusTable td:nth-child(3),
#reportSourceTable td:nth-child(2),
#reportSourceTable td:nth-child(3),
#reportAssetsTable td:nth-child(2),
#reportAssetsTable td:nth-child(3),
#reportAssetsTable td:nth-child(4),
#reportRecentTable td:nth-child(6),
#reportQueueTable td:nth-child(7),
#reportCodesTable td:nth-child(4),
#reportCodesTable td:nth-child(5),
#reportCodesTable td:nth-child(6),
#reportCodesTable td:nth-child(7) {
    text-align: right;
}

#reportStatusTable th:nth-child(2),
#reportStatusTable th:nth-child(3),
#reportSourceTable th:nth-child(2),
#reportSourceTable th:nth-child(3),
#reportAssetsTable th:nth-child(2),
#reportAssetsTable th:nth-child(3),
#reportAssetsTable th:nth-child(4),
#reportRecentTable th:nth-child(6),
#reportQueueTable th:nth-child(7),
#reportCodesTable th:nth-child(4),
#reportCodesTable th:nth-child(5),
#reportCodesTable th:nth-child(6),
#reportCodesTable th:nth-child(7) {
    text-align: right;
}

/* ----- CSV export button ----- */
.csv-btn {
    border: 1px solid #bfd0dc;
    border-radius: 8px;
    background: #ffffff;
    color: #1c69a7;
    padding: 5px 10px;
    font: 700 11px/1 "DM Sans", sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.csv-btn:hover {
    background: #eaf2f8;
    border-color: #a8c1d2;
}

.csv-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.card {
    margin-bottom: 10px;
    padding: 12px 13px;
    border: 1px solid #d6e1e8;
    border-radius: 13px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 7px;
    transform-origin: top center;
    animation: fade-up 220ms ease both;
}

.card:last-child { margin-bottom: 0; }

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-name {
    color: #182b39;
    font: 700 clamp(17px, 0.35vw + 15px, 20px)/1.22 "Space Grotesk", sans-serif;
}

.card-cabin {
    color: #24485f;
    font-size: clamp(13px, 0.25vw + 12px, 15px);
    font-weight: 600;
}

.card-meta {
    color: var(--muted);
    font-size: clamp(12px, 0.22vw + 11px, 14px);
}

.card-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-foot {
    color: #637786;
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    border-top: 1px dashed #d5e0e8;
    padding-top: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid #cfdae2;
    background: #f4f8fb;
    color: #3d5b6f;
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    font-weight: 600;
}

.tag.item {
    background: #eef3f7;
    border-color: #d2dee7;
    color: #496073;
}

.tag.dock {
    background: #e7f2fb;
    border-color: #bfd8ee;
    color: #1b6c9f;
}

.tag.gate {
    background: #e5f4ef;
    border-color: #bfe4d6;
    color: #1c7862;
}

.tag.access {
    background: #fcf1dd;
    border-color: #ecd3a3;
    color: #9c650b;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid #cad9e4;
    background: #edf3f8;
    color: #3d586b;
    font-size: clamp(11px, 0.2vw + 10px, 13px);
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pill[data-status="pending"] {
    background: #fff4dd;
    border-color: #f1d29a;
    color: var(--amber);
}

.pill[data-status="awaiting_payment"] {
    background: #fdebd3;
    border-color: #f0c788;
    color: #ad6f10;
}

.pill[data-status="confirmed"] {
    background: #e6f2fb;
    border-color: #c0dcf1;
    color: var(--sky);
}

.pill[data-status="checked_in"] {
    background: #e2f4ee;
    border-color: #b8e0d2;
    color: var(--mint);
}

.pill[data-status="checked_out"] {
    background: #edf2f5;
    border-color: #d4dee5;
    color: var(--slate);
}

.pill[data-status="cancelled"] {
    background: #fce8eb;
    border-color: #efc2c8;
    color: var(--rose);
}

.empty {
    border: 1px dashed #c7d6e0;
    border-radius: var(--radius-md);
    background: #f6fafc;
    color: var(--muted);
    text-align: center;
    padding: 18px 10px;
    font-size: clamp(13px, 0.22vw + 12px, 15px);
}

.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 16% 8%, #cde9db 0, transparent 34%),
        radial-gradient(circle at 88% 90%, #c7ddf0 0, transparent 30%),
        linear-gradient(170deg, #f7fbff 0%, #e6edf3 100%);
}

.auth-card {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--card-shadow);
    padding: 30px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.auth-mark {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d7a7a 0%, #11a6a6 50%, #63baf0 100%);
    color: #fff;
    font: 700 15px/1 "Space Grotesk", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-title h1 {
    margin: 0;
    color: #1f3443;
    font: 700 21px/1.1 "Space Grotesk", sans-serif;
}

.auth-title p,
.auth-copy,
.auth-foot {
    color: var(--muted);
}

.auth-title p { margin: 2px 0 0; }
.auth-copy { margin: 14px 0 20px; }
.auth-foot { margin: 16px 0 0; font-size: 12px; text-align: center; }

.btn {
    width: 100%;
    min-height: 44px;
    border-radius: 11px;
    border: 1px solid #c7d4df;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8fb 100%);
    color: #213f52;
    font: 700 14px/1 "DM Sans", sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    text-decoration: none;
    border-color: #9fb8c9;
}

.btn-google span { color: #213f52; }

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1240px) {
    .kpis {
        grid-template-columns: repeat(3, minmax(90px, 1fr));
    }

    .report-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sparkline-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

    .status-line {
        justify-self: start;
        align-items: flex-start;
    }

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

    .brand-mark {
        width: clamp(160px, 26vw, 220px);
        height: clamp(50px, 7.4vw, 68px);
    }

    .brand-title,
    .brand-sub {
        white-space: normal;
    }
}

@media (max-width: 720px) {
    .top {
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 12px;
    }

    .brand-mark {
        width: clamp(150px, 44vw, 210px);
        height: clamp(48px, 13vw, 64px);
        border-radius: 12px;
        padding: 0;
    }

    .brand-copy {
        max-width: calc(100vw - 205px);
    }

    .brand-title {
        font-size: clamp(13px, 3.8vw, 18px);
        line-height: 1.05;
    }

    .brand-sub {
        font-size: clamp(10px, 2.7vw, 12px);
    }

    .tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .page {
        padding: 14px 12px 32px;
    }

    .datepick {
        flex-wrap: wrap;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(90px, 1fr));
    }

    .search {
        grid-template-columns: 1fr;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sparkline-strip {
        grid-template-columns: 1fr;
    }

    .attention-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "when amount"
            "main amount"
            "tags tags";
        gap: 6px 10px;
    }

    .attention-when { grid-area: when; }
    .attention-main { grid-area: main; }
    .attention-tags { grid-area: tags; align-items: flex-start; text-align: left; }
    .attention-amount { grid-area: amount; }

    .report-filters {
        width: 100%;
    }

    .edit-grid {
        grid-template-columns: 1fr;
    }

    .edit-actions {
        flex-wrap: wrap;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   ACCOUNTING MODULE STYLES
   ───────────────────────────────────────────────────────────────────────────── */

/* Toolbar */
.acct-toolbar { flex-direction: column; gap: 8px; padding: 12px 16px; }
.acct-range-row, .acct-filter-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.acct-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.acct-meta { margin-left: auto; font-size: 12px; color: var(--muted); }

/* Sub-navigation */
.acct-subnav {
    display: flex; flex-wrap: wrap; gap: 2px;
    padding: 8px 16px 0;
    border-bottom: 2px solid var(--line);
    background: var(--paper);
}
.acct-tab {
    padding: 6px 14px; border: none; background: transparent;
    font-size: 12px; font-weight: 500; color: var(--muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
    border-radius: 3px 3px 0 0;
}
.acct-tab:hover { color: var(--accent); background: var(--bg); }
.acct-tab.is-active {
    color: var(--accent-strong); border-bottom-color: var(--accent);
    background: var(--paper);
}

/* Panels */
.acct-panel { padding: 0; }
.acct-panel.is-hidden { display: none; }

/* Summary cards grid */
.acct-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 16px;
    background: var(--bg);
    border-radius: 6px;
    margin-bottom: 16px;
}
.acct-summary-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px 16px;
    transition: box-shadow 0.15s;
}
.acct-summary-card.highlight {
    border-color: var(--accent);
    background: #eef5ff;
}
.acct-card-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--muted); margin-bottom: 4px;
}
.acct-card-value {
    font-size: 18px; font-weight: 700; color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.acct-summary-card.highlight .acct-card-value { color: var(--accent-strong); }

/* Export row */
.acct-export-row { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.col-head .acct-export-row { margin-top: 0; }

/* Smaller chip variant */
.chip-sm { padding: 3px 8px; font-size: 11px; }
.chip-danger {
    background: #ffeaea; color: #c33; border-color: #f5bcbc;
}
.chip-danger:hover { background: #f5bcbc; }

/* Occupancy bar */
.occ-bar {
    display: inline-block; width: 60px; height: 8px;
    background: var(--line); border-radius: 4px; vertical-align: middle;
    margin-right: 6px; overflow: hidden;
}
.occ-bar span {
    display: block; height: 100%;
    background: var(--accent); border-radius: 4px;
    min-width: 2px;
}

/* Money alignment */
.money { text-align: right; font-variant-numeric: tabular-nums; }
.refund-amt { color: #c44; }

/* Empty state */
.acct-empty { color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

/* Schedule actions */
.acct-sched-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Modal (shared base already exists; these are accounting-specific additions) */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.modal-overlay.is-hidden { display: none; }
.modal-box {
    background: var(--paper); border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,.25);
    width: 100%; max-width: 560px;
    max-height: 90vh; overflow-y: auto;
    display: flex; flex-direction: column;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--muted); line-height: 1; padding: 0 4px;
}
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.modal-field input, .modal-field select {
    padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px;
    font-size: 13px; background: var(--bg); color: var(--ink);
}
.modal-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.modal-check-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.modal-check-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.modal-error { color: #c44; font-size: 12px; padding: 6px 10px; background: #ffeaea; border-radius: 4px; }
.modal-foot {
    display: flex; gap: 8px; justify-content: flex-end; align-items: center;
    padding: 12px 20px; border-top: 1px solid var(--line);
}
.btn-primary {
    padding: 8px 18px; background: var(--accent); color: #fff;
    border: none; border-radius: 5px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-strong); }

/* Responsive accounting */
@media (max-width: 700px) {
    .acct-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .acct-subnav { overflow-x: auto; flex-wrap: nowrap; }
    .modal-row { grid-template-columns: 1fr; }
}
