﻿/* Patron Panel — Professional Glassmorphism UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #08080e;
    --bg-secondary: #0d0d16;
    --bg-card: rgba(16, 16, 28, 0.65);
    --bg-card-solid: #10101c;
    --bg-hover: rgba(30, 30, 50, 0.6);
    --bg-input: rgba(12, 12, 22, 0.8);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e8e6f0;
    --text-secondary: #9896a8;
    --text-muted: #5e5c6e;
    --accent: #8b5cf6;
    --accent-hover: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --purple: #c084fc;
    --cyan: #22d3ee;
    --pink: #f472b6;
    /* Connection quality bands */
    --latency-good: #34d399;
    --latency-fair: #fbbf24;
    --latency-poor: #fb923c;
    --latency-bad: #f87171;
    /* Session states */
    --session-active: #34d399;
    --session-idle: #fbbf24;
    --session-recording: #f87171;
    /* Layout */
    --sidebar-w: 240px;
    --sidebar-collapsed: 64px;
    --topbar-h: 52px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.5), 0 0 60px rgba(139,92,246,.06);
    --glass-blur: blur(20px);
    --glow-accent: 0 0 30px rgba(139,92,246,.2);
    --glow-sm: 0 0 15px rgba(139,92,246,.15);
    /* Transitions */
    --transition: all 0.2s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary); color: var(--text-primary); line-height: 1.5; min-height: 100vh;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* -- Background Ambience -- */
.app-layout::before {
    content: ''; position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(139,92,246,.06) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(59,130,246,.04) 0%, transparent 50%),
                radial-gradient(circle at 60% 80%, rgba(192,132,252,.03) 0%, transparent 50%);
    z-index: -1; pointer-events: none; animation: ambience 20s ease-in-out infinite alternate;
}
@keyframes ambience {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, -1%) rotate(3deg); }
}

/* -- Layout -- */
.app-layout { display: flex; min-height: 100vh; position: relative; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: #08080e;
    background-image: radial-gradient(circle at 30% 40%, rgba(139,92,246,.12) 0%, transparent 60%),
                      radial-gradient(circle at 70% 60%, rgba(59,130,246,.08) 0%, transparent 60%); }

/* -- Sidebar -- */
.sidebar {
    width: var(--sidebar-w); background: rgba(10, 10, 18, 0.85); backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur); border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100;
    transition: width 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s ease;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-text, .sidebar.collapsed .nav-label, .sidebar.collapsed .brand-text,
.sidebar.collapsed .user-name, .sidebar.collapsed .btn-logout span,
.sidebar.collapsed .sidebar-version { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .nav-icon { width: auto; margin: 0; font-size: 18px; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .sidebar-footer { padding: 8px; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed .user-badge { width: 32px; height: 32px; }
.sidebar.collapsed .nav-badge { display: none; }
.sidebar-brand { padding: 16px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--glass-border); min-height: 56px; }
.brand-icon { font-size: 24px; color: var(--accent); filter: drop-shadow(0 0 6px var(--accent-glow)); }
.brand-icon.large { font-size: 40px; }
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: 1px;
    background: linear-gradient(135deg, #e8e6f0, var(--accent-hover));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    white-space: nowrap; overflow: hidden; }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; overflow-x: hidden; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); text-decoration: none; transition: var(--transition); margin-bottom: 2px;
    position: relative; white-space: nowrap; overflow: hidden; }
.nav-item:hover { background: rgba(139,92,246,.08); color: var(--text-primary); }
.nav-item.active { background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(139,92,246,.08));
    color: #fff; border: 1px solid rgba(139,92,246,.25);
    box-shadow: 0 0 20px rgba(139,92,246,.15), inset 0 0 20px rgba(139,92,246,.05); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg, .nav-icon i { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-text { font-size: 13px; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600;
    padding: 2px 7px; border-radius: 10px; min-width: 18px; text-align: center; line-height: 1.3; }
.nav-divider { height: 1px; background: var(--glass-border); margin: 12px 4px; }
.nav-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 4px 12px;
    letter-spacing: 1px; white-space: nowrap; }

.sidebar-collapse-btn { background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 8px 12px; width: 100%; text-align: right; transition: var(--transition);
    border-top: 1px solid var(--glass-border); font-size: 16px; }
.sidebar-collapse-btn:hover { color: var(--accent); background: rgba(139,92,246,.05); }
.sidebar.collapsed .sidebar-collapse-btn { text-align: center; }
.sidebar.collapsed .sidebar-collapse-btn .collapse-icon { transform: rotate(180deg); }
.collapse-icon { display: inline-block; transition: transform 0.3s ease; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--glass-border); }
.sidebar-version { font-size: 10px; color: var(--text-muted); text-align: center; margin-bottom: 8px;
    letter-spacing: 0.5px; }
.user-info { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.user-badge { width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff;
    box-shadow: 0 0 12px rgba(139,92,246,.3); flex-shrink: 0; }
.user-name { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.role-tag { font-size: 9px; background: rgba(139,92,246,.15); color: var(--accent); padding: 1px 6px;
    border-radius: 4px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.btn-logout { background: none; border: 1px solid var(--glass-border); color: var(--text-secondary);
    padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; width: 100%; font-size: 12px;
    transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(248,113,113,.06); }

/* -- Main -- */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(.4,0,.2,1); }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

.topbar { display: flex; align-items: center; padding: 12px 24px;
    background: rgba(10, 10, 18, 0.6); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border); gap: 16px; position: sticky; top: 0; z-index: 50;
    height: var(--topbar-h); }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-primary);
    font-size: 20px; cursor: pointer; }
.page-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.ws-status { font-size: 10px; transition: color 0.3s ease; }
.online-count { font-size: 12px; color: var(--text-secondary); }

.content-area { padding: 24px; flex: 1; overflow-y: auto; }

/* -- Auth Card -- */
.auth-card { background: rgba(16, 16, 28, 0.7); backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: 16px;
    padding: 40px; width: 400px; box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 80px rgba(139,92,246,.08); }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 22px; margin-top: 12px; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* -- Stats -- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    padding: 20px; text-align: center; transition: all 0.25s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--glow-accent); border-color: rgba(139,92,246,.2); }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.stat-primary .stat-value { color: var(--accent); }
.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-danger .stat-value { color: var(--danger); }
.stat-info .stat-value { color: var(--info); }
.stat-accent .stat-value { color: var(--accent); }
.stat-purple .stat-value { color: var(--purple); }

/* -- Panels -- */
.panel { background: var(--bg-card); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,.2); }
.panel-header { display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--glass-border); }
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 16px 18px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* -- Tables -- */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 10px 14px; font-size: 11px; text-transform: uppercase;
    color: var(--text-muted); letter-spacing: .5px; border-bottom: 1px solid var(--glass-border); }
.table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.03); font-size: 13px;
    color: var(--text-secondary); transition: background 0.15s; }
.table-hover tr:hover td { background: rgba(139,92,246,.04); }
.clickable-row { cursor: pointer; }
.w-check { width: 36px; }

/* -- Badges -- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.badge-success { background: rgba(52,211,153,.15); color: var(--success); }
.badge-danger { background: rgba(248,113,113,.15); color: var(--danger); }
.badge-warning { background: rgba(251,191,36,.15); color: var(--warning); }
.badge-info { background: rgba(96,165,250,.15); color: var(--info); }
.badge-secondary { background: rgba(139,143,163,.12); color: var(--text-muted); }
.badge-purple { background: rgba(192,132,252,.15); color: var(--purple); }
.badge-cyan { background: rgba(34,211,238,.12); color: var(--cyan); }
.badge-pink { background: rgba(244,114,182,.12); color: var(--pink); }

/* -- Buttons -- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--glass-border);
    background: rgba(20,20,35,.6); color: var(--text-primary); transition: all 0.2s ease; text-decoration: none;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn:hover { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.2); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #7c3aed); border-color: transparent; color: #fff; }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), #8b5cf6);
    box-shadow: 0 0 20px rgba(139,92,246,.35); }
.btn-danger { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.3); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; box-shadow: 0 0 15px rgba(248,113,113,.2); }
.btn-warning { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.3); color: var(--warning); }
.btn-accent { background: rgba(192,132,252,.1); border-color: rgba(192,132,252,.3); color: var(--purple); }
.btn-accent:hover { background: var(--purple); color: #fff; box-shadow: 0 0 15px rgba(192,132,252,.2); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }
.btn-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }

/* -- Forms -- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary);
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }
.input, .input-select, .input-search {
    width: 100%; padding: 9px 12px; background: rgba(10,10,20,.6); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; transition: all 0.2s ease; }
.input:focus, .input-select:focus, .input-search:focus {
    outline: none; border-color: rgba(139,92,246,.4);
    box-shadow: 0 0 0 3px rgba(139,92,246,.1), 0 0 20px rgba(139,92,246,.05); }
.input-select { cursor: pointer; }
.input-search { max-width: 300px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
textarea.input { resize: vertical; min-height: 80px; font-family: inherit; }
.error-msg { padding: 8px 12px; background: rgba(248,113,113,.08); color: var(--danger);
    border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px;
    border: 1px solid rgba(248,113,113,.15); }

/* -- Toolbar -- */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px;
    flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; }

/* -- Bulk Panel -- */
.bulk-panel { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    background: rgba(139,92,246,.06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(139,92,246,.2); border-radius: var(--radius); margin-bottom: 16px; }

/* -- Pagination -- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.page-info { font-size: 13px; color: var(--text-secondary); }

/* -- Modal -- */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: rgba(16,16,28,.85); backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); border-radius: var(--radius);
    width: 450px; max-height: 80vh; overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.5), 0 0 60px rgba(139,92,246,.06); }
.modal-header { display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--glass-border); }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--glass-border); text-align: right; }

/* -- Detail page -- */
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.detail-title { display: flex; align-items: center; gap: 12px; }
.detail-title h2 { font-size: 22px; }
.detail-actions { display: flex; gap: 8px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .5px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.metric-value { font-size: 24px; font-weight: 700;
    background: linear-gradient(135deg, var(--accent-hover), var(--cyan));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(139,92,246,.2)); }
.metric-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }

/* -- Remote -- */
.remote-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.remote-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.screen-container { background: #000; border-radius: var(--radius); min-height: 400px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    border: 1px solid var(--glass-border); }
.screen-placeholder { color: var(--text-muted); font-size: 14px; }

.output-box { background: rgba(4,4,10,.8); padding: 12px; border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace; font-size: 12px;
    color: var(--success); white-space: pre-wrap; overflow-x: auto; max-height: 500px; overflow-y: auto;
    border: 1px solid var(--glass-border); }

.file-list { margin-top: 8px; }
.group-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px;
    border: 1px solid rgba(139,92,246,.2); background: rgba(139,92,246,.06); }
.device-link { color: var(--accent-hover); text-decoration: none; transition: all 0.2s ease; }
.device-link:hover { color: #c4b5fd; text-decoration: none; text-shadow: 0 0 10px rgba(139,92,246,.3); }
.device-name { font-weight: 500; }

.checkbox-item { display: block; padding: 4px 0; font-size: 13px; }
.checkbox-item input { margin-right: 8px; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; }
.alert-success { background: rgba(52,211,153,.06); color: var(--success); border: 1px solid rgba(52,211,153,.15); }
.alert-warning { background: rgba(251,191,36,.06); color: var(--warning); border: 1px solid rgba(251,191,36,.15); }

/* -- Utilities -- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.text-sm { font-size: 12px; }
.mt-2 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }
.selected td { background: rgba(139,92,246,.06) !important; }

/* -- Scrollbar -- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,.25); }

/* -- Responsive -- */
@media (max-width: 1024px) {
    .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
    .remote-layout { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content, .sidebar.collapsed ~ .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .info-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .content-area { padding: 12px; }
}

/* ═══════════════════════════════════════════ */
/*  Toast Notification System                 */
/* ═══════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10000;
    display: flex; flex-direction: column-reverse; gap: 8px; max-width: 380px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
    background: rgba(16, 16, 28, 0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,.5); font-size: 13px; color: var(--text-primary);
    animation: toastIn 0.3s cubic-bezier(.4,0,.2,1); min-width: 280px;
    transition: all 0.3s ease; }
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.toast-msg { font-size: 12px; color: var(--text-secondary); line-height: 1.35; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px;
    padding: 2px; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 2px; border-radius: 0 0 0 var(--radius-sm);
    animation: toastProgress linear forwards; }
.toast-success .toast-progress { background: var(--success); }
.toast-error .toast-progress { background: var(--danger); }
.toast-warning .toast-progress { background: var(--warning); }
.toast-info .toast-progress { background: var(--info); }

@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }
@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ═══════════════════════════════════════════ */
/*  Recording & Status Animations             */
/* ═══════════════════════════════════════════ */
@keyframes pulse-record { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.recording-pulse { animation: pulse-record 1.5s ease-in-out infinite; }
.recording-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger); animation: pulse-record 1s ease-in-out infinite; margin-right: 6px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--glass-border);
    border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.fade-in { animation: fadeIn 0.3s ease; }

/* ═══════════════════════════════════════════ */
/*  Connection Quality Indicator              */
/* ═══════════════════════════════════════════ */
.quality-indicator { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; }
.quality-dot { width: 6px; height: 6px; border-radius: 50%; }
.quality-good .quality-dot { background: var(--latency-good); box-shadow: 0 0 6px var(--latency-good); }
.quality-fair .quality-dot { background: var(--latency-fair); box-shadow: 0 0 6px var(--latency-fair); }
.quality-poor .quality-dot { background: var(--latency-poor); box-shadow: 0 0 6px var(--latency-poor); }
.quality-bad .quality-dot { background: var(--latency-bad); box-shadow: 0 0 6px var(--latency-bad); }
.quality-good { color: var(--latency-good); }
.quality-fair { color: var(--latency-fair); }
.quality-poor { color: var(--latency-poor); }
.quality-bad { color: var(--latency-bad); }

/* ═══════════════════════════════════════════ */
/*  Activity Feed                             */
/* ═══════════════════════════════════════════ */
.activity-feed { max-height: 400px; overflow-y: auto; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.03); animation: fadeIn 0.2s ease; }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 14px; flex-shrink: 0; }
.activity-icon.act-device { background: rgba(96,165,250,.12); }
.activity-icon.act-task { background: rgba(139,92,246,.12); }
.activity-icon.act-user { background: rgba(52,211,153,.12); }
.activity-icon.act-alert { background: rgba(248,113,113,.12); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-secondary); }
.activity-text strong { color: var(--text-primary); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══════════════════════════════════════════ */
/*  Stat Card Enhancements                    */
/* ═══════════════════════════════════════════ */
.stat-card { position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; width: 60px; height: 60px;
    border-radius: 50%; opacity: 0.06; transform: translate(20px, -20px); transition: all 0.3s ease; }
.stat-primary::after { background: var(--accent); }
.stat-success::after { background: var(--success); }
.stat-warning::after { background: var(--warning); }
.stat-danger::after { background: var(--danger); }
.stat-info::after { background: var(--info); }
.stat-change { font-size: 11px; margin-top: 4px; font-weight: 500; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-sparkline { height: 30px; margin-top: 8px; }

/* ═══════════════════════════════════════════ */
/*  System Health Bar                         */
/* ═══════════════════════════════════════════ */
.health-bar { height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; }
.health-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease, background 0.3s ease; }
.health-good .health-fill { background: linear-gradient(90deg, var(--success), #2dd4bf); }
.health-warn .health-fill { background: linear-gradient(90deg, var(--warning), #f97316); }
.health-crit .health-fill { background: linear-gradient(90deg, var(--danger), #dc2626); }

/* ═══════════════════════════════════════════ */
/*  Quick Action Grid                         */
/* ═══════════════════════════════════════════ */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.quick-action-btn { display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; background: var(--bg-card); border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
    color: var(--text-secondary); font-size: 11px; text-align: center; }
.quick-action-btn:hover { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.2);
    color: var(--text-primary); transform: translateY(-2px); }
.quick-action-btn .qa-icon { font-size: 20px; }

/* ═══════════════════════════════════════════ */
/*  Empty State                               */
/* ═══════════════════════════════════════════ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 16px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state .empty-desc { font-size: 13px; max-width: 400px; margin: 0 auto; }

/* ═══════════════════════════════════════════ */
/*  Kbd / Shortcut Tags                       */
/* ═══════════════════════════════════════════ */
kbd { display: inline-block; padding: 2px 6px; font-size: 11px; font-family: 'JetBrains Mono', monospace;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 4px;
    color: var(--text-secondary); }
