/* ============================================================
   StudyLink — Design System v2
   Palette: light sky-blue bg, white cards, soft borders,
   serif display headings, yellow/pink/blue accent buttons
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    /* Backgrounds — WHITE everywhere, only sidebar is colored */
    --bg:           #ffffff;
    --sidebar-bg:   #cce4f0;
    --panel:        #ffffff;
    --panel-soft:   #f9f9f9;

    /* Text */
    --text:         #1a1a1a;
    --muted:        #888888;
    --muted-light:  #bbbbbb;

    /* Borders — thick near-black, clearly visible like design */
    --border:       #1a1a1a;
    --border-light: #1a1a1a;
    --shadow:       none;
    --shadow-sm:    none;

    /* Accent — yellow */
    --accent:       #f0d060;
    --accent-dark:  #d4b540;
    --accent-text:  #5a4200;

    /* Join button colors */
    --join-blue:    #8ecae6;
    --join-blue-dark: #5da8ce;
    --join-green:   #b5e2b0;
    --join-green-dark: #7dc775;
    --join-pink:    #f5a0b0;
    --join-pink-dark: #e06878;

    /* Participant card tints */
    --card-blue-bg:   #daf0fb;
    --card-blue-border:#1a1a1a;
    --card-green-bg:  #dff5db;
    --card-green-border:#1a1a1a;
    --card-pink-bg:   #fce0e6;
    --card-pink-border:#1a1a1a;

    /* Timer pill buttons */
    --pill-bg:      #ffffff;
    --pill-active:  #f5a0b0;
    --pill-active-text: #7a1a2e;

    /* Radii */
    --radius-xl:    28px;
    --radius-lg:    20px;
    --radius-md:    14px;
    --radius-sm:    10px;
    --radius-pill:  999px;

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ── Base ────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: #ffffff;
    min-height: 100vh;
}

input, select, button, textarea {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    border: 1.5px solid #cccccc;
    background: #ffffff;
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--muted);
}

input::placeholder, textarea::placeholder {
    color: var(--muted-light);
}

h1 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    font-style: italic;           /* italic serif — matches the design exactly */
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h2 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
}

h3 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
}

p { margin: 0; }

/* ── Utilities ───────────────────────────────────────────── */
.muted        { color: var(--muted); }
.small        { font-size: 0.88rem; }
.serif        { font-family: var(--font-display); font-style: italic; }

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid #1a1a1a;
    background: var(--accent);
    color: #1a1a1a;
    border-radius: var(--radius-pill);
    padding: 10px 22px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background 0.15s ease;
    white-space: nowrap;
    width: fit-content;
}

.btn:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
}

.btn-secondary:hover {
    background: var(--panel-soft);
}

.btn-outline {
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
}

.btn-outline:hover {
    background: var(--panel-soft);
}

/* Yellow accent — same as .btn but explicit alias used by auth pages */
.btn-accent {
    background: var(--accent);
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
}
.btn-accent:hover {
    background: var(--accent-dark);
}

/* colored join variants */
.btn-blue  { background: var(--join-blue);  color: #1a1a1a; border: 2px solid #1a1a1a; }
.btn-blue:hover  { background: var(--join-blue-dark); }

.btn-green { background: var(--join-green); color: #1a1a1a; border: 2px solid #1a1a1a; }
.btn-green:hover { background: var(--join-green-dark); }

.btn-pink  { background: var(--join-pink);  color: #1a1a1a; border: 2px solid #1a1a1a; }
.btn-pink:hover  { background: var(--join-pink-dark); }

.btn-full { width: 100% !important; }

/* Update Status button (outline pill, blue tint) */
.btn-update-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    width: fit-content;
    transition: background 0.15s;
}

.btn-update-status:hover {
    background: var(--panel-soft);
}

/* ── App Shell ───────────────────────────────────────────── */
.app-body {
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    background: var(--sidebar-bg);
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Brand / logo */
.brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.brand-diamond {
    font-size: 1rem;
    opacity: 0.7;
}

/* Nav links */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: block;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 400;
    transition: background 0.18s ease;
    border: 1.5px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.7);
}

.nav-link.active {
    background: #ffffff;
    border-color: #1a1a1a;
    font-weight: 500;
}

.nav-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Sidebar footer — user profile */
.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    flex-shrink: 0;
    border: 2px solid var(--panel);
}

.sidebar-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    border: 2px solid var(--panel);
    display: grid;
    place-items: center;
    font-size: 1rem;
    color: var(--muted);
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Main Content ────────────────────────────────────────── */
.app-main {
    padding: 36px 40px;
    background: #ffffff;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 2.1rem;
}

.page-date {
    font-size: 0.92rem;
    color: var(--muted);
    margin-top: 2px;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── Panels / Cards ──────────────────────────────────────── */
.panel {
    background: #ffffff;
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: none;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

/* ── Dashboard Layout ────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Timer spans full width top row */
.dashboard-timer {
    grid-column: 1;
}

.dashboard-create-room {
    grid-column: 2;
}

/* Tasks spans both columns on the bottom */
.dashboard-tasks {
    grid-column: 1 / -1;
}

/* ── Focus Timer ─────────────────────────────────────────── */
.timer-mode-toggle {
    display: flex;
    gap: 8px;
}

.pill-btn {
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-pill);
    padding: 7px 16px;
    background: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    width: fit-content;
    transition: background 0.15s;
}

.pill-btn.active {
    background: var(--pill-active);
    color: #1a1a1a;
    border-color: #1a1a1a;
}

.timer-display {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    padding: 28px 0 20px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.timer-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Pink timer action buttons */
.btn-timer {
    background: var(--pill-active);
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-pill);
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    transition: background 0.15s;
}

.btn-timer:hover {
    background: #e8708a;
}

/* Reset button variant — outlined */
.btn-timer-outline {
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-pill);
    padding: 10px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    transition: background 0.15s;
}

.btn-timer-outline:hover {
    background: var(--panel-soft);
}

/* ── Tasks ───────────────────────────────────────────────── */
.tasks-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1.5px solid #1a1a1a;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    background: #ffffff;
    transition: border-color 0.15s;
}

.task-item + .task-item {
    margin-top: 10px;
}

.task-item:hover {
    border-color: #555555;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 1.5px solid #1a1a1a;
    border-radius: 5px;
    background: #ffffff;
    flex-shrink: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s, border-color 0.15s;
}

.task-checkbox.checked {
    background: var(--text);
    border-color: var(--text);
}

.task-checkbox.checked::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.task-label {
    flex: 1;
    font-size: 0.95rem;
}

.task-label.done {
    text-decoration: line-through;
    color: var(--muted);
}

/* ── Study Rooms Grid ────────────────────────────────────── */
.room-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.room-card {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.room-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.room-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
}

.room-card-image-placeholder {
    width: 100%;
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-light);
    font-size: 2rem;
}

.room-card-body {
    padding: 16px 18px 18px;
}

.room-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.room-card-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 14px;
}

.room-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Friend card (active friends / friends page) ─────────── */
.friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.friend-card:last-child {
    border-bottom: none;
}

.friend-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.friend-email {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── Session / Study Room Interior ──────────────────────── */
.session-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.session-back {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.6rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Participant cards grid */
.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.participant-card {
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    background: var(--card-blue-bg);
}

.participant-card.green {
    border-color: #1a1a1a;
    background: var(--card-green-bg);
}

.participant-card.pink {
    border-color: #1a1a1a;
    background: var(--card-pink-bg);
}

.participant-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.participant-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
}

.participant-name {
    font-size: 1rem;
    font-weight: 600;
}

.participant-role {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 1px;
}

.participant-status {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Status Feed sidebar */
.session-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

/* Right sidebar: room preview stacked above status feed */
.session-right-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mini room preview card inside session */
.room-preview-card {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.room-preview-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    background: var(--card-blue-bg);
}

.room-preview-img-placeholder {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--card-blue-bg);
}

.room-preview-body {
    padding: 12px 14px 14px;
}

.room-preview-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-preview-desc {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 6px;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.room-preview-meta {
    font-size: 0.78rem;
    color: var(--muted-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-preview-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6fcf97;
    display: inline-block;
    flex-shrink: 0;
}

.status-feed {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: none;
    max-height: 500px;
    overflow-y: auto;
}

.status-feed-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 18px;
}

.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    flex-shrink: 0;
}

.feed-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.feed-time {
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: 6px;
    font-weight: 400;
}

.feed-status {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1px;
}

/* Status update picker panel */
.status-picker {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-top: 24px;
    box-shadow: none;
}

.status-picker-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 18px;
}

.status-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.status-option {
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-option:hover {
    background: var(--panel-soft);
}

.status-option.selected {
    background: var(--card-blue-bg);
    border-color: #1a1a1a;
}

/* ── Private Room / Profile page ─────────────────────────── */
.private-room-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    align-items: start;
}

/* Profile / StudyLink ID card */
.profile-card {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: none;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    position: relative;
    margin-bottom: 20px;
}

.profile-avatar-wrap {
    flex-shrink: 0;
}

.profile-avatar {
    width: 120px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: #f0f0f0;
    border: 1.5px solid #1a1a1a;
}

.profile-avatar-placeholder {
    width: 120px;
    height: 140px;
    border-radius: var(--radius-md);
    background: #f0f0f0;
    border: 1.5px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--muted-light);
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 4px;
}

.profile-bio {
    font-style: italic;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
    font-family: var(--font-display);
}

.profile-dots {
    letter-spacing: 4px;
    color: var(--muted-light);
    margin-bottom: 12px;
    font-size: 0.7rem;
}

.profile-meta {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.8;
    font-family: 'Courier New', monospace;
}

.profile-card-label {
    position: absolute;
    bottom: 20px;
    left: 24px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-style: italic;
    color: var(--text);
}

.profile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    position: absolute;
    top: 16px;
    right: 16px;
}

.profile-menu-btn:hover {
    background: var(--panel-soft);
}

/* Study Inspo panel */
.inspo-panel {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: none;
}

.inspo-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inspo-images {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inspo-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    background: #f0f0f0;
}

/* Active friends panel */
.active-friends-panel {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: none;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 16px;
}

/* ── Session card (dashboard widget, not room card) ──────── */
.session-card {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.session-card h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.card-meta {
    color: var(--muted);
    font-size: 0.85rem;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Auth pages (login / register) ───────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.auth-card {
    background: var(--panel);
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.auth-logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.auth-error {
    color: #c0392b;
    font-size: 0.88rem;
    margin-top: 8px;
    min-height: 1.2em;
}

.auth-link {
    font-size: 0.88rem;
    color: var(--muted);
    text-align: center;
    margin-top: 16px;
}

.auth-link a {
    color: var(--text);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* ── Study Stats panel ───────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 4px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-md);
    background: #ffffff;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 4px;
    color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Floating timer widget ───────────────────────────────────── */
.float-timer {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 2px solid #1a1a1a;
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    font-family: var(--font-display);
    cursor: default;
    /* Slide up when it appears */
    animation: float-in 0.25s ease;
}

@keyframes float-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.float-timer-time {
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text);
    min-width: 58px;
    text-align: center;
}

.float-timer-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.float-timer-btn:hover {
    background: var(--panel-soft);
}

.float-timer-close {
    font-size: 0.8rem;
    color: var(--muted);
    border-left: 1.5px solid #e0e0e0;
    padding-left: 10px;
    margin-left: 2px;
}

.float-timer-close:hover {
    color: var(--text);
    background: none;
}

/* Don't show widget on auth pages (no sidebar = login/register) */
.auth-shell .float-timer {
    display: none !important;
}

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

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .room-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .session-layout {
        grid-template-columns: 1fr;
    }

    .private-room-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px 18px;
        gap: 12px;
    }

    .sidebar-footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    .app-main {
        padding: 24px 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-timer,
    .dashboard-create-room,
    .dashboard-tasks {
        grid-column: 1;
    }

    .timer-display {
        font-size: 3.5rem;
    }

    .room-grid {
        grid-template-columns: 1fr;
    }

    .participants-grid {
        grid-template-columns: 1fr;
    }

    .status-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}