/* ============================================================
   StreamTeamHub — Twitch-style design system
   Palette: Twitch Core 2024
   ============================================================ */

/* ---- Design tokens ---- */
:root {
    --tw-bg:            #0e0e10;
    --tw-bg-alt:        #18181b;
    --tw-bg-card:       #1f1f23;
    --tw-bg-hover:      #26262c;
    --tw-bg-input:      #1f1f23;
    --tw-border:        #2d2d35;
    --tw-purple:        #9147ff;
    --tw-purple-hover:  #772ce8;
    --tw-purple-dim:    rgba(145, 71, 255, 0.18);
    --tw-text:          #efeff1;
    --tw-text-muted:    #adadb8;
    --tw-text-faint:    #6b6b7b;
    --tw-green:         #00c853;
    --tw-red:           #eb0400;
    --tw-yellow:        #ffb300;
    --tw-radius:        0.5rem;
    --tw-radius-sm:     0.3rem;
    --tw-sidebar-w:     240px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    background: var(--tw-bg);
    color: var(--tw-text);
}

a { color: var(--tw-purple); text-decoration: none; }
a:hover { color: var(--tw-purple-hover); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--tw-bg); }
::-webkit-scrollbar-thumb { background: var(--tw-border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #48485a; }

/* ================================================================
   APP SHELL
   ================================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
#sidebar {
    width: var(--tw-sidebar-w);
    min-height: 100vh;
    background: var(--tw-bg-alt);
    border-right: 1px solid var(--tw-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 1rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem 1rem;
    text-decoration: none;
    color: var(--tw-text) !important;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.sidebar-brand .brand-icon {
    color: var(--tw-purple);
    font-size: 1.35rem;
    line-height: 1;
}

.sidebar-sep {
    height: 1px;
    background: var(--tw-border);
    margin: 0.5rem 0.25rem 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.5rem 0.75rem;
}

.sidebar-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tw-border);
}

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

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav .nav-item { margin-bottom: 2px; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tw-text-muted);
    border-radius: var(--tw-radius-sm);
    transition: background 0.12s, color 0.12s;
}

.sidebar-nav .nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; }

.sidebar-nav .nav-link:hover {
    background: var(--tw-bg-hover);
    color: var(--tw-text);
}

.sidebar-nav .nav-link.active {
    background: var(--tw-purple-dim);
    color: var(--tw-purple) !important;
    font-weight: 600;
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tw-text-faint);
    padding: 0.6rem 0.65rem 0.3rem;
}

.sidebar-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--tw-border);
    margin-top: auto;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    color: var(--tw-text-faint);
    border-radius: var(--tw-radius-sm);
    transition: color 0.12s, background 0.12s;
}

.sidebar-footer a:hover { color: var(--tw-text); background: var(--tw-bg-hover); }

/* ---- Main area ---- */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--tw-bg);
}

/* ---- Topbar (mobile) ---- */
.topbar {
    height: 48px;
    background: var(--tw-bg-alt);
    border-bottom: 1px solid var(--tw-border);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tw-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-brand i { color: var(--tw-purple); }

/* ---- Page content ---- */
.page-content {
    flex: 1;
    padding: 1.75rem 1.75rem 2rem;
    max-width: 1200px;
    width: 100%;
}

/* ---- Page footer ---- */
.app-footer {
    border-top: 1px solid var(--tw-border);
    padding: 0.75rem 1.75rem;
    font-size: 0.75rem;
    color: var(--tw-text-faint);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-footer-donate {
    color: #0070ba;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.12s;
    margin-left: auto;
}
.app-footer-donate:hover { color: #005ea6; }
.app-footer-donate .bi-heart-fill { font-size: 0.65rem; }

/* ================================================================
   FLASH MESSAGES
   ================================================================ */
.flash-bar {
    padding: 0.7rem 1rem;
    border-radius: var(--tw-radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flash-bar.flash-success { background: rgba(0,200,83,.12); border: 1px solid rgba(0,200,83,.35); color: #00e676; }
.flash-bar.flash-error   { background: rgba(235,4,0,.12);  border: 1px solid rgba(235,4,0,.35);  color: #ff5449; }
.flash-bar.flash-warning { background: rgba(255,179,0,.12);border: 1px solid rgba(255,179,0,.35);color: #ffca28; }
.flash-bar.flash-info    { background: rgba(145,71,255,.1); border: 1px solid rgba(145,71,255,.3);color: #b57bff; }

/* ================================================================
   CARDS
   ================================================================ */
.card, .sth-card {
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
}

.card-header, .sth-card-header {
    background: transparent;
    border-bottom: 1px solid var(--tw-border);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ================================================================
   STAT TILES
   ================================================================ */
.stat-tile {
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    padding: 1.1rem 1.25rem;
}

.stat-tile-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--tw-purple);
    letter-spacing: -0.02em;
}

.stat-tile-label {
    font-size: 0.78rem;
    color: var(--tw-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

/* ================================================================
   MEMBER BADGES
   ================================================================ */
.member-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--tw-bg-hover);
    border: 1px solid var(--tw-border);
    border-radius: 2rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--tw-text);
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
}

.member-badge:hover {
    background: var(--tw-purple-dim);
    border-color: var(--tw-purple);
    color: var(--tw-purple);
}

.member-badge .owner-star { color: var(--tw-yellow); font-size: 0.7rem; }

/* ================================================================
   SCHEDULE GRID
   ================================================================ */
.day-card {
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    overflow: hidden;
}

.day-card-header {
    background: var(--tw-bg-alt);
    border-bottom: 1px solid var(--tw-border);
    padding: 0.55rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.day-card-name {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tw-text-muted);
}

.day-card-body { padding: 0.5rem 0.75rem; min-height: 60px; }

.slot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--tw-border);
}

.slot-row:last-child { border-bottom: none; }

.slot-time {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tw-purple);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.slot-user {
    font-size: 0.78rem;
    color: var(--tw-text-muted);
    margin-left: 0.5rem;
}

.no-slots {
    font-size: 0.78rem;
    color: var(--tw-text-faint);
    text-align: center;
    padding: 0.6rem 0;
}

/* ================================================================
   LIST ROWS
   ================================================================ */
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--tw-border);
    transition: background 0.1s;
}

.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--tw-bg-hover); }
.list-row a { color: var(--tw-text); text-decoration: none; }

/* ================================================================
   FORMS
   ================================================================ */
.form-control,
.form-select {
    background: var(--tw-bg-input) !important;
    border: 1px solid var(--tw-border) !important;
    color: var(--tw-text) !important;
    border-radius: var(--tw-radius-sm) !important;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control::placeholder { color: var(--tw-text-faint) !important; }

.form-control:focus,
.form-select:focus {
    border-color: var(--tw-purple) !important;
    box-shadow: 0 0 0 3px rgba(145,71,255,.25) !important;
    outline: none;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.form-text { font-size: 0.75rem; color: var(--tw-text-faint); }

textarea.form-control { resize: vertical; }

/* Input group icon */
.input-icon-group { position: relative; }
.input-icon-group .form-control { padding-left: 2.2rem; }
.input-icon-group .input-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tw-text-faint);
    font-size: 0.9rem;
    pointer-events: none;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    font-size: 0.855rem;
    font-weight: 600;
    border-radius: var(--tw-radius-sm);
    padding: 0.45rem 1rem;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn:active { transform: scale(0.98); }

.btn-twitch {
    background: var(--tw-purple);
    color: #fff;
}
.btn-twitch:hover { background: var(--tw-purple-hover); color: #fff; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--tw-border);
    color: var(--tw-text-muted);
}
.btn-ghost:hover { background: var(--tw-bg-hover); border-color: #48485a; color: var(--tw-text); }

.btn-danger-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--tw-text-faint);
    padding: 0.25rem 0.45rem;
    font-size: 0.8rem;
}
.btn-danger-ghost:hover { color: var(--tw-red); background: rgba(235,4,0,.1); }

.btn-danger {
    background: var(--tw-red);
    border: 1px solid var(--tw-red);
    color: #fff;
}
.btn-danger:hover { background: #c20300; border-color: #c20300; color: #fff; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-xs { padding: 0.15rem 0.4rem; font-size: 0.75rem; line-height: 1.4; }
.btn-lg { padding: 0.65rem 1.5rem; font-size: 1rem; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-content {
    background: var(--tw-bg-card) !important;
    border: 1px solid var(--tw-border) !important;
    border-radius: var(--tw-radius) !important;
    color: var(--tw-text);
}

.modal-header {
    border-bottom: 1px solid var(--tw-border) !important;
    padding: 1rem 1.25rem;
}

.modal-title { font-size: 0.95rem; font-weight: 700; }

.modal-footer {
    border-top: 1px solid var(--tw-border) !important;
    padding: 0.75rem 1.25rem;
}

.btn-close-white { filter: invert(1) grayscale(1); opacity: 0.7; }
.btn-close-white:hover { opacity: 1; }

/* ================================================================
   BADGES (tiny pill)
   ================================================================ */
.pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: 2rem;
}

.pill-purple  { background: var(--tw-purple-dim); color: var(--tw-purple); }
.pill-green   { background: rgba(0,200,83,.12); color: var(--tw-green); }
.pill-muted   { background: var(--tw-bg-hover); color: var(--tw-text-muted); }
.pill-warning { background: rgba(255,183,0,.13); color: #ffc107; }
.pill-success { background: rgba(0,200,83,.12);  color: var(--tw-green); }
.pill-danger  { background: rgba(235,4,0,.12);   color: var(--tw-red); }

/* ================================================================
   PAGE HEADINGS
   ================================================================ */
.page-heading {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--tw-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-subheading {
    font-size: 0.85rem;
    color: var(--tw-text-faint);
    margin-top: 0.2rem;
}

/* ================================================================
   LANDING PAGE
   ================================================================ */
.landing-hero {
    min-height: 100vh;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(145,71,255,.3) 0%, transparent 70%),
                var(--tw-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
}

.landing-logo {
    font-size: 3.5rem;
    color: var(--tw-purple);
    margin-bottom: 0.75rem;
}

.landing-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--tw-text);
    margin-bottom: 0.75rem;
}

.landing-sub {
    font-size: 1.05rem;
    color: var(--tw-text-muted);
    max-width: 520px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.btn-discord {
    background: #5865f2;
    color: #fff;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: var(--tw-radius-sm);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: background 0.15s, transform 0.1s;
    border: none;
}
.btn-discord:hover { background: #4752c4; color: #fff; transform: translateY(-1px); }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 820px;
    width: 100%;
    margin-top: 3.5rem;
}

.feature-card {
    background: var(--tw-bg-alt);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    padding: 1.5rem;
    text-align: left;
}

.feature-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--tw-text);
    margin-bottom: 0.4rem;
}

.feature-desc {
    font-size: 0.82rem;
    color: var(--tw-text-muted);
    line-height: 1.55;
}

.landing-footer {
    margin-top: 3rem;
    font-size: 0.75rem;
    color: var(--tw-text-faint);
}

.landing-global-footer {
    text-align: center;
    padding: 1.25rem 1rem 2rem;
    font-size: 0.75rem;
    color: var(--tw-text-faint);
    border-top: 1px solid var(--tw-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.landing-footer-sep { opacity: 0.4; }

.landing-footer-donate {
    color: #0070ba;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.12s;
}
.landing-footer-donate:hover { color: #005ea6; }
.landing-footer-donate .bi-heart-fill { font-size: 0.65rem; }

/* ================================================================
   LANDING NAVBAR
   ================================================================ */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 2rem;
    background: rgba(14,14,16,.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tw-border);
}

.landing-nav-brand {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tw-text) !important;
    letter-spacing: -0.01em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.landing-nav-brand i { color: var(--tw-purple); }

/* ================================================================
   PUBLIC PROFILE PAGE
   ================================================================ */
.profile-page {
    min-height: 100vh;
    background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(145,71,255,.2) 0%, transparent 65%),
                var(--tw-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5.5rem 1rem 4rem;
}

.profile-card {
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--tw-purple);
    margin-bottom: 0.9rem;
}

.profile-username {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--tw-text);
    margin-bottom: 0.4rem;
}

.profile-bio {
    font-size: 0.875rem;
    color: var(--tw-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: var(--tw-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--tw-bg-hover);
    border: 1px solid var(--tw-border);
    color: var(--tw-text);
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
    margin-bottom: 0.5rem;
}
.social-btn:hover { background: var(--tw-bg-alt); border-color: #48485a; color: var(--tw-text); }
.social-btn.social-twitch    { border-left: 3px solid var(--tw-purple); }
.social-btn.social-youtube   { border-left: 3px solid #ff0000; }
.social-btn.social-twitter   { border-left: 3px solid #000; }
.social-btn.social-tiktok    { border-left: 3px solid #69c9d0; }
.social-btn.social-instagram { border-left: 3px solid #e1306c; }
.social-btn.social-github    { border-left: 3px solid #6e40c9; }
.social-btn.social-website   { border-left: 3px solid #00bcd4; }
.social-btn.social-custom    { border-left: 3px solid #6c757d; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 767.98px) {
    #sidebar { display: none !important; }
    .topbar  { display: flex !important; }
    .page-content { padding: 1rem; }
}

@media (min-width: 768px) {
    .topbar { display: none; }
}

/* ================================================================
   LAYOUT HELPERS
   ================================================================ */

/* Flex row: space-between, wrap, start-aligned, gap .75rem, mb 1.5rem */
.page-top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Generic flex row of buttons / tags */
.btn-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Form submit row */
.form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Row of small tag/badge elements */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Section sub-heading row with action on right */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.9rem;
}

/* ================================================================
   GRIDS
   ================================================================ */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

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

.profile-edit-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

#schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .dashboard-grid,
    .profile-edit-grid { grid-template-columns: 1fr; }
    .grid-2col          { grid-template-columns: 1fr; }
}

/* ================================================================
   CARD BODIES
   ================================================================ */
.card-body    { padding: 1.5rem; }
.card-body-sm { padding: 1.25rem; }
.card-body-lg { padding: 1.75rem; }

/* ================================================================
   FORM PAGE WRAPPER
   ================================================================ */
.form-page { max-width: 520px; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--tw-text-faint);
    font-size: 0.85rem;
}

/* ================================================================
   SECTION / FORM LABELS
   ================================================================ */

/* Uppercase micro-label above a group */
.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tw-text-faint);
    margin-bottom: 0.6rem;
}

/* Uppercase micro-label above a set of inputs */
.form-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tw-text-faint);
    margin-bottom: 0.75rem;
}

/* ================================================================
   ICON HELPERS
   ================================================================ */

/* Icon accent colour in page headings */
.heading-icon {
    margin-right: 0.5rem;
    color: var(--tw-purple);
}

/* Icon inside card-header text */
.hdr-icon { margin-right: 0.4rem; }

/* Icon inside modal title */
.modal-icon {
    margin-right: 0.45rem;
    color: var(--tw-purple);
}

/* ================================================================
   LIST ROW CONTENT
   ================================================================ */

/* Primary name text */
.list-row-name {
    font-weight: 600;
    color: var(--tw-text);
}

/* Secondary slug / meta text */
.list-row-slug {
    font-size: 0.75rem;
    color: var(--tw-text-faint);
    margin-left: 0.4rem;
}

/* <a> that wraps an entire list-row */
a.list-row { text-decoration: none; }

/* ================================================================
   DASHBOARD SLOT ROW
   ================================================================ */
.slot-day-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--tw-text);
}

.slot-team-link {
    font-size: 0.75rem;
    color: var(--tw-text-faint);
    margin-left: 0.35rem;
}

.slot-team-link a { color: var(--tw-text-faint); }

/* ================================================================
   STAT TILE VARIANTS
   ================================================================ */
.stat-tile-value--teal { color: #6ee7b7; }

/* ================================================================
   FEATURE ICON COLOURS (landing)
   ================================================================ */
.feature-icon--purple { color: var(--tw-purple); }
.feature-icon--yellow { color: var(--tw-yellow); }
.feature-icon--green  { color: var(--tw-green); }

/* ================================================================
   PROFILE EDIT PAGE
   ================================================================ */
.edit-avatar-panel {
    text-align: center;
    padding: 1.25rem;
}

.edit-avatar-img {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--tw-purple);
    margin: 0 auto 0.75rem;
}

.edit-avatar-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--tw-text);
}

.edit-avatar-via {
    font-size: 0.75rem;
    color: var(--tw-text-faint);
    margin-top: 0.2rem;
}

/* ================================================================
   PROFILE PUBLIC PAGE
   ================================================================ */
.profile-bio--empty {
    font-style: italic;
    color: var(--tw-text-faint);
}

.profile-social-links { margin-bottom: 0.5rem; }

.profile-edit-btn { margin-top: 0.75rem; }

/* ================================================================
   PLATFORM BADGES
   ================================================================ */
.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    background: var(--tw-bg-alt);
    border: 1px solid var(--tw-border);
    color: var(--tw-text-muted);
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.platform-twitch  { border-color: var(--tw-purple);  color: var(--tw-purple);  background: var(--tw-purple-dim); }
.platform-youtube { border-color: #ff4444;           color: #ff4444;           background: rgba(255,0,0,.1); }
.platform-kick    { border-color: #53fc18;           color: #53fc18;           background: rgba(83,252,24,.08); }

/* ================================================================
   TEAM PUBLIC PAGE  (tp-*)
   ================================================================ */
.tp-page {
    min-height: 100vh;
    background: var(--tw-bg);
    display: flex;
    flex-direction: column;
}

/* Hero */
.tp-hero {
    background:
        radial-gradient(ellipse 90% 70% at 50% -10%, rgba(145,71,255,.35) 0%, transparent 68%),
        var(--tw-bg-alt);
    border-bottom: 1px solid var(--tw-border);
    text-align: center;
    padding: 4.5rem 1.5rem 3.5rem;
}

.tp-hero-icon {
    width: 72px;
    height: 72px;
    background: var(--tw-purple-dim);
    border: 2px solid rgba(145,71,255,.4);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--tw-purple);
    margin-bottom: 1.25rem;
}

.tp-hero-name {
    font-size: clamp(1.9rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    color: var(--tw-text);
    margin: 0 0 0.5rem;
    line-height: 1.1;
}

.tp-hero-url {
    font-size: 0.8rem;
    color: var(--tw-text-faint);
    font-weight: 500;
    letter-spacing: 0.025em;
    margin: 0 0 2rem;
}

/* Container */
.tp-container {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Sections */
.tp-section {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--tw-border);
}

.tp-section:last-of-type { border-bottom: none; }

.tp-section-hd {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tw-text-faint);
    margin-bottom: 1.25rem;
}

/* Members */
.tp-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tp-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    min-width: 90px;
    text-decoration: none;
    transition: border-color 0.12s, background 0.12s, transform 0.1s;
}

.tp-member:hover {
    border-color: var(--tw-purple);
    background: var(--tw-bg-hover);
    transform: translateY(-2px);
}

.tp-member-av {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--tw-purple-dim);
    border: 2px solid rgba(145,71,255,.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--tw-purple);
    text-transform: uppercase;
    line-height: 1;
}

.tp-member-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tw-text);
    text-align: center;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-member-owner {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--tw-yellow);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Schedule */
.tp-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.tp-day {
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tp-day-hd {
    background: var(--tw-bg-alt);
    border-bottom: 1px solid var(--tw-border);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tp-day-name {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--tw-text);
}

.tp-day-body { flex: 1; }

.tp-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--tw-border);
    flex-wrap: wrap;
    row-gap: 0.25rem;
}

.tp-slot:last-child { border-bottom: none; }

.tp-slot-time {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--tw-purple);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.tp-slot-user {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tw-text);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-slot-user:hover { color: var(--tw-purple); }
.tp-slot-user--stream:hover { color: var(--tw-purple); }
.tp-slot-ext-icon {
    font-size: 0.65rem;
    opacity: 0.55;
    margin-left: 0.2rem;
    vertical-align: middle;
}

/* Empty */
.tp-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--tw-text-faint);
    font-size: 0.875rem;
}

.tp-empty-icon {
    display: block;
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    opacity: 0.45;
}

/* Footer */
.tp-footer {
    margin-top: auto;
    text-align: center;
    padding: 2rem 1.25rem;
    border-top: 1px solid var(--tw-border);
    font-size: 0.8rem;
    color: var(--tw-text-faint);
}

.tp-footer a {
    color: var(--tw-text-faint);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.12s;
}

.tp-footer a:hover { color: var(--tw-purple); }

.tp-footer-sep {
    margin: 0 0.6rem;
    opacity: 0.35;
}

.tp-footer-donate {
    color: #0070ba !important;
}
.tp-footer-donate:hover { color: #005ea6 !important; }
.tp-footer-donate .bi-heart-fill { font-size: 0.75rem; }

/* Responsive */
@media (max-width: 640px) {
    .tp-hero         { padding: 3.5rem 1.25rem 2.75rem; }
    .tp-schedule     { grid-template-columns: 1fr; }
    .tp-members      { gap: 0.5rem; }
    .tp-member       { padding: 0.75rem 1rem; min-width: 76px; }
    .tp-member-av    { width: 40px; height: 40px; font-size: 1rem; }
    .tp-section      { padding: 2rem 0; }
}

/* ================================================================
   INLINE ERROR BARS (hidden by default, shown via JS)
   ================================================================ */
.error-bar {
    display: none;
    padding: 0.7rem 1rem;
    border-radius: var(--tw-radius-sm);
    font-size: 0.82rem;
    background: rgba(235,4,0,.12);
    border: 1px solid rgba(235,4,0,.35);
    color: #ff5449;
    margin-bottom: 0.9rem;
}

/* ================================================================
   MODAL BODY PADDING
   ================================================================ */
.modal-body { padding: 1.25rem; }

/* ================================================================
   SIDEBAR SEPARATOR VARIANT
   ================================================================ */
.sidebar-sep--top { margin-top: 0.75rem; }

/* ================================================================
   MARGIN HELPERS (form fields)
   ================================================================ */
.mb-field    { margin-bottom: 1.25rem; }
.mb-field-sm { margin-bottom: 1rem; }

/* ================================================================
   ERROR PAGES
   ================================================================ */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tw-bg);
    color: var(--tw-text);
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--tw-purple);
    line-height: 1;
    letter-spacing: -0.04em;
}

.error-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.5rem 0 0.75rem;
}

.error-sub {
    font-size: 0.9rem;
    color: var(--tw-text-muted);
    margin-bottom: 1.5rem;
}

/* ================================================================
   INVITE MANAGER
   ================================================================ */
.invite-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background: var(--tw-bg-card);
    border: 1px solid var(--tw-border);
    border-radius: 10px;
    flex-wrap: wrap;
}

.invite-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.invite-name {
    font-weight: 700;
    color: var(--tw-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.invite-name:hover { color: var(--tw-purple); }

.invite-meta {
    font-size: 0.78rem;
    color: var(--tw-text-faint);
}

.invite-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
