/* ClubhouseOS — Dark green, white, light gray palette */
:root {
    --green-dark: #1B4332;
    --green-mid: #2D6A4F;
    --green-light: #40916C;
    --green-accent: #52B788;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --red-500: #EF4444;
    --amber-500: #F59E0B;
    --blue-500: #3B82F6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────── */

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem;
}

.container--wide {
    max-width: 1600px;
}

/* ── Header ─────────────────────────────────────────── */

.header {
    background: #111;
    color: var(--white);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.header__logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.header__subtitle {
    font-size: 0.75rem;
    color: var(--green-accent);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ── Sub-header (colored bar below main header) ────── */

.sub-header {
    background: var(--green-dark);
    color: var(--white);
    padding: 0.4rem 1.25rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Sidebar nav ───────────────────────────────────── */

.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 56px;
    background: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0.75rem;
    gap: 0.25rem;
    z-index: 50;
    transition: width 0.2s;
    overflow: hidden;
}

.sidebar:hover { width: 208px; }

/* Group headings. Hidden at rest with the labels - at 56px there is no room
   for words, and a truncated heading is worse than none. The rail scrolls
   because the full destination list is longer than a short viewport. */
.sidebar { overflow-y: auto; overflow-x: hidden; align-items: stretch; }
.sidebar__group {
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0.9rem 0 0.25rem 1.05rem;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
    white-space: nowrap;
    pointer-events: none;
}
.sidebar:hover .sidebar__group { opacity: 1; }
/* Align the icon column with .sidebar__group's indent so nothing shifts
   sideways as the rail expands. Must come AFTER the .sidebar__link
   shorthand below or the shorthand's `padding` resets it - same
   specificity, later wins. */

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.85rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s;
    border-radius: 0 8px 8px 0;
}
.sidebar__link { padding-left: 1.05rem; }
.sidebar__link:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar__link--active { color: #52B788; background: rgba(82,183,136,0.1); }
.sidebar__icon { flex-shrink: 0; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar__icon svg { width: 20px; height: 20px; display: block; }
.sidebar__label { opacity: 0; transition: opacity 0.15s; }
.sidebar:hover .sidebar__label { opacity: 1; }

.sidebar__divider {
    width: 32px; height: 1px; background: rgba(255,255,255,0.1);
    margin: 0.4rem 0;
}

.has-sidebar { margin-left: 56px; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .has-sidebar { margin-left: 0; }
}

/* ── Cards ──────────────────────────────────────────── */

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 1rem;
}

/* ── Forms ──────────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--white);
    transition: border-color 0.15s;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    padding: 0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green-accent);
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
    background: var(--green-dark);
    color: var(--white);
}

.btn--primary:hover { background: var(--green-mid); }

.btn--secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn--small {
    width: auto;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

/* ── PIN gate ───────────────────────────────────────── */

/* PIN gate — sleek centered card layout. Brand-cohesive (dark green
   gradient + gold accents). All staff entry points share this. */
.pin-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, #1B4332 0%, #0d2b1f 50%, #071a11 100%);
    display: flex;
    flex-direction: column;
    align-items: safe center;
    justify-content: safe center;
    z-index: 100;
    color: #fff;
    padding: 1.25rem 1rem 2.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Scroll the overlay itself — when the on-screen keyboard appears
       the input would otherwise be trapped behind it on smaller phones,
       and the centered logo+title would push the input off-screen. */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pin-overlay.hidden { display: none; }

/* If the markup doesn't already include a logo, the ::before tag drops
   one in automatically so every PIN gate has the same look. Pages that
   ship their own logo (index.html) suppress it via .pin-overlay--no-auto */
.pin-overlay:not(.pin-overlay--no-auto)::before {
    content: ""; display: block;
    width: 56px; height: 56px;
    /* Tenant logo via a CSS variable, NOT a hardcoded file. A stylesheet
       cannot read tenant_config, so every PIN gate in the app rendered
       Eagle Vale's logo on every deployment - including the sales demo.
       Templates that set --club-logo (see base head include) override it;
       the fallback keeps existing pages working unchanged. */
    background-image: var(--club-logo, url("/static/clubhouseos-logo.png"));
    background-size: contain; background-repeat: no-repeat; background-position: center;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.pin-overlay__title {
    font-size: 0.7rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #DAA520;
}

.pin-input {
    width: 220px;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(218,165,32,0.4);
    border-radius: 10px;
    background: rgba(0,0,0,0.25);
    color: #fff;
    margin-bottom: 0.7rem;
    font-weight: 700;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pin-input:focus {
    outline: none;
    border-color: #DAA520;
    box-shadow: 0 0 0 3px rgba(218,165,32,0.15);
}
.pin-input::placeholder { color: rgba(255,255,255,0.18); font-weight: 600; }

.pin-error {
    color: #fca5a5;
    font-size: 0.82rem;
    min-height: 1.2em;
    font-weight: 600;
}

/* ── Success state ──────────────────────────────────── */

.success-msg {
    text-align: center;
    padding: 2rem;
}

.success-msg__icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.success-msg__text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-dark);
}

.success-msg__sub {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ── Console ────────────────────────────────────────── */

.tabs {
    display: flex;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs__tab {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.tabs__tab--active {
    color: var(--green-dark);
    border-bottom-color: var(--green-dark);
}

.tab-content { display: none; }
.tab-content--active { display: block; }

/* ── Feed ───────────────────────────────────────────── */

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.feed-item:last-child { border-bottom: none; }

.feed-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.4rem;
    flex-shrink: 0;
}

.feed-dot--walkin { background: var(--blue-500); }
.feed-dot--freeround { background: var(--amber-500); }
.feed-dot--teeoff { background: var(--green-accent); }

.feed-item__text {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.feed-item__time {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.15rem;
}

/* ── Exception badges ───────────────────────────────── */

.exception {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.exception--warning {
    background: #FEF3C7;
    color: #92400E;
}

.exception--info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ── Scoreboard ─────────────────────────────────────── */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--green-dark);
}

.stat-card__label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.2rem;
}

/* ── QR codes page ──────────────────────────────────── */

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.qr-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.5rem;
    text-align: center;
}

.qr-card img {
    width: 200px;
    height: 200px;
}

.qr-card__label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-top: 0.75rem;
}

.qr-card__location {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.qr-card__url {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
    word-break: break-all;
}

/* ── Nav links (landing page) ───────────────────────── */

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.nav-link:last-child { border-bottom: none; }

.nav-link:active { background: var(--gray-50); }

.nav-link__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-link__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
}

.nav-link__desc {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

/* ── Touchpoint feed dot ───────────────────────────── */

.feed-dot--touchpoint { background: var(--green-light); }
.feed-dot--cart { background: var(--amber-500); }

/* ── Session banner ────────────────────────────────── */

.session-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.session-banner__name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--green-dark);
}

/* ── Status badges ─────────────────────────────────── */

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge--active {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge--completed {
    background: var(--gray-200);
    color: var(--gray-700);
}

.status-badge--expired {
    background: #FEE2E2;
    color: #991B1B;
}

/* ── Journey timeline ──────────────────────────────── */

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--gray-200);
}

.timeline__item {
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__dot {
    position: absolute;
    left: -1.5rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green-accent);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--green-accent);
    z-index: 1;
}

.timeline__dot--last {
    background: var(--green-dark);
    box-shadow: 0 0 0 2px var(--green-dark);
}

.timeline__content {
    padding-left: 0.5rem;
}

.timeline__station {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-900);
}

.timeline__time {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

.timeline__amount {
    font-size: 0.85rem;
    color: var(--green-dark);
    font-weight: 500;
    margin-top: 0.2rem;
}

.timeline__staff {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.1rem;
}

.timeline__notes {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-style: italic;
    margin-top: 0.1rem;
}

.timeline__gap {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    margin-top: 0.4rem;
}

/* ── Print styles ───────────────────────────────────── */

@media print {
    body { background: white; }
    .header, .tabs { display: none; }
    .qr-card { break-inside: avoid; box-shadow: none; border: 1px solid var(--gray-200); }
}

/* ── Staff landing / hub pages ─────────────────────────────────────
   Shared styles for /staff role-picker and any sub-hub (e.g. Outside
   Golf Services). index.html keeps an inline copy too; this block is
   what every other landing-style page picks up via style.css. */
.landing-body {
    margin: 0; padding: 2rem 1rem 4rem;
    background: #0a1f15;
    min-height: 100vh;
    display: flex; align-items: safe center; justify-content: safe center;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Used by /staff and other landing-style hub pages. The inline copy
       in index.html mirrors this. overflow:hidden trapped scroll when
       content exceeded the viewport — the .landing-bg/.landing-grain
       layers are position:fixed so they self-clip without needing it. */
}
/* Below 768px, drop flex centering entirely. Older iOS Safari (<16.4)
   silently ignores 'safe' on align/justify and falls back to plain
   center, which pushes overflowing content above the viewport. Block
   layout is universally scrollable. */
@media (max-width: 768px) {
    .landing-body { display: block; padding: 1.5rem 1rem 3rem; }
}

.landing-bg {
    position: fixed; inset: 0; z-index: 0;
    background: radial-gradient(ellipse at 50% 0%, #1B4332 0%, #0d2b1f 50%, #071a11 100%);
}

.landing-grain {
    position: fixed; inset: 0; z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.landing-container {
    position: relative; z-index: 2;
    max-width: 460px; width: 100%; padding: 2rem 1.5rem;
}

.landing-header { text-align: center; margin-bottom: 2.5rem; position: relative; }

.landing-logo-glow {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
    width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(82,183,136,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.landing-logo {
    height: 72px; margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
    position: relative;
}

.landing-title {
    color: white; font-size: 2rem; font-weight: 800;
    letter-spacing: 0.04em; line-height: 1;
}
.landing-title span { color: #52B788; }

.landing-subtitle {
    color: rgba(255,255,255,0.4); font-size: 0.9rem;
    margin-top: 0.4rem; letter-spacing: 0.05em;
}

.landing-status {
    display: inline-flex; align-items: center; gap: 0.4rem;
    margin-top: 0.75rem; padding: 0.3rem 0.8rem;
    background: rgba(82,183,136,0.1); border: 1px solid rgba(82,183,136,0.2);
    border-radius: 20px; font-size: 0.75rem; color: #52B788; font-weight: 600;
    letter-spacing: 0.03em;
}
.landing-status__dot {
    width: 6px; height: 6px; border-radius: 50%; background: #52B788;
    animation: pulse-dot 2s ease-in-out infinite;
}

.landing-beta {
    margin-top: 0.9rem; padding: 0.55rem 0.85rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(218,165,32,0.4);
    border-radius: 8px;
    display: inline-flex; align-items: center; gap: 0.55rem;
    font-size: 0.78rem; line-height: 1.35;
    color: rgba(255,255,255,0.78);
    text-align: left;
}
.landing-beta svg { color: #DAA520; flex-shrink: 0; }
.landing-beta b { color: #DAA520; font-weight: 900; letter-spacing: 0.04em; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(82,183,136,0.4); }
    50%      { opacity: 0.7; box-shadow: 0 0 0 4px rgba(82,183,136,0); }
}

.landing-grid { display: grid; gap: 0.6rem; }

.lt {
    display: flex; align-items: center; gap: 0.9rem;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; padding: 1rem 1.15rem;
    text-decoration: none; color: inherit;
    transition: all 0.2s ease;
}
.lt:hover { background: rgba(255,255,255,0.1); border-color: rgba(82,183,136,0.3); transform: translateX(4px); }
.lt:active { transform: scale(0.98); }

.lt__icon {
    width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: #DAA520;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(218,165,32,0.3);
}
.lt__icon--blue, .lt__icon--green, .lt__icon--orange, .lt__icon--dark, .lt__icon--gold {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(218,165,32,0.3);
    color: #DAA520;
}

.lt__body { flex: 1; min-width: 0; }
.lt__label { font-size: 1rem; font-weight: 700; color: white; }
.lt__desc { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 0.15rem; }

.lt__arrow {
    font-size: 1.5rem; color: rgba(255,255,255,0.15);
    font-weight: 300; flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}
.lt:hover .lt__arrow { color: #52B788; transform: translateX(2px); }

.landing-footer {
    text-align: center; margin-top: 1.5rem;
    color: rgba(255,255,255,0.15); font-size: 0.7rem;
    letter-spacing: 0.03em;
}
