/* ── Variables ─────────────────────────────────────────────────────── */
:root {
    --bg:        #0a0a14;
    --surface:   rgba(255,255,255,0.04);
    --surface2:  rgba(255,255,255,0.07);
    --border:    rgba(255,255,255,0.09);
    --border2:   rgba(255,255,255,0.04);
    --text:      #f0f0f5;
    --text2:     rgba(240,240,245,0.55);
    --text3:     rgba(240,240,245,0.28);
    --blue:      #0078d4;
    --green:     #107c10;
    --yellow:    #ffb900;
    --red:       #e03c2e;
    --purple:    #5c2d91;
    --sidebar-w: 220px;
    --radius:    18px;
    --radius-sm: 12px;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    min-height: 100vh;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; color: inherit; font-family: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* ── Ambient background ────────────────────────────────────────────── */
.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.12;
    animation: orbDrift 14s ease-in-out infinite alternate;
}
.orb-1 { width: 600px; height: 600px; background: var(--blue); top: -200px; left: -150px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: var(--purple); bottom: -100px; right: -100px; animation-delay: 5s; }
.orb-3 { width: 350px; height: 350px; background: var(--green); top: 40%; left: 40%; animation-delay: 10s; opacity: 0.07; }
@keyframes orbDrift {
    from { transform: translate(0,0); }
    to   { transform: translate(40px, 25px); }
}
.grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    opacity: 0.4;
}

/* ── Layout ────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    background: rgba(10,10,20,0.7);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
}
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 28px 80px;
    position: relative;
    z-index: 1;
    max-width: 1100px;
}
.mobile-header { display: none; }

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    margin-bottom: 32px;
}
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--blue), #004e9a);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,120,212,0.35);
    flex-shrink: 0;
}
.logo-text {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text2);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
    background: rgba(0,120,212,0.18);
    color: #fff;
    border: 0.75px solid rgba(0,120,212,0.35);
}
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.user-avatar {
    width: 36px; height: 36px;
    background: var(--surface2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.user-name { font-size: 0.875rem; font-weight: 500; }
.user-status { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text2); margin-top: 2px; }
.status-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }

/* ── Glass Cards ───────────────────────────────────────────────────── */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 0.75px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
    pointer-events: none;
    border-radius: inherit;
}

/* ── Page structure ────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.section { margin-bottom: 20px; }
.section-title {
    font-family: 'Syne', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text3);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ── Card label ────────────────────────────────────────────────────── */
.card-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--yellow);
    margin-bottom: 10px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.label-icon { font-size: 14px; }

/* ── Dashboard clock ───────────────────────────────────────────────── */
.clock-block { line-height: 1; }
.clock {
    font-family: 'Syne', sans-serif;
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.clock-date { font-size: 0.85rem; color: var(--text2); margin-top: 4px; }
.header-actions { display: flex; gap: 8px; }
.refresh-btn, .icon-btn {
    width: 38px; height: 38px;
    background: var(--surface2);
    border: 0.75px solid var(--border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text2);
    transition: background 0.2s, color 0.2s;
}
.refresh-btn:hover, .icon-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Briefing card ─────────────────────────────────────────────────── */
.briefing-preview { font-size: 0.875rem; color: var(--text2); line-height: 1.6; }
.briefing-full { font-size: 0.9rem; color: var(--text); line-height: 1.8; margin-top: 10px; }
.expand-btn {
    width: 28px; height: 28px;
    background: var(--surface2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text2);
    transition: transform 0.25s;
}
.expand-btn.open { transform: rotate(180deg); }

/* ── Presence grid ─────────────────────────────────────────────────── */
.presence-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.presence-person { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.presence-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 16px;
    position: relative;
    transition: all 0.3s;
}
.presence-avatar.home {
    background: rgba(16,124,16,0.18);
    border: 1.5px solid rgba(16,124,16,0.55);
    color: #fff;
}
.presence-avatar.away {
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.08);
    color: var(--text3);
}
.presence-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg);
}
.presence-dot.home { background: var(--green); }
.presence-dot.away { background: rgba(255,255,255,0.2); }
.presence-name { font-size: 0.75rem; font-weight: 500; color: var(--text2); }
.presence-name.home { color: var(--text); }

/* ── Schedule card ─────────────────────────────────────────────────── */
.event-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.event-row + .event-row { border-top: 1px solid var(--border2); }
.event-dot { width: 3px; min-width: 3px; height: 36px; border-radius: 2px; margin-top: 2px; }
.event-info { flex: 1; min-width: 0; }
.event-title { font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-time { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
.event-empty { color: var(--text3); font-size: 0.875rem; padding: 12px 0; }

/* ── Device tiles ──────────────────────────────────────────────────── */
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.device-tile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 0.75px solid var(--border2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.device-tile:hover { background: rgba(255,255,255,0.06); }
.device-tile.on { background: rgba(255,185,0,0.08); border-color: rgba(255,185,0,0.25); }
.device-icon { font-size: 18px; flex-shrink: 0; }
.device-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-state { font-size: 0.7rem; color: var(--text3); }

/* ── Now playing mini ──────────────────────────────────────────────── */
.now-playing-card { display: flex; align-items: center; gap: 14px; }
.np-art {
    width: 48px; height: 48px;
    border-radius: 8px;
    background: rgba(224,60,46,0.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    overflow: hidden;
}
.np-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.np-info { flex: 1; min-width: 0; }
.np-title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 0.8rem; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-controls { display: flex; gap: 10px; align-items: center; }
.np-btn { color: var(--text2); transition: color 0.2s; padding: 4px; }
.np-btn:hover { color: var(--text); }

/* ── Network mini ──────────────────────────────────────────────────── */
.network-mini-card { display: flex; align-items: center; justify-content: space-between; }
.net-mini-stat { text-align: center; }
.net-mini-val { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }
.net-mini-lbl { font-size: 0.7rem; color: var(--text3); margin-top: 2px; }
.net-status { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--green); font-weight: 500; }

/* ── Calendar ──────────────────────────────────────────────────────── */
.calendar-layout { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { .calendar-layout { grid-template-columns: 1fr; } }
.calendar-card { min-width: 300px; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-month-title { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; }
.cal-nav {
    width: 32px; height: 32px;
    background: var(--surface2);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text2);
    transition: background 0.2s;
}
.cal-nav:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}
.cal-weekdays div {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text3);
    padding: 4px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    gap: 2px;
}
.cal-day:hover { background: var(--surface2); }
.cal-day.today { border: 1.5px solid var(--green); color: var(--green); font-weight: 600; }
.cal-day.selected { background: var(--green); color: #fff; font-weight: 700; border: none; }
.cal-day.selected:hover { background: #138713; }
.cal-day.empty { cursor: default; }
.cal-dots { display: flex; gap: 2px; justify-content: center; }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; }
.events-card { }
.events-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.events-day-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }
.events-count { font-size: 0.75rem; color: var(--text3); }
.events-list { display: flex; flex-direction: column; }
.event-full-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.event-full-row + .event-full-row { border-top: 1px solid var(--border2); }
.event-time-col { width: 60px; flex-shrink: 0; text-align: right; }
.event-time-start { font-size: 0.8rem; font-weight: 500; color: var(--text2); }
.event-time-end { font-size: 0.72rem; color: var(--text3); }
.event-bar { width: 3px; min-width: 3px; border-radius: 2px; align-self: stretch; min-height: 36px; }
.event-body { flex: 1; min-width: 0; }
.event-full-title { font-size: 0.9rem; font-weight: 600; }
.event-full-sub { font-size: 0.78rem; color: var(--text3); margin-top: 3px; }
.event-no-events { color: var(--text3); font-size: 0.875rem; padding: 24px 0; text-align: center; }

/* ── Home / Devices ────────────────────────────────────────────────── */
.stats-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--surface);
    border: 0.75px solid var(--border);
    border-radius: 50px;
}
.stat-icon { font-size: 18px; }
.stat-val { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; }
.stat-lbl { font-size: 0.72rem; color: var(--text3); }
.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255,255,255,0.05);
    border: 0.75px solid rgba(255,255,255,0.08);
    color: var(--text2);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.filter-chip:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.filter-chip.active { background: rgba(255,185,0,0.18); border-color: rgba(255,185,0,0.4); color: var(--yellow); }
.device-section { margin-bottom: 20px; }
.device-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text3);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.devices-full-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.device-card {
    padding: 14px;
    background: rgba(255,255,255,0.03);
    border: 0.75px solid var(--border2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.device-card:hover { background: rgba(255,255,255,0.06); }
.device-card.on { background: rgba(255,185,0,0.07); border-color: rgba(255,185,0,0.22); }
.device-card.lock-on { background: rgba(16,124,16,0.07); border-color: rgba(16,124,16,0.22); }
.device-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.device-card-icon { font-size: 22px; }
.device-toggle {
    width: 38px; height: 22px;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
    border: none;
}
.device-toggle.off { background: rgba(255,255,255,0.1); }
.device-toggle.on { background: var(--yellow); }
.device-toggle.lock-on { background: var(--green); }
.device-toggle::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    transition: left 0.25s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.device-toggle.off::after { left: 3px; }
.device-toggle.on::after, .device-toggle.lock-on::after { left: 19px; }
.device-card-name { font-size: 0.85rem; font-weight: 600; }
.device-card-area { font-size: 0.72rem; color: var(--text3); margin-top: 2px; }
.brightness-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.brightness-slider { flex: 1; accent-color: var(--yellow); height: 3px; cursor: pointer; }

/* ── Music page ────────────────────────────────────────────────────── */
.today-btn {
    padding: 6px 14px;
    background: rgba(16,124,16,0.18);
    border: 0.75px solid rgba(16,124,16,0.4);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    cursor: pointer;
}
.search-panel { margin-bottom: 16px; }
.search-panel-inner { display: flex; flex-direction: column; gap: 12px; }
.zone-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.zone-chip {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 0.75px solid rgba(255,255,255,0.08);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
}
.zone-chip:hover { background: rgba(255,255,255,0.1); }
.zone-chip.active { background: rgba(224,60,46,0.2); border-color: rgba(224,60,46,0.4); color: #fff; }
.search-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    color: var(--text2);
}
.search-input-row input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 0.9rem;
    color: var(--text);
}
.search-input-row input::placeholder { color: var(--text3); }
.clear-btn { color: var(--text3); font-size: 13px; padding: 2px; }
.play-search-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 42px;
    background: var(--red);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    transition: opacity 0.2s;
}
.play-search-btn:hover { opacity: 0.85; }
.play-search-btn:disabled { background: rgba(255,255,255,0.1); color: var(--text3); }

/* Zone card */
.zone-card { margin-bottom: 14px; overflow: hidden; }
.zone-art {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, rgba(224,60,46,0.25), rgba(26,0,0,0.8));
    cursor: pointer;
    overflow: hidden;
}
.zone-art img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.zone-art-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(10,10,20,0.85) 100%);
}
.zone-art-placeholder {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 52px;
    opacity: 0.1;
}
.zone-track-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 14px 16px;
}
.zone-track-title { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-track-artist { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-badge {
    position: absolute;
    top: 12px; right: 12px;
    display: flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}
.zone-state-dot { width: 6px; height: 6px; border-radius: 50%; }
.zone-controls { padding: 14px 16px; }
.zone-progress { margin-bottom: 12px; }
.progress-track {
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.progress-bar { height: 100%; background: var(--red); border-radius: 2px; transition: width 0.5s linear; }
.progress-labels { display: flex; justify-content: space-between; margin-top: 5px; }
.progress-label { font-size: 0.7rem; color: var(--text3); font-variant-numeric: tabular-nums; }
.zone-btns { display: flex; align-items: center; justify-content: space-between; }
.zone-btn { color: var(--text2); transition: color 0.2s; padding: 8px; border-radius: 8px; }
.zone-btn:hover { color: var(--text); background: var(--surface2); }
.zone-btn.disabled { opacity: 0.2; cursor: default; }
.zone-play-btn {
    width: 54px; height: 54px;
    background: var(--red);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(224,60,46,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}
.zone-play-btn:hover { transform: scale(1.05); box-shadow: 0 8px 24px rgba(224,60,46,0.5); }
.zone-volume { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.zone-volume input[type=range] { flex: 1; accent-color: var(--red); height: 3px; cursor: pointer; }
.zone-volume-val { font-size: 0.75rem; color: var(--text3); width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.zone-members { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 0.75rem; color: var(--text3); }

/* Library */
.library-tabs { display: flex; gap: 6px; }
.lib-tab {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text3);
    background: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.lib-tab:hover { color: var(--text2); }
.lib-tab.active { background: rgba(224,60,46,0.18); color: var(--red); }
.lib-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.lib-item + .lib-item { border-top: 1px solid var(--border2); }
.lib-item:hover .lib-play { opacity: 1; }
.lib-art {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: rgba(224,60,46,0.12);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 18px;
}
.lib-art img { width: 100%; height: 100%; object-fit: cover; }
.lib-info { flex: 1; min-width: 0; }
.lib-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }
.lib-dur { font-size: 0.72rem; color: var(--text3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.lib-play {
    width: 32px; height: 32px;
    background: rgba(224,60,46,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--red);
    opacity: 0;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.lib-play:hover { background: rgba(224,60,46,0.35); }

/* ── Full Player Modal ──────────────────────────────────────────────── */
.player-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
}
.player-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.player-sheet {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background: rgba(14,14,22,0.96);
    backdrop-filter: blur(40px);
    border-radius: 28px 28px 0 0;
    border: 0.75px solid var(--border);
    border-bottom: none;
    overflow: hidden;
    z-index: 1;
    max-height: 95vh;
    overflow-y: auto;
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.player-handle {
    width: 40px; height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    margin: 12px auto 0;
}
.player-art-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(60px) saturate(1.5);
    opacity: 0.25;
    transform: scale(1.2);
    pointer-events: none;
}
.player-content {
    padding: 20px 28px 40px;
    position: relative;
}
.player-art-wrap {
    width: 260px;
    height: 260px;
    margin: 0 auto 24px;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.player-art { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.player-art-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(224,60,46,0.3), rgba(26,0,0,0.8));
    display: flex; align-items: center; justify-content: center;
    font-size: 80px;
    opacity: 0.15;
    border-radius: 20px;
}
.player-track-info { text-align: center; margin-bottom: 20px; }
.player-title { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.player-artist { font-size: 0.9rem; color: var(--text2); margin-top: 5px; }
.player-progress { margin-bottom: 24px; }
.progress-bar-wrap {
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    margin-bottom: 8px;
}
.progress-bg { position: absolute; inset: 0; border-radius: 4px; }
.progress-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: #fff;
    border-radius: 4px;
    transition: width 0.5s linear;
}
.progress-thumb {
    position: absolute;
    top: 50%;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: left 0.5s linear;
}
.progress-times { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text3); font-variant-numeric: tabular-nums; }
.player-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ctrl-btn { color: rgba(255,255,255,0.5); padding: 8px; transition: color 0.2s; }
.ctrl-btn:hover { color: #fff; }
.ctrl-btn.active { color: var(--red); }
.ctrl-prev, .ctrl-next { color: rgba(255,255,255,0.8); }
.ctrl-prev:hover, .ctrl-next:hover { color: #fff; }
.ctrl-play {
    width: 68px; height: 68px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #000;
    box-shadow: 0 8px 24px rgba(255,255,255,0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}
.ctrl-play:hover { transform: scale(1.06); box-shadow: 0 12px 32px rgba(255,255,255,0.25); }
.player-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text2);
    margin-bottom: 20px;
}
.volume-slider { flex: 1; accent-color: #fff; cursor: pointer; }
.speaker-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text);
    margin: 0 auto;
    transition: background 0.2s;
}
.speaker-btn:hover { background: rgba(255,255,255,0.14); }

/* ── Group modal ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal-sheet {
    background: rgba(14,14,22,0.98);
    backdrop-filter: blur(40px);
    border-radius: 28px 28px 0 0;
    border: 0.75px solid var(--border);
    border-bottom: none;
    width: 100%;
    max-width: 520px;
    padding: 20px;
    animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 800; }
.modal-close { width: 30px; height: 30px; background: var(--surface2); border-radius: 50%; font-size: 14px; color: var(--text2); }
.speaker-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.speaker-item + .speaker-item { border-top: 1px solid var(--border2); }
.speaker-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    font-size: 20px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.speaker-icon.selected { background: rgba(224,60,46,0.2); }
.speaker-item-name { font-size: 0.9rem; font-weight: 500; flex: 1; }
.speaker-item-state { font-size: 0.75rem; color: var(--text3); }
.speaker-check {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 0.75px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
}
.speaker-check.selected { background: var(--red); border-color: var(--red); color: #fff; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.modal-btn {
    height: 48px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity 0.2s;
}
.modal-btn:hover { opacity: 0.85; }
.modal-btn.primary { background: var(--red); color: #fff; }
.modal-btn.secondary { background: rgba(224,60,46,0.1); color: var(--red); border: 0.75px solid rgba(224,60,46,0.3); }

/* ── Network ───────────────────────────────────────────────────────── */
.net-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 700px) { .net-stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { text-align: center; padding: 16px 12px; }
.stat-card-icon { font-size: 22px; margin-bottom: 6px; }
.stat-card-val { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 800; }
.stat-card-lbl { font-size: 0.72rem; color: var(--text3); margin-top: 3px; }
.net-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.search-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: var(--surface);
    border: 0.75px solid var(--border);
    border-radius: 10px;
    color: var(--text2);
}
.search-mini input {
    background: none;
    border: none;
    outline: none;
    font-size: 0.85rem;
    color: var(--text);
    width: 160px;
}
.search-mini input::placeholder { color: var(--text3); }
.client-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.client-row + .client-row { border-top: 1px solid var(--border2); }
.client-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.client-info { flex: 1; min-width: 0; }
.client-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-ip { font-size: 0.72rem; color: var(--text3); font-family: monospace; margin-top: 2px; }
.client-meta { text-align: right; flex-shrink: 0; }
.client-signal { font-size: 0.75rem; font-weight: 600; }
.client-signal.good { color: var(--green); }
.client-signal.fair { color: var(--yellow); }
.client-signal.poor { color: var(--red); }
.client-seen { font-size: 0.7rem; color: var(--text3); margin-top: 2px; }

/* ── Loading state ─────────────────────────────────────────────────── */
.loading-state { color: var(--text3); font-size: 0.875rem; padding: 8px 0; }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.32,0.72,0,1); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 100vw rgba(0,0,0,0.5); }
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(10,10,20,0.8);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
    }
    .menu-btn {
        width: 40px; height: 40px;
        background: var(--surface2);
        border-radius: 10px;
        display: flex; align-items: center; justify-content: center;
        color: var(--text);
    }
    .mobile-logo { display: flex; align-items: center; gap: 8px; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1rem; }
    .logo-icon-sm { font-size: 18px; }
    .main { margin-left: 0; padding: 16px 16px 80px; }
    .two-col { grid-template-columns: 1fr; }
    .net-stats-grid { grid-template-columns: repeat(2,1fr); }
    .calendar-layout { grid-template-columns: 1fr; }
}

/* ── Logout link ─────────────────────────────────────────────────── */
.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: rgba(240,240,245,0.3);
    transition: color 0.2s, background 0.2s;
    margin-left: auto;
}
.logout-link:hover { color: var(--text); background: var(--surface2); }
.sidebar-footer .user-card { flex: 1; }
