/* Yoga Booking — design tokens */
:root {
    --bg: #f5ead8;
    --panel: #ebddc5;
    --text: #201e1d;
    --muted-45: rgba(32,30,29,.45);
    --muted-55: rgba(32,30,29,.55);
    --muted-6: rgba(32,30,29,.6);
    --muted-7: rgba(32,30,29,.7);
    --border: rgba(32,30,29,.16);
    --tag-neutral: rgba(32,30,29,.07);
    --accent: #c67139;
    --accent-hover: #b2622d;
    --accent-on: #f5ead8;
    --admin: #7a8a5e;
    --admin-hover: #728157;
    --level-bg: #e1eecc;
    --level-fg: #3d472b;
    --warn-bg: #ffe1d0;
    --warn-fg: #8c491a;
    --danger-bg: #fed7d7;
    --danger-fg: #c53030;
    --font-display: 'Caprasimo', serif;
    --font-body: 'Figtree', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
input:focus, textarea:focus, button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(198,113,57,.25); }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 0 20px;
    min-height: 48px;
    border-radius: 999px;
    transition: background .2s, transform .1s;
}
.btn:active { transform: scale(0.98); }
.btn-full { width: 100%; }
.btn-small { padding: 6px 14px; font-size: 13px; min-height: auto; }

.btn-primary {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 17px;
    min-height: 52px;
    background: var(--accent);
    color: var(--accent-on);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-admin { background: var(--admin); color: var(--accent-on); }
.btn-admin:hover { background: var(--admin-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--tag-neutral); }

.btn-ghost {
    background: transparent;
    color: var(--accent-hover);
    min-height: 44px;
}
.btn-ghost:hover { text-decoration: underline; }

.btn-danger { background: var(--danger-bg); color: var(--danger-fg); }
.btn-danger:hover { background: #fbb; }

/* ── Messages ───────────────────────────────────────────────────────── */
.message { margin-top: .75rem; padding: .6rem 1rem; border-radius: 12px; font-size: .9rem; display: none; }
.message.success { display: block; background: var(--level-bg); color: var(--level-fg); }
.message.error { display: block; background: var(--danger-bg); color: var(--danger-fg); }
.message.info { display: block; background: var(--warn-bg); color: var(--warn-fg); }

/* ── Auth ───────────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-wrap { width: 100%; max-width: 380px; }

.auth-form { display: none; flex-direction: column; }
.auth-form.active { display: flex; }

.auth-mark { width: 64px; height: 64px; border-radius: 999px; background: var(--accent); margin-bottom: 28px; }

.auth-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: -.015em;
    margin-bottom: 8px;
}

.auth-subtitle { font-size: 15px; color: var(--muted-55); margin-bottom: 28px; }

.form-group { margin-bottom: 12px; }

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    min-height: 52px;
    padding: 6px 20px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.code-input {
    text-align: center;
    font-family: var(--font-display);
    font-size: 24px !important;
    letter-spacing: .4rem;
    min-height: 60px !important;
}

.auth-form .btn { margin-top: 8px; }

.auth-links {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    color: var(--muted-55);
}
.auth-links a { color: var(--warn-fg); font-weight: 600; }

/* ── Shell layout ───────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar { display: none; }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-dot { width: 36px; height: 36px; border-radius: 999px; background: var(--accent); flex: none; }
.brand-dot-admin { background: var(--admin); }
.brand-name { font-family: var(--font-display); font-size: 20px; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-link {
    text-align: left;
    border: none;
    cursor: pointer;
    background: transparent;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
}
.side-link.active { background: var(--accent); color: var(--accent-on); }
#admin-sidebar .side-link.active { background: var(--admin); }

.count-badge { font-size: 12px; }
.count-badge:empty { display: none; }

.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 36px; height: 36px; flex: none;
    border-radius: 999px;
    background: var(--admin);
    color: var(--accent-on);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 15px;
}
.avatar-admin { background: var(--accent); }
.avatar-btn { cursor: pointer; width: 40px; height: 40px; font-size: 16px; background: var(--accent); }
.side-user-name { font-weight: 600; font-size: 14px; }
.side-user-role { font-size: 12px; color: var(--muted-55); }

.back-to-app-btn { margin-top: 10px; }

/* ── Topbar & tabs ──────────────────────────────────────────────────── */
.app-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 26px 24px 0;
}
.app-topbar h2 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.subtitle { font-size: 13px; color: var(--muted-55); margin-top: 2px; }

.pill-tabs { display: flex; gap: 6px; padding: 16px 24px 12px; flex-wrap: wrap; }
.pill-tab {
    border: none; cursor: pointer;
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
    padding: 9px 16px; border-radius: 999px;
    background: var(--tag-neutral); color: var(--text);
    display: flex; align-items: center; gap: 4px;
}
.pill-tab.active { background: var(--accent); color: var(--accent-on); }
#admin-tabs .pill-tab.active { background: var(--admin); }

.tab-content { display: none; flex: 1; min-height: 0; padding: 4px 24px 100px; }
.tab-content.active { display: block; }

.hint-text { font-size: 13px; color: var(--muted-55); margin: 12px 0; }

/* ── Class list ─────────────────────────────────────────────────────── */
.day-group { margin-top: 20px; }
.day-group:first-child { margin-top: 8px; }
.day-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.day-weekday { font-family: var(--font-display); font-size: 19px; }
.day-date { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-45); }

.class-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-top: 1px solid var(--border);
    cursor: pointer; width: 100%; text-align: left;
    background: none; border-left: none; border-right: none;
}
.class-row:hover { background: rgba(32,30,29,.03); }
.class-time { width: 52px; flex: none; font-family: var(--font-display); font-size: 17px; }
.class-main { flex: 1; min-width: 0; }
.class-name { font-weight: 600; font-size: 16px; }
.class-meta { font-size: 13px; color: var(--muted-55); margin-top: 1px; }

.pill-status { flex: none; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.pill-status.status-open { background: var(--level-bg); color: var(--level-fg); }
.pill-status.status-few { background: var(--warn-bg); color: var(--warn-fg); }
.pill-status.status-full { background: var(--tag-neutral); color: var(--muted-6); }
.pill-status.status-booked { background: var(--accent); color: var(--accent-on); }

.featured-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.featured-row {
    display: block; width: 100%; text-align: left; cursor: pointer;
    background: var(--warn-bg); border: none; border-radius: 20px; padding: 14px 18px;
}
.featured-row:hover { background: #ffd8bd; }
.featured-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--warn-fg); }
.featured-name { font-family: var(--font-display); font-size: 19px; margin-top: 3px; }
.featured-meta { font-size: 13px; color: rgba(32,30,29,.6); margin-top: 2px; }

.empty-state { padding: 56px 0; text-align: center; color: var(--muted-45); font-size: 15px; }

.tag { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.tag-level { background: var(--level-bg); color: var(--level-fg); }
.tag-neutral { background: var(--tag-neutral); }

/* ── Detail pane / sheet ────────────────────────────────────────────── */
.detail-pane {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--panel);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 32px rgba(46,43,37,.22);
    padding: 22px 24px 28px;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.22,1,.36,1);
    max-height: 85vh;
    overflow-y: auto;
    z-index: 60;
}
.detail-pane.open { transform: translateY(0); }
.detail-pane::before {
    content: ""; display: block; width: 44px; height: 4px; border-radius: 999px;
    background: rgba(32,30,29,.16); margin: 0 auto 18px;
}

.scrim {
    position: fixed; inset: 0; background: rgba(32,30,29,.42);
    opacity: 0; pointer-events: none; transition: opacity .28s ease; z-index: 55;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.admin-pane {
    top: 0; border-radius: 0; box-shadow: none; max-height: none;
    transform: translateX(100%);
}
.admin-pane.open { transform: translateX(0); }
.admin-pane::before { display: none; }

.pane-empty { display: flex; flex-direction: column; }
.pane-icon { width: 56px; height: 56px; border-radius: 999px; background: var(--accent); margin-bottom: 18px; }
.admin-pane .pane-icon { background: var(--admin); }
.pane-empty h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.1; margin-bottom: 6px; }
.pane-empty p { font-size: 15px; color: var(--muted-6); }

.sheet-eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-45); }
.sheet-title { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; margin: 4px 0 6px; }
.sheet-desc { font-size: 15px; color: var(--muted-55); margin-bottom: 16px; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.sheet-action-btn { width: 100%; }
.sheet-status-badge {
    width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--accent); color: var(--accent-on);
    font-family: var(--font-display); font-size: 17px;
}

.sheet-participants { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.btn-link { background: none; border: none; color: var(--accent-hover); cursor: pointer; font-size: 13px; font-weight: 600; padding: 0; }
.participants-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.participant-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.participant-item input[type="checkbox"] { margin: 0; }
.badge-noshow { background: var(--danger-bg); color: var(--danger-fg); padding: .1rem .5rem; border-radius: 999px; font-size: 11px; margin-left: auto; }
.participant-empty { font-size: 13px; color: var(--muted-45); font-style: italic; }
.confirm-attendance-btn { margin-top: 10px; }

/* ── Recommendation banner ──────────────────────────────────────────── */
.rec-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 400px; margin: 0 auto;
    background: var(--panel); border-radius: 28px; box-shadow: 0 12px 32px rgba(46,43,37,.22);
    padding: 22px; z-index: 70;
}
.rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rec-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.15; }
.rec-close {
    width: 30px; height: 30px; flex: none; border-radius: 999px; background: var(--tag-neutral);
    display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; border: none;
}
.rec-card { margin-top: 14px; background: var(--bg); border-radius: 20px; padding: 14px 16px; }
.rec-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rec-card-name { font-weight: 600; font-size: 16px; }
.rec-card-time { font-family: var(--font-display); font-size: 17px; color: var(--accent-hover); }
.rec-card-meta { font-size: 13px; color: var(--muted-55); margin-top: 1px; }
.rec-note { margin-top: 10px; font-size: 13px; color: var(--muted-55); }
.rec-book-btn {
    width: 100%; min-height: 50px; margin-top: 14px;
    background: var(--accent); color: var(--accent-on); border: none; border-radius: 999px;
    font-family: var(--font-display); font-size: 16px; cursor: pointer;
}
.rec-book-btn:hover { background: var(--accent-hover); }

/* ── You tab ────────────────────────────────────────────────────────── */
.insight-item { padding: 12px 16px; border-radius: 20px; font-size: 13px; margin: 16px 0; }
.insight-lapsed { background: var(--warn-bg); color: var(--warn-fg); }
.insight-streak { background: var(--level-bg); color: var(--level-fg); }
.insight-no_show_warning { background: var(--danger-bg); color: var(--danger-fg); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat-tile { border-radius: 28px; padding: 18px; background: var(--panel); }
.stat-tile.tile-alt { background: var(--level-bg); color: var(--level-fg); }
.stat-num { font-family: var(--font-display); font-size: 32px; line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted-55); margin-top: 4px; }
.tile-alt .stat-label { color: var(--level-fg); opacity: .8; }

.you-section { margin-top: 26px; }
.section-title { font-family: var(--font-display); font-size: 19px; margin-bottom: 6px; }

.unrated-item { padding: 14px 0; border-top: 1px solid var(--border); }
.unrated-name { font-weight: 600; font-size: 15px; }
.unrated-when { font-size: 13px; color: var(--muted-55); margin-top: 1px; }
.star-row { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.star {
    width: 34px; height: 34px; border-radius: 999px; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    background: var(--tag-neutral); color: var(--muted-45); transition: transform .1s;
}
.star:hover { transform: scale(1.1); }
.star-saved { font-size: 13px; color: var(--level-fg); font-weight: 600; }

.you-actions { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ── Admin: Today ───────────────────────────────────────────────────── */
.stats-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.stats-row .stat-tile { flex: 1; min-width: 100px; }

.today-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.today-time { width: 52px; flex: none; font-family: var(--font-display); font-size: 17px; padding-top: 2px; }
.today-main { flex: 1; min-width: 0; }
.today-name { font-weight: 600; font-size: 16px; }
.today-meta { font-size: 13px; color: var(--muted-55); margin-top: 1px; }
.fill-bar { margin-top: 8px; height: 8px; border-radius: 999px; background: var(--tag-neutral); overflow: hidden; }
.fill-bar-inner { height: 100%; border-radius: 999px; background: var(--admin); }
.today-pill { flex: none; align-self: flex-start; margin-top: 2px; }

.prompt-card { margin-top: 22px; background: var(--level-bg); border-radius: 24px; padding: 16px 18px; }
.prompt-card h4 { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.prompt-card p { font-size: 13px; color: rgba(32,30,29,.6); margin-top: 2px; }
.prompt-card .btn { margin-top: 12px; }

/* ── Admin: Classes ─────────────────────────────────────────────────── */
.admin-class-card { background: var(--panel); border-radius: 28px; padding: 18px 20px; margin-top: 12px; cursor: pointer; }
.admin-class-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.admin-class-name { font-family: var(--font-display); font-size: 21px; }
.admin-class-inst { font-size: 13px; color: var(--muted-55); }
.admin-class-meta { font-size: 13px; color: var(--muted-55); margin-top: 2px; }
.session-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.session-chip { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--bg); }
.session-chip-edit { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; color: var(--warn-fg); }

.pin-toggle-btn {
    flex: none; width: 30px; height: 30px; border-radius: 999px; border: none; cursor: pointer;
    background: var(--tag-neutral); font-size: 14px; opacity: .5;
    display: flex; align-items: center; justify-content: center;
}
.pin-toggle-btn.active { background: var(--warn-bg); opacity: 1; }

/* ── Admin: editor ──────────────────────────────────────────────────── */
.editor-title { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin-bottom: 18px; }
.editor-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.editor-pin-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; cursor: pointer; }
.editor-label { font-size: 12px; color: var(--muted-7); }
.editor-input, .editor-textarea {
    width: 100%; padding: 6px 18px; font-family: var(--font-body); font-size: 15px;
    color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; min-height: 46px;
}
.editor-textarea { border-radius: 22px; min-height: 80px; padding: 12px 18px; resize: vertical; }
.editor-row { display: flex; gap: 10px; }
.editor-row .editor-field { flex: 1; }
.editor-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.editor-pill {
    font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 999px; cursor: pointer;
    background: var(--bg); border: 1px solid var(--border);
}
.editor-pill.active { background: var(--admin); color: var(--accent-on); border-color: transparent; }
.editor-sessions-title { font-family: var(--font-display); font-size: 18px; margin-bottom: 8px; }
.editor-session-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.editor-session-row input {
    background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
    padding: 8px 14px; font-family: var(--font-body); font-size: 13px;
}
.editor-session-date, .editor-session-end { flex: 1 1 110px; min-width: 110px; }
.editor-session-time { flex: 1 1 90px; min-width: 90px; }
.editor-session-remove {
    width: 28px; height: 28px; flex: none; border-radius: 999px; background: var(--tag-neutral);
    display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; border: none;
}
.editor-add-session { font-size: 13px; font-weight: 600; color: var(--warn-fg); cursor: pointer; background: none; border: none; padding: 4px 0; }
.editor-actions { display: flex; gap: 10px; margin-top: 16px; }
.editor-actions .btn-primary { flex: 1; background: var(--admin); }
.editor-actions .btn-primary:hover { background: var(--admin-hover); }

/* ── Admin: attendance ──────────────────────────────────────────────── */
.attend-card { background: var(--panel); border-radius: 28px; padding: 18px 20px; margin-bottom: 12px; }
.attend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.attend-name { font-family: var(--font-display); font-size: 21px; }
.attend-badge { font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-fg); }
.attend-when { font-size: 13px; color: var(--muted-55); margin-top: 2px; }
.attend-people { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.attend-person {
    display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 15px;
    background: none; border: none; text-align: left; width: 100%;
}
.attend-mark {
    width: 22px; height: 22px; flex: none; border-radius: 999px; display: flex;
    align-items: center; justify-content: center; font-size: 12px; background: var(--tag-neutral);
}
.attend-mark.present { background: var(--level-bg); color: var(--level-fg); }
.attend-mark.absent { background: var(--danger-bg); color: var(--danger-fg); }
.attend-confirm-btn {
    width: 100%; min-height: 46px; margin-top: 12px; background: var(--admin); color: var(--accent-on);
    border: none; border-radius: 999px; font-family: var(--font-display); font-size: 15px; cursor: pointer;
}
.attend-confirm-btn:hover { background: var(--admin-hover); }

/* ── Responsive: desktop ────────────────────────────────────────────── */
@media (min-width: 960px) {
    .shell { max-width: 1400px; margin: 0 auto; }

    .sidebar {
        display: flex; flex-direction: column; gap: 26px;
        width: 236px; flex: none;
        background: var(--panel);
        padding: 28px 22px;
        position: sticky; top: 0; height: 100vh;
    }

    .pill-tabs { display: none; }
    .avatar-btn { display: none; }
    #back-to-app-btn-mobile { display: none; }
    #you-recs-section { display: none; }

    .app-topbar { padding: 30px 34px 0; }
    .app-topbar h2 { font-size: 38px; }
    .tab-content { padding: 24px 34px 30px; }

    .detail-pane {
        position: sticky !important;
        top: 24px;
        left: auto; right: auto; bottom: auto;
        transform: none !important;
        width: 340px; flex: none;
        margin: 24px 24px 24px 0;
        max-height: calc(100vh - 48px);
        box-shadow: none;
    }
    .detail-pane::before { display: none; }

    .scrim { display: none !important; }

    .rec-banner { left: auto; right: 24px; bottom: 24px; width: 360px; }
}

@media (max-width: 959.98px) {
    #back-to-app-btn-desktop { display: none; }
}
