/* ── Variables ────────────────────────────────────────────────── */
:root {
    --rose:         #B5294E;
    --rose-light:   #D4587A;
    --rose-lighter: #F0A0B8;
    --rose-dark:    #7D1535;
    --rose-darker:  #3D0A1A;

    --bg:           #0E0E10;
    --surface:      #1A1A1E;
    --surface-2:    #242428;
    --surface-3:    #2E2E34;
    --border:       #303038;

    --text:         #F0F0F5;
    --text-2:       #9090A0;
    --text-3:       #505060;

    --success:      #2ECC71;
    --warning:      #F0A500;
    --error:        #E55353;

    --heat-0:       #1A1A1E;
    --heat-1:       #4A1525;
    --heat-2:       #7D2040;
    --heat-3:       #A52B55;
    --heat-4:       #B5294E;

    --radius:       10px;
    --radius-sm:    6px;
    --nav-h:        56px;
}

/* ── Alpine cloak ─────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}
a { color: var(--rose-light); text-decoration: none; }
a:hover { color: var(--rose-lighter); }
button { cursor: pointer; font: inherit; }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav {
    height: var(--nav-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--rose-light);
    letter-spacing: -.02em;
}
.nav-links { display: flex; gap: .25rem; }
.nav-link {
    padding: .4rem .75rem;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .9rem;
    transition: background .15s, color .15s;
}
.nav-link:hover  { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: var(--surface-3); color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }
.nav-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--rose-dark);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem;
}
.nav-logout { font-size: .85rem; color: var(--text-3); }

/* ── Flash ────────────────────────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    font-size: .9rem;
}
.flash-success { background: rgba(46, 204, 113, .12); color: var(--success); border-bottom: 1px solid rgba(46,204,113,.2); }
.flash-error   { background: rgba(229, 83, 83, .12); color: var(--error); border-bottom: 1px solid rgba(229,83,83,.2); }
.flash-close { background: none; border: none; color: inherit; font-size: 1.2rem; opacity: .6; }
.flash-close:hover { opacity: 1; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: var(--radius-sm);
    border: none;
    font-size: .9rem;
    font-weight: 500;
    transition: opacity .15s, background .15s, transform .1s;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary   { background: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-light); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost     { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger-ghost { color: var(--error); }
.btn-danger-ghost:hover { background: rgba(229,83,83,.12); color: var(--error); }
.btn-success   { background: rgba(46,204,113,.15); color: var(--success); }
.btn-success:hover { background: rgba(46,204,113,.25); }
.btn-warning   { background: rgba(240,165,0,.15); color: var(--warning); }
.btn-warning:hover { background: rgba(240,165,0,.25); }
.btn-danger    { background: rgba(229,83,83,.15); color: var(--error); }
.btn-danger:hover  { background: rgba(229,83,83,.25); }

.btn-xl  { padding: .75rem 2.5rem; font-size: 1rem; border-radius: var(--radius); }
.btn-lg  { padding: .6rem 1.5rem; }
.btn-sm  { padding: .35rem .75rem; font-size: .82rem; }
.btn-xs  { padding: .2rem .5rem; font-size: .78rem; border-radius: 4px; }
.btn-full { width: 100%; }
.btn-icon { background: none; border: none; font-size: 1.2rem; color: var(--text-2); padding: .25rem .5rem; }
.btn-icon:hover { color: var(--text); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group-sm { flex: 0 0 120px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.form-section-title { font-size: .85rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; margin: 1.5rem 0 .75rem; }
.form-hint { font-size: .8rem; color: var(--text-3); margin-top: .25rem; }
.form-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.form-errors { background: rgba(229,83,83,.08); border: 1px solid rgba(229,83,83,.3); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; color: var(--error); font-size: .88rem; }
.form-errors p + p { margin-top: .25rem; }
label { font-size: .88rem; font-weight: 500; color: var(--text-2); }
.optional { font-weight: 400; color: var(--text-3); font-size: .8rem; }

.input {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    padding: .5rem .75rem;
    outline: none;
    transition: border-color .15s;
    width: 100%;
}
.input:focus { border-color: var(--rose); }
.input::placeholder { color: var(--text-3); }
.input-sm { padding: .35rem .6rem; font-size: .88rem; }
.input-with-unit { display: flex; align-items: center; gap: .5rem; }
.input-with-unit .input { flex: 1; }
.unit { font-size: .82rem; color: var(--text-3); white-space: nowrap; }
select.input { cursor: pointer; }
.color-picker { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; flex-shrink: 0; }
.flex-1 { flex: 1; }

/* Toggle switch */
.toggle-label { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; }
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--surface-3);
    border-radius: 11px;
    transition: background .2s;
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: var(--text-2);
    border-radius: 50%;
    transition: transform .2s, background .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--rose); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* Checkbox */
.checkbox-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Danger zone ──────────────────────────────────────────────── */
.danger-zone  { border-color: #7D1535 !important; }
.danger-title { color: #D4587A; }
.danger-block { padding: .75rem 0; }
.danger-block-header { margin-bottom: .75rem; }
.danger-divider { border: none; border-top: 1px solid var(--border); margin: .25rem 0; }
.danger-label { display: block; font-size: .82rem; color: var(--text-3); margin-bottom: .5rem; }
.danger-label em { color: var(--text-2); font-style: normal; font-family: monospace; }
.danger-row   { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.danger-input { flex: 1; min-width: 0; }
.btn-danger   { background: #7D1535; color: #fff; border: none; }
.btn-danger:hover:not(:disabled) { background: #B5294E; }
.btn-danger:disabled { opacity: .4; cursor: not-allowed; }

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: .25rem; }
.auth-header p { color: var(--text-2); font-size: .9rem; }
.auth-logo { font-size: 2.5rem; margin-bottom: .75rem; }
.auth-footer { margin-top: 1.5rem; text-align: center; font-size: .85rem; color: var(--text-2); }
.auth-card form .form-group + .form-group { margin-top: 1rem; }
.auth-card .btn-full { margin-top: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }

/* ── Page layout ──────────────────────────────────────────────── */
.main-content { }
.page-container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-container-wide { max-width: 1400px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }

/* ── Timer page ───────────────────────────────────────────────── */
.timer-page {
    display: flex;
    height: calc(100vh - var(--nav-h));
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-title { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.new-task-form { padding: .75rem 1rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.new-task-row { display: flex; gap: .35rem; align-items: center; }
.task-list { flex: 1; list-style: none; padding: .5rem 0; }
.task-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 0 .4rem;
    transition: background .12s;
    font-size: .88rem;
    color: var(--text-2);
}
.task-item:hover  { background: var(--surface-2); color: var(--text); }
.task-item.active { background: rgba(181,41,78,.12); color: var(--rose-light); }
.task-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.task-name { truncate; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Timer main */
.timer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}
.mode-tabs {
    display: flex;
    gap: .25rem;
    background: var(--surface-2);
    padding: .25rem;
    border-radius: var(--radius);
}
.mode-tab {
    padding: .4rem 1.1rem;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-2);
    font-size: .9rem;
    transition: background .15s, color .15s;
}
.mode-tab:hover  { color: var(--text); }
.mode-tab.active { background: var(--surface-3); color: var(--text); }

/* SVG Circle */
.timer-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timer-svg { width: 280px; height: 280px; }
.timer-ring { transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
}
.timer-time { font-size: 3.2rem; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.timer-mode { font-size: .85rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .1em; }
.timer-task { font-size: .8rem; color: var(--text-3); margin-top: .1rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-badge { font-size: .78rem; color: var(--warning); background: rgba(240,165,0,.1); padding: .15rem .5rem; border-radius: 4px; }

/* Controls */
.timer-controls { display: flex; align-items: center; justify-content: center; }
.controls-row   { display: flex; gap: .75rem; align-items: center; }

/* Pomodoro dots */
.pomodoro-dots { display: flex; align-items: center; gap: .4rem; }
.pomodoro-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--surface-3);
    border: 1px solid var(--border);
    transition: background .2s, border-color .2s;
}
.pomodoro-dot.filled { background: var(--rose); border-color: var(--rose); }
.pomodoro-count { font-size: .8rem; color: var(--text-3); margin-left: .25rem; }

/* ── Tasks page ───────────────────────────────────────────────── */
.task-full-list { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.task-full-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
}
.task-dot-lg { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.task-dot-sm { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.task-full-name { flex: 1; font-size: .95rem; }
.task-actions { display: flex; gap: .35rem; }
.task-edit-form { padding: .5rem 1rem; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: -.25rem; }

/* ── Analytics page ───────────────────────────────────────────── */
.analytics-page { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.range-tabs { display: flex; gap: .25rem; }
.range-tab { padding: .35rem .85rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: .85rem; transition: all .15s; }
.range-tab:hover  { color: var(--text); }
.range-tab.active { background: var(--rose-darker); border-color: var(--rose-dark); color: var(--rose-light); }

.summary-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin: 1.5rem 0; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.summary-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: .5rem; }
.summary-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -.03em; }

/* Heatmap */
.heatmap-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header h2 { font-size: 1rem; font-weight: 600; }
.heatmap-controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.heatmap-task-select { font-size: .78rem; padding: .2rem .5rem; height: auto; }

/* Custom task-color dropdown */
.task-color-select { position: relative; }
.task-color-select-btn {
    display: flex; align-items: center; gap: .45rem;
    padding: .3rem .65rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .15s;
    white-space: nowrap;
}
.task-color-select-btn:hover { border-color: var(--rose); }
.task-color-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.task-color-chevron { font-size: .7rem; color: var(--text-3); margin-left: .1rem; }
.task-color-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    z-index: 50;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.task-color-option {
    display: flex; align-items: center; gap: .55rem;
    width: 100%; padding: .5rem .75rem;
    background: none; border: none;
    color: var(--text); font-size: .85rem;
    cursor: pointer; text-align: left;
    transition: background .12s;
}
.task-color-option:hover { background: var(--surface-3); }

.heatmap-legend { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--text-3); }
.heat-swatch { width: 12px; height: 12px; border-radius: 2px; }
/* Heatmap layout */
.heatmap-container { display: flex; gap: 6px; overflow-x: auto; align-items: flex-start; }

.heatmap-day-labels { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.heatmap-day-labels > div { height: 12px; font-size: .68rem; color: var(--text-3); line-height: 12px; white-space: nowrap; text-align: right; }
.heatmap-month-spacer { height: 20px !important; }

.heatmap-grid-area { display: flex; flex-direction: column; gap: 4px; }

.heatmap-months-row { height: 16px; position: relative; min-width: 100%; }
.heatmap-months-row span { position: absolute; font-size: .68rem; color: var(--text-3); white-space: nowrap; top: 0; }

.heatmap-grid { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 2px; }
.heatmap-cell {
    width: 12px; height: 12px;
    border-radius: 2px;
    background: var(--heat-0);
    cursor: pointer;
    transition: transform .1s;
}
.heatmap-cell:hover { transform: scale(1.2); }
.heatmap-cell[data-level="1"] { background: var(--heat-1); }
.heatmap-cell[data-level="2"] { background: var(--heat-2); }
.heatmap-cell[data-level="3"] { background: var(--heat-3); }
.heatmap-cell[data-level="4"] { background: var(--heat-4); }
.heatmap-loading { font-size: .85rem; color: var(--text-3); padding: 1rem; }
.heatmap-tooltip {
    position: fixed;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .4rem .7rem;
    font-size: .8rem;
    pointer-events: none;
    z-index: 200;
    white-space: nowrap;
}

/* Task breakdown */
.breakdown-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.breakdown-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.task-breakdown { display: flex; flex-direction: column; gap: .6rem; }
.breakdown-row { display: flex; align-items: center; gap: .75rem; }
.breakdown-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.breakdown-name { width: 140px; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-bar-wrap { flex: 1; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.breakdown-bar { height: 100%; border-radius: 4px; transition: width .4s ease; }
.breakdown-time { font-size: .82rem; color: var(--text-2); width: 60px; text-align: right; }

/* ── Room page ────────────────────────────────────────────────── */
.room-page { height: calc(100vh - var(--nav-h)); display: flex; }
.room-join-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 300;
    backdrop-filter: blur(4px);
}
.room-join-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
}
.room-join-card h2 { margin-bottom: .5rem; }
.room-join-card p  { color: var(--text-2); margin-bottom: 1.25rem; font-size: .9rem; }
.room-join-card .form-group { margin-bottom: 1rem; }

.room-ui { flex: 1; display: flex; flex-direction: column; }
.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.room-name { font-size: 1.1rem; font-weight: 600; }
.room-link { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.room-code { font-family: monospace; font-size: .85rem; color: var(--text-2); background: var(--surface-2); padding: .1rem .4rem; border-radius: 4px; }
.room-body { flex: 1; display: flex; overflow: hidden; }

.room-timer-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}
.room-task-picker { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.picker-label { font-size: .85rem; color: var(--text-2); white-space: nowrap; }
.picker-locked { font-size: .75rem; color: var(--text-3); font-style: italic; }
.room-task-picker .input { max-width: 200px; }
.input-disabled { opacity: .45; cursor: not-allowed; }

.room-members-col {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-left: 1px solid var(--border);
    padding: 1rem;
    overflow-y: auto;
}
.room-members-col h3 { font-size: .9rem; font-weight: 600; margin-bottom: .75rem; }
.member-count { color: var(--text-3); font-weight: 400; }
.member-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.member-item { display: flex; align-items: center; gap: .6rem; }
.member-kick-btn { margin-left: auto; flex-shrink: 0; background: none; border: none; color: var(--text-3); cursor: pointer; font-size: .9rem; padding: .15rem .3rem; border-radius: var(--radius-sm); line-height: 1; opacity: 0; transition: opacity .15s, color .15s; }
.member-item:hover .member-kick-btn { opacity: 1; }
.member-kick-btn:hover { color: var(--error); }
.member-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--rose-darker);
    color: var(--rose-lighter);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
    flex-shrink: 0;
}
.member-info { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.member-name { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-task { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--text-2); }

/* ── Admin ────────────────────────────────────────────────────── */
.admin-nav { display: flex; gap: .25rem; }
.admin-nav .active { background: var(--surface-3); color: var(--text); }

/* ── Admin activity panel ─────────────────────────────────────── */
.activity-layout { display: flex; gap: 1.25rem; align-items: flex-start; min-height: 0; }
.activity-sidebar { width: 220px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-height: calc(100vh - 160px); overflow-y: auto; }
.activity-sidebar-title { padding: .6rem .9rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); border-bottom: 1px solid var(--border); }
.activity-user-row { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .9rem; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; text-align: left; color: var(--text); transition: background .15s; }
.activity-user-row:last-child { border-bottom: none; }
.activity-user-row:hover { background: var(--surface-2); }
.activity-user-row.active { background: var(--surface-3); }
.activity-user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--rose-dark); color: #fff; font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-user-info { display: flex; flex-direction: column; min-width: 0; }
.activity-user-name { font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-user-email { font-size: .72rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-detail { flex: 1; min-width: 0; }
.activity-empty { display: flex; align-items: center; justify-content: center; min-height: 200px; color: var(--text-3); }
.activity-detail-header { margin-bottom: 1.25rem; }
.activity-detail-header h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: .15rem; }
.range-tabs-sm { gap: .2rem; }
.range-tabs-sm .range-tab { padding: .2rem .55rem; font-size: .78rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { padding: .6rem .75rem; text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); border-bottom: 1px solid var(--border); }
.data-table td { padding: .6rem .75rem; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.actions-cell { display: flex; gap: .3rem; align-items: center; }

/* Badges */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-admin  { background: rgba(181,41,78,.15); color: var(--rose-light); }
.badge-user   { background: var(--surface-3); color: var(--text-2); }
.badge-guest  { background: rgba(46,204,113,.1); color: var(--success); }
.badge-status-active  { background: rgba(46,204,113,.1);  color: var(--success); }
.badge-status-pending { background: rgba(240,165,0,.1); color: var(--warning); }
.badge-status-blocked { background: rgba(229,83,83,.1); color: var(--error); }

/* ── Rooms list ───────────────────────────────────────────────── */
.room-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.room-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.room-card-name { font-size: 1rem; font-weight: 600; }
.room-card-meta { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.room-code-sm { font-family: monospace; font-size: .82rem; color: var(--text-2); background: var(--surface-2); padding: .1rem .4rem; border-radius: 4px; }
.room-members-count { font-size: .8rem; color: var(--text-3); }
.room-card-actions { display: flex; gap: .5rem; }

/* ── Delete confirm ───────────────────────────────────────────── */
.delete-confirm { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.delete-confirm-text { font-size: .85rem; color: var(--text-2); }

/* ── Empty state ──────────────────────────────────────────────── */
.empty-state { color: var(--text-3); font-size: .9rem; padding: 1rem 0; }

/* ── Settings profile ─────────────────────────────────────────── */
.profile-avatar-section { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.profile-avatar-form { display: flex; flex-direction: column; gap: .5rem; }
.avatar-img-lg { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.avatar-placeholder-lg { width: 72px; height: 72px; border-radius: 50%; background: var(--rose-dark); color: var(--rose-lighter); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 700; }
.settings-section-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.input-row { display: flex; gap: .5rem; align-items: stretch; }
.input-row .input { flex: 1; }
.badge-warn { background: rgba(240,165,0,.12); color: var(--warning); padding: .15rem .5rem; border-radius: 4px; font-size: .75rem; }
.setting-code-value { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .3rem .6rem; font-family: monospace; font-size: .85rem; color: var(--text-2); display: inline-block; word-break: break-all; }

/* Nav avatar image */
.nav-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; display: block; }

/* Auth divider */
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--text-3); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Leaderboard ──────────────────────────────────────────────── */
.lb-podium { margin: 1.5rem 0; padding-top: 1.5rem; }
.lb-podium-inner { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; height: 220px; }
.lb-podium-slot { display: flex; flex-direction: column; align-items: center; width: 140px; }
.lb-podium-crown { font-size: 1.5rem; margin-bottom: .3rem; }
.lb-podium-avatar { margin-bottom: .5rem; }
.lb-avatar-img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.lb-avatar-placeholder { width: 52px; height: 52px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; }
.lb-avatar-placeholder-1 { width: 60px; height: 60px; font-size: 1.6rem; }
.lb-podium-avatar-1 .lb-avatar-img { width: 60px; height: 60px; border-color: var(--rose); }
.lb-podium-name { font-size: .85rem; font-weight: 600; text-align: center; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.lb-podium-pts { font-size: .78rem; color: var(--text-2); margin-bottom: .4rem; }
.lb-podium-pts-1 { color: var(--rose-light); font-weight: 600; }
.lb-podium-bar { width: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.lb-podium-bar-1 { height: 100px; }
.lb-podium-bar-2 { height: 72px; background: var(--surface-3); }
.lb-podium-bar-3 { height: 50px; background: var(--surface-2); }
.lb-rank-badge { background: rgba(0,0,0,.3); color: #fff; font-size: .78rem; font-weight: 700; padding: .2rem .5rem; border-radius: var(--radius-sm); margin-bottom: .4rem; }
.lb-rank-1 { background: rgba(0,0,0,.4); }

.lb-list { display: flex; flex-direction: column; gap: 0; }
.lb-row { display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem; border-radius: var(--radius-sm); transition: background .12s; }
.lb-row:hover { background: var(--surface-2); }
.lb-row-top { background: rgba(255,255,255,.025); }
.lb-rank { width: 28px; text-align: center; font-size: .85rem; font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.lb-user-avatar { flex-shrink: 0; }
.lb-avatar-img-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.lb-avatar-placeholder-sm { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 700; }
.lb-name { width: 160px; font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.lb-bar-wrap { flex: 1; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.lb-bar { height: 100%; border-radius: 4px; transition: width .4s ease; }
.lb-stats { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; flex-shrink: 0; min-width: 100px; }
.lb-points { font-size: .88rem; font-weight: 600; color: var(--text); }
.lb-time { font-size: .75rem; color: var(--text-3); }

.lb-stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.5rem; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .summary-cards { grid-template-columns: repeat(3, 1fr); }
    .timer-page { flex-direction: column; height: auto; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
    .room-body { flex-direction: column; }
    .room-members-col { width: 100%; border-left: none; border-top: 1px solid var(--border); }
    .nav-links { display: none; }
}
