/* ==========================================================================
   Speaker SMPN 6 Kendari — Studio Broadcast & Command Center UI (v2)
   ========================================================================== */

:root {
    --bg: #070b14;
    --bg-elev: #0d1424;
    --surface: rgba(16, 24, 43, 0.74);
    --surface-solid: #111a2e;
    --surface-hover: rgba(26, 38, 66, 0.85);
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.26);

    --text: #f1f5f9;
    --text-soft: #cbd5e1;
    --muted: #94a3b8;

    --primary: #3b82f6;
    --primary-2: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.38);

    --ok: #10b981;
    --ok-soft: rgba(16, 185, 129, 0.14);
    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.15);
    --live: #ef4444;
    --live-soft: rgba(239, 68, 68, 0.16);
    --purple: #8b5cf6;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;

    --shadow-card: 0 20px 50px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    color-scheme: dark;
}

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

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: #93c5fd; text-decoration: none; transition: color .18s ease; }
a:hover { color: #bfdbfe; }

h1, h2, h3 { margin: 0; line-height: 1.22; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.38rem, 2.5vw, 1.75rem); }
h2 { font-size: 1.12rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

code, kbd {
    font-family: var(--font-mono);
    background: rgba(7, 11, 20, 0.8);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: .12rem .45rem;
    font-size: .86em;
    color: #e2e8f0;
}

/* ==========================================================================
   Ambient Studio Background
   ========================================================================== */
.bg-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(95px);
    opacity: 0.42;
}
.orb-1 {
    width: 560px;
    height: 560px;
    top: -220px;
    left: -120px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.52), transparent 70%);
}
.orb-2 {
    width: 520px;
    height: 520px;
    bottom: -240px;
    right: -120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
}
.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 35%, transparent 100%);
}

/* ==========================================================================
   Top Navigation Bar
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-top: env(safe-area-inset-top);
    background: rgba(7, 11, 20, 0.76);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: .68rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--text);
    min-width: 0;
}
.brand:hover { color: #fff; }
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.42), inset 0 1px 0 rgba(255,255,255,0.28);
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title {
    font-weight: 800;
    font-size: .96rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-sub {
    font-size: .72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topnav {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .46rem .8rem;
    border-radius: 10px;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all .16s ease;
}
.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}
.nav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.35);
}
.nav-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.nav-username {
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-logout {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .46rem .72rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #fca5a5;
    font-family: inherit;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s ease;
}
.nav-logout:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fecaca;
}

/* ==========================================================================
   Containers & Glass Cards
   ========================================================================== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem 1.15rem 3.5rem;
}
.page-talk .container { max-width: 540px; padding-top: 1.35rem; }
.page-account .container { max-width: 720px; }
.page-login .container {
    max-width: 460px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.glass-card, .card {
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Alerts & Badges
   ========================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.15rem;
    border: 1px solid;
    font-size: .92rem;
    font-weight: 500;
    animation: fadeSlide .25s ease;
}
.alert-icon { display: flex; margin-top: .1rem; flex-shrink: 0; }
.alert-success { background: rgba(16, 185, 129, 0.13); border-color: rgba(16, 185, 129, 0.35); color: #a7f3d0; }
.alert-error   { background: rgba(239, 68, 68, 0.14); border-color: rgba(239, 68, 68, 0.38); color: #fecaca; }
.alert-warning { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.38); color: #fde68a; }

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .62rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .01em;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-soft);
    border: 1px solid rgba(148, 163, 184, 0.22);
    white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.34); }
.badge-off { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.badge-live {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.48);
    animation: liveGlow 1.5s ease-in-out infinite;
}
.badge-role-admin { background: rgba(139, 92, 246, 0.18); color: #ddd6fe; border-color: rgba(139, 92, 246, 0.38); }
.badge-role-user  { background: rgba(59, 130, 246, 0.14); color: #bfdbfe; border-color: rgba(59, 130, 246, 0.28); }
.badge-neutral    { background: rgba(15, 23, 42, 0.7); color: #cbd5e1; border-color: var(--border-strong); font-family: var(--font-mono); }

@keyframes liveGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ==========================================================================
   Forms & Buttons
   ========================================================================== */
form.inline { display: inline; margin: 0; }

.field { margin-bottom: 1rem; }
.field label {
    display: block;
    margin-bottom: .38rem;
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-soft);
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="url"],
select {
    width: 100%;
    padding: .72rem .9rem;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(7, 11, 20, 0.65);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder { color: #64748b; }
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(7, 11, 20, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-group .input-icon {
    position: absolute;
    left: .85rem;
    color: #64748b;
    display: flex;
    pointer-events: none;
}
.input-group .input-icon + input { padding-left: 2.55rem; }
.input-group input:has(+ .input-action) { padding-right: 2.65rem; }
.input-action {
    position: absolute;
    right: .55rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color .15s, background .15s;
}
.input-action:hover, .input-action.is-showing {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.grid-2-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .48rem;
    padding: .64rem 1.08rem;
    border-radius: 11px;
    border: 1px solid var(--border-strong);
    background: rgba(30, 41, 59, 0.72);
    color: var(--text);
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
    white-space: nowrap;
}
.btn:hover { background: rgba(51, 65, 85, 0.85); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(96, 165, 250, 0.5);
    color: #fff;
    box-shadow: 0 8px 22px -6px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    box-shadow: 0 10px 26px -5px rgba(37, 99, 235, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.55);
    border-color: var(--border);
    color: var(--text-soft);
}
.btn-ghost:hover { background: rgba(30, 41, 59, 0.8); border-color: var(--border-strong); }

.btn-warn {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.42);
    color: #fde68a;
}
.btn-warn:hover { background: rgba(245, 158, 11, 0.28); }

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.22); color: #fecaca; }

.btn-small { padding: .38rem .72rem; font-size: .81rem; border-radius: 9px; }
.btn-lg { padding: .82rem 1.25rem; font-size: .98rem; border-radius: 13px; }
.btn-block { width: 100%; }

/* ==========================================================================
   Login Page
   ========================================================================== */
.auth-shell { width: 100%; }
.login-card {
    padding: 2.1rem 1.85rem 1.65rem;
    border-radius: var(--radius-lg);
}
.login-hero { text-align: center; margin-bottom: 1.65rem; }
.login-emblem {
    position: relative;
    width: 82px;
    height: 82px;
    margin: 0 auto 1.1rem;
    display: grid;
    place-items: center;
}
.emblem-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(59, 130, 246, 0.28);
}
.ring-outer { inset: 0; animation: pulseRing 3.2s ease-in-out infinite; }
.ring-inner { inset: 10px; border-color: rgba(59, 130, 246, 0.42); }
.emblem-core {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
@keyframes pulseRing {
    0%, 100% { transform: scale(1); opacity: .65; }
    50%      { transform: scale(1.08); opacity: .25; }
}

.school-chip {
    display: inline-block;
    padding: .22rem .7rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.13);
    border: 1px solid rgba(59, 130, 246, 0.28);
    margin-bottom: .65rem;
}
.login-subtitle {
    margin: .45rem auto 0;
    font-size: .9rem;
    color: var(--muted);
    max-width: 320px;
}
.login-form .btn-block { margin-top: .5rem; }
.login-foot {
    margin-top: 1.45rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
}

/* ==========================================================================
   User Broadcast Studio Console (talk.php)
   ========================================================================== */
.broadcast-shell {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.studio-console {
    padding: 1.35rem 1.35rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color .25s ease, box-shadow .25s ease;
}
.broadcast-shell.is-starting .studio-console {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 20px 60px -20px rgba(245, 158, 11, 0.28), inset 0 1px 0 rgba(255,255,255,0.08);
}
.broadcast-shell.is-live .studio-console {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 24px 70px -18px rgba(239, 68, 68, 0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

.studio-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.broadcaster-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .84rem;
    min-width: 0;
}
.broadcaster-chip strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.broadcaster-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
}

.onair-sign {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .28rem .72rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    background: rgba(7, 11, 20, 0.78);
    border: 1px solid var(--border-strong);
    color: #64748b;
    transition: all .2s ease;
    flex-shrink: 0;
}
.onair-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
}
.onair-sign.is-chime {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(120, 53, 15, 0.35);
}
.onair-sign.is-chime .onair-led {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}
.onair-sign.is-live {
    color: #fff;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.85), rgba(153, 27, 27, 0.85));
    border-color: #f87171;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.55);
}
.onair-sign.is-live .onair-led {
    background: #fff;
    box-shadow: 0 0 8px #fff;
    animation: blinkLed .9s ease-in-out infinite;
}
@keyframes blinkLed {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

/* Telemetry Row */
.telemetry-grid {
    margin-top: .95rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
}
.telemetry-item {
    background: rgba(7, 11, 20, 0.52);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .58rem .75rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .28rem;
    text-align: left;
}
.telemetry-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: .18rem .58rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: rgba(30, 41, 59, 0.6);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pill-ok   { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.13); }
.pill-warn { color: #fde68a; border-color: rgba(245, 158, 11, 0.4);  background: rgba(245, 158, 11, 0.14); }
.pill-off  { color: #fca5a5; border-color: rgba(239, 68, 68, 0.32); background: rgba(239, 68, 68, 0.12); }

/* Busy Banner */
.busy-banner {
    margin-top: .9rem;
    padding: .68rem .95rem;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
    font-size: .88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
}
.busy-banner[hidden] { display: none !important; }
.eq-mini {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}
.eq-mini i {
    width: 3px;
    background: #fbbf24;
    border-radius: 2px;
    animation: eqBounce .8s ease-in-out infinite alternate;
}
.eq-mini i:nth-child(1) { height: 6px; animation-delay: 0s; }
.eq-mini i:nth-child(2) { height: 13px; animation-delay: .2s; }
.eq-mini i:nth-child(3) { height: 8px; animation-delay: .4s; }
@keyframes eqBounce {
    from { height: 4px; }
    to   { height: 14px; }
}

/* Tactile Studio Mic Stage */
.mic-stage {
    position: relative;
    width: 248px;
    height: 248px;
    margin: 1.45rem auto .85rem;
    display: grid;
    place-items: center;
}
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(148, 163, 184, 0.14);
    pointer-events: none;
}
.orbit-1 { inset: 2px; }
.orbit-2 { inset: 20px; border-style: solid; border-color: rgba(59, 130, 246, 0.15); }
.broadcast-shell.is-live .orbit-2 { border-color: rgba(239, 68, 68, 0.35); }

.vu-ring {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.52) 0%, rgba(239, 68, 68, 0) 72%);
    opacity: 0;
    transition: transform 75ms linear, opacity 110ms linear;
    pointer-events: none;
}

.mic-btn {
    position: relative;
    width: 184px;
    height: 184px;
    border-radius: 50%;
    border: 5px solid rgba(96, 165, 250, 0.35);
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.25), transparent 45%),
        linear-gradient(155deg, #3b82f6 0%, #1d4ed8 62%, #1e3a8a 100%);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow:
        0 18px 45px -8px rgba(29, 78, 216, 0.65),
        inset 0 2px 4px rgba(255, 255, 255, 0.35),
        inset 0 -10px 22px rgba(7, 11, 20, 0.45);
    transition: transform .14s cubic-bezier(.2,.8,.2,1), background .22s ease, box-shadow .22s ease, border-color .22s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}
.mic-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.015);
    border-color: rgba(147, 197, 253, 0.65);
}
.mic-btn:active:not(:disabled) {
    transform: scale(0.95);
}
.mic-btn:disabled {
    background: linear-gradient(155deg, #334155 0%, #1e293b 70%, #0f172a 100%);
    border-color: rgba(100, 116, 139, 0.28);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.06);
    color: #64748b;
    cursor: not-allowed;
}
.mic-btn.starting {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.3), transparent 45%),
        linear-gradient(155deg, #fbbf24 0%, #d97706 65%, #92400e 100%);
    border-color: rgba(253, 224, 71, 0.65);
    animation: chimePulse 1s ease-in-out infinite;
}
.mic-btn.live {
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.3), transparent 45%),
        linear-gradient(155deg, #f87171 0%, #dc2626 60%, #991b1b 100%);
    border-color: rgba(252, 165, 165, 0.75);
    box-shadow:
        0 0 0 10px rgba(239, 68, 68, 0.18),
        0 20px 50px -6px rgba(220, 38, 38, 0.78),
        inset 0 2px 4px rgba(255, 255, 255, 0.35);
}
@keyframes chimePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
    50%      { box-shadow: 0 0 0 18px rgba(245, 158, 11, 0); }
}

.mic-btn-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    pointer-events: none;
}
.mic-btn-caption {
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    opacity: .92;
}

/* Live Spectrum Visualizer */
.wave-visualizer {
    height: 34px;
    max-width: 260px;
    margin: 0 auto .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.wave-bar {
    width: 4px;
    height: 16%;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.3);
    transition: height 65ms linear, background-color .2s ease;
}
.broadcast-shell.is-starting .wave-bar {
    background: #fbbf24;
}
.broadcast-shell.is-live .wave-bar {
    background: linear-gradient(to top, #ef4444, #fca5a5);
}

/* Readout & Timer */
.studio-readout { min-height: 3.4rem; }
.talk-hint {
    margin: 0 auto;
    max-width: 380px;
    font-size: .98rem;
    font-weight: 600;
    color: var(--text-soft);
}
.timer-wrap {
    margin-top: .6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
}
.timer-wrap[hidden] { display: none !important; }
.timer {
    font-family: var(--font-mono);
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #fecaca;
}
.timer-progress {
    width: 180px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.timer-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f87171, #ef4444);
    transition: width .25s linear;
}
.mic-perm-btn { margin-top: .85rem; }
.mic-perm-btn[hidden] { display: none !important; }

/* Segmented Mode Switcher */
.mode-selector-wrap { margin-top: 1.15rem; }
.segmented {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(7, 11, 20, 0.72);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 360px;
}
.seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .56rem .75rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .16s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
    background: rgba(59, 130, 246, 0.22);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.42);
}

/* Studio Tips */
.studio-tips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
}
.tip-card {
    background: rgba(16, 24, 43, 0.55);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .85rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.tip-num {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    font-size: .76rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.tip-card strong { display: block; font-size: .84rem; margin-bottom: .18rem; }
.tip-card p { margin: 0; font-size: .77rem; color: var(--muted); line-height: 1.42; }

/* ==========================================================================
   Account Page
   ========================================================================== */
.account-layout { display: flex; flex-direction: column; gap: 1.15rem; }
.profile-hero {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.profile-avatar-lg {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 1.45rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
}
.profile-meta { flex: 1 1 200px; }
.profile-meta p { margin: .15rem 0 0; }
.profile-badges { display: flex; gap: .4rem; margin-bottom: .45rem; flex-wrap: wrap; }
.profile-stats {
    display: flex;
    gap: .65rem;
}
.mini-stat {
    background: rgba(7, 11, 20, 0.58);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .6rem .95rem;
    text-align: center;
    min-width: 96px;
}
.mini-stat-val { display: block; font-size: 1.2rem; font-weight: 800; }
.mini-stat-val small { font-size: .75rem; font-weight: 600; color: var(--muted); }
.mini-stat-lbl { font-size: .72rem; color: var(--muted); }

.form-actions {
    margin-top: .5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Admin Dashboard
   ========================================================================== */
.admin-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.35rem;
}
.eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    color: #60a5fa;
    margin-bottom: .3rem;
}
.admin-head p { margin: .25rem 0 0; font-size: .92rem; }
.admin-head-actions { display: flex; gap: .55rem; flex-wrap: wrap; }

/* Token Spotlight */
.token-spotlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.35rem;
    box-shadow: 0 16px 40px -18px rgba(245, 158, 11, 0.35);
}
.token-spotlight-head {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: .9rem;
}
.token-icon { font-size: 1.5rem; line-height: 1; }
.token-spotlight-head p { margin: .2rem 0 0; font-size: .88rem; color: #fde68a; }
.token-copy-bar {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}
.token-copy-bar code {
    flex: 1 1 260px;
    padding: .7rem .95rem;
    font-size: .94rem;
    border-radius: 10px;
    background: rgba(7, 11, 20, 0.88);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fef3c7;
    word-break: break-all;
    user-select: all;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9rem;
    margin-bottom: 1.35rem;
}
.kpi-card { padding: 1.15rem 1.2rem; }
.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .65rem;
}
.kpi-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
}
.kpi-icon-blue    { background: rgba(59, 130, 246, 0.16); color: #60a5fa; }
.kpi-icon-purple  { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.kpi-icon-emerald { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.kpi-icon-amber   { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }

.kpi-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.kpi-value small { font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-foot { margin-top: .35rem; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.text-ok   { color: #34d399; }
.text-off  { color: #f87171; }
.text-live { color: #fb7185; }
.text-muted { color: var(--muted); }

/* Admin Sections */
.admin-section { margin-bottom: 1.35rem; }
.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.section-head p { margin: .2rem 0 0; font-size: .86rem; }
.section-tools {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box svg {
    position: absolute;
    left: .75rem;
    color: #64748b;
    pointer-events: none;
}
.search-box input {
    width: 220px;
    padding: .46rem .8rem .46rem 2.2rem;
    font-size: .85rem;
    border-radius: 10px;
}

/* Device Cards */
.device-list { display: flex; flex-direction: column; gap: .7rem; }
.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.1rem;
    border-radius: 13px;
    background: rgba(7, 11, 20, 0.52);
    border: 1px solid var(--border);
}
.device-item.is-disabled { opacity: .55; }
.device-main {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
}
.device-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-ok   { background: var(--ok); box-shadow: 0 0 10px rgba(16, 185, 129, 0.8); }
.dot-off  { background: #64748b; }
.dot-live { background: var(--live); box-shadow: 0 0 12px rgba(239, 68, 68, 0.9); animation: blinkLed .9s infinite; }

.device-title-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.device-meta {
    margin-top: .25rem;
    display: flex;
    gap: .45rem;
    flex-wrap: wrap;
    font-size: .8rem;
    color: var(--muted);
}

/* Modern Tables */
.table-wrap { overflow-x: auto; margin: 0 -.25rem; padding: 0 .25rem; }
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.modern-table th {
    text-align: left;
    padding: .65rem .75rem;
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    border-bottom: 1px solid var(--border-strong);
}
.modern-table td {
    padding: .82rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.modern-table tbody tr:last-child td { border-bottom: 0; }
.modern-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.row-disabled td { opacity: .5; }
.text-right { text-align: right !important; }
.muted-cell { color: var(--muted); font-size: .84rem; white-space: nowrap; }

.user-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 9px; font-size: .74rem; }
.av-1 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.av-2 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.av-3 { background: linear-gradient(135deg, #10b981, #047857); }
.av-4 { background: linear-gradient(135deg, #f59e0b, #b45309); }
.av-5 { background: linear-gradient(135deg, #ec4899, #be185d); }

.user-fullname { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .4rem; }
.user-handle { font-size: .8rem; color: var(--muted); }
.you-tag {
    font-size: .68rem;
    padding: .08rem .42rem;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    font-weight: 700;
}

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .83rem;
    font-weight: 600;
}
.status-inline i { width: 7px; height: 7px; border-radius: 50%; }
.status-inline.ok { color: #6ee7b7; }
.status-inline.ok i { background: var(--ok); }
.status-inline.off { color: var(--muted); }
.status-inline.off i { background: #64748b; }

.actions {
    display: flex;
    gap: .38rem;
    flex-wrap: wrap;
    align-items: center;
}
.actions.text-right { justify-content: flex-end; }

.empty-state {
    text-align: center;
    padding: 1.75rem 1rem;
    border-radius: 12px;
    background: rgba(7, 11, 20, 0.45);
    border: 1px dashed var(--border-strong);
    color: var(--muted);
}

/* ==========================================================================
   Modals (<dialog>)
   ========================================================================== */
dialog.modal {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    max-width: 480px;
    width: calc(100% - 2rem);
    border-radius: var(--radius);
}
dialog.modal::backdrop {
    background: rgba(3, 6, 14, 0.72);
    backdrop-filter: blur(6px);
}
.modal-card {
    background: #10192d;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: modalPop .18s ease-out;
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
    padding: 1.1rem 1.3rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
}
.modal-close:hover { background: rgba(255,255,255,0.07); color: #fff; }
.modal-body { padding: 1.2rem 1.3rem .5rem; }
.modal-foot {
    padding: .95rem 1.3rem;
    background: rgba(7, 11, 20, 0.48);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 880px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .brand-sub, .nav-username, .logout-label { display: none; }
    .topbar-inner { padding: .6rem .85rem; }
    .nav-link { padding: .44rem .62rem; }
    .container { padding: 1.1rem .85rem 2.8rem; }
    .glass-card { padding: 1.15rem; }

    .grid-2-form { grid-template-columns: 1fr; gap: 0; }
    .studio-tips { grid-template-columns: 1fr; }
    .tip-card { flex-direction: row; align-items: flex-start; gap: .7rem; }
    .tip-num { flex-shrink: 0; margin-top: .1rem; }

    .mic-stage { width: 224px; height: 224px; margin: 1.15rem auto .75rem; }
    .mic-btn { width: 168px; height: 168px; }

    .search-box, .search-box input { width: 100%; }
    .section-tools { width: 100%; }
    .profile-stats { width: 100%; }
    .mini-stat { flex: 1; }
}

@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .telemetry-grid { grid-template-columns: 1fr; }
}
