/* 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;
}

.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%);
}

.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-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;
}

.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;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f2f7fb 100%);
}

.col-head h2 {
    margin: 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;
}

.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));
    }
}

@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;
    }

    .edit-grid {
        grid-template-columns: 1fr;
    }

    .edit-actions {
        flex-wrap: wrap;
    }
}
