/* 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: 960px;
}

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

.header {
    background: var(--green-dark);
    color: var(--white);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.header__subtitle {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ── 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: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-overlay {
    position: fixed;
    inset: 0;
    background: var(--green-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: var(--white);
}

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

.pin-overlay__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.pin-input {
    width: 200px;
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    padding: 0.75rem;
    border: 2px solid var(--green-accent);
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    margin-bottom: 1rem;
}

.pin-input::placeholder { color: rgba(255,255,255,0.3); }

.pin-error {
    color: var(--red-500);
    font-size: 0.85rem;
    min-height: 1.2em;
}

/* ── 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); }
}
