/* =====================================================================
   Order At Tee Platform — light theme.
   Palette inherited from the Nomvo Platform Admin Dashboard fork this
   repo started from (verdigris/amber/rust/ink) — kept as a
   self-contained :root here (rather than importing a shared tokens.css)
   since this is a separate, single-purpose repo.
   ===================================================================== */

:root {
    --bg:        #F4F5F2; /* canvas */
    --surface:   #FFFFFF; /* surface-card */
    --surface-2: #ECEEE9; /* surface-sunken (ink-100) */
    --line:      #DFE2DB; /* border-subtle (ink-200) */
    --text:      #161815; /* ink-900 */
    --muted:     #6B6F68; /* ink-500 */
    --accent:    #0E6F5C; /* verdigris-600 */
    --accent-2:  #0A5648; /* verdigris-700 */
    --ok:        #1E7A50; /* success */
    --warn:      #B9791F; /* amber-600 */
    --danger:    #B23A2E; /* rust-600 */
    --radius:    10px;
}

@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/sora-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-variable.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2');
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent-2); }

code {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---- Top bar ---- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 28px; }
.brand {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.2px;
}
.brand-sub { color: var(--muted); font-weight: 400; }
.topbar-nav { display: flex; gap: 18px; }
.topbar-nav a { color: var(--muted); font-size: 13px; text-decoration: none; }
.topbar-nav a:hover { color: var(--text); }

.logout-form button {
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 6px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
}
.logout-form button:hover { color: var(--text); border-color: var(--accent); }

/* ---- Page ---- */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-head h1 { margin: 0; font-family: 'Sora', sans-serif; font-size: 22px; }

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.metric-card.metric-warn { border-color: var(--warn); }
.metric-value { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 600; }
.metric-label { color: var(--muted); font-size: 12px; }

/* ---- Filters ---- */
.filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.filter-row input, .filter-row select {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
}
.filter-row input { flex: 1 1 260px; }
.show-cancelled-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
}
.show-cancelled-toggle input { margin: 0; }

/* ---- Table ---- */
.table-scroll { width: 100%; overflow-x: auto; }
.club-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.club-table th, .club-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.club-table th {
    color: var(--muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.club-table .num {
    text-align: right;
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
    font-variant-numeric: tabular-nums;
}
.club-table tbody tr:last-child td { border-bottom: none; }
.club-table tbody tr:hover { background: var(--surface-2); }
.club-table tbody tr.is-hidden { display: none; }

.stripe-link {
    display: inline-block;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    white-space: nowrap;
}
.stripe-link:hover { border-color: var(--accent); }

.inline-form { display: inline-block; margin-left: 8px; }
.link-danger {
    background: none;
    border: none;
    padding: 0;
    color: var(--danger);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}
.link-danger:hover { color: #ff6b63; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-active         { background: rgba(63, 185, 80, 0.15); color: var(--ok); }
.badge-onboarding     { background: rgba(210, 153, 34, 0.15); color: var(--warn); }
.badge-restricted     { background: rgba(248, 81, 73, 0.15); color: var(--danger); }
.badge-unknown        { background: rgba(139, 150, 165, 0.15); color: var(--muted); }
.badge-cancelled      { background: rgba(139, 150, 165, 0.15); color: var(--muted); }
.badge-submitted      { background: rgba(63, 185, 80, 0.15); color: var(--ok); }
.badge-not-submitted  { background: rgba(139, 150, 165, 0.15); color: var(--muted); }
.badge-custom         { background: rgba(210, 153, 34, 0.15); color: var(--warn); margin-left: 6px; }

/* ---- Flash ---- */
.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; font-size: 14px; }
.flash-error { background: rgba(248, 81, 73, 0.12); color: var(--danger); border: 1px solid rgba(248, 81, 73, 0.3); }

/* ---- Login page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px 28px;
}
.login-card .brand { display: block; margin-bottom: 20px; }
.login-card h1 { font-family: 'Sora', sans-serif; font-size: 18px; margin: 0 0 16px; }

.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.form input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 14px;
}
.form input:focus { outline: none; border-color: var(--accent); }

.btn-primary {
    margin-top: 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover { background: var(--accent-2); }

.version-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 14px 24px;
}
.version-card-text { margin: 0; }
.version-card-form { margin: 0; }
.version-card-form .btn-primary { margin-top: 0; }

/* ---- OAT-6: small inline buttons, form selects/textareas, filter labels ---- */
.btn-primary.btn-sm { margin-top: 0; padding: 8px 14px; font-size: 13px; }
a.btn-primary.btn-sm { display: inline-block; text-decoration: none; }

.form select, .form textarea {
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}
.form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }

.filter-row .filter-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}
/* .filter-row input's own flex-basis:260px (above) is meant for a
   row-direction flex context; .filter-label is flex-direction:column,
   so that same flex-basis was setting the input's preferred HEIGHT to
   260px instead of width (flex-basis follows the main axis, which is
   vertical in a column), and flex-grow:1 let it stretch even taller —
   the giant date-input boxes this was written to fix. Reset both
   explicitly to a normal, fixed-width field instead. */
.filter-row .filter-label input, .filter-row .filter-label select {
    flex: 0 0 auto;
    width: 200px;
    max-width: 100%;
    font-size: 14px;
}
.filter-row .btn-sm { align-self: flex-end; }

.metric-card.metric-highlight { border-color: var(--accent); background: rgba(14, 111, 92, 0.06); }

.fulfil-qr { line-height: 0; }
.fulfil-qr img { display: block; width: 72px; height: 72px; image-rendering: pixelated; }
.fulfil-qr-download { display: inline-block; margin-top: 4px; font-size: 12px; }

.qr-location-name { margin: 16px 0 4px; font-size: 14px; }
.qr-location-name:first-of-type { margin-top: 4px; }
.qr-point-list { list-style: none; margin: 0 0 8px; padding: 0; }
.qr-point-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.qr-point-row:last-child { border-bottom: none; }
.qr-point-canvas { line-height: 0; }
.qr-point-canvas img { display: block; width: 40px; height: 40px; image-rendering: pixelated; }
.qr-point-download { font-size: 12px; }
