/* ═══════════════════════════════════════════════════════════════
   HAZTEUNSITIO STREAMING — Panel v3 (SonicPanel Style)
   Tema: Profesional · Sidebar oscuro azul · Contenido claro
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  /* Sidebar */
  --sb-bg:          #1a2535;
  --sb-bg-section:  #16202e;
  --sb-border:      rgba(255,255,255,0.07);
  --sb-text:        #8fa8c8;
  --sb-text-hover:  #c8ddf0;
  --sb-text-active: #ffffff;
  --sb-active:      rgba(59,130,246,0.22);
  --sb-hover:       rgba(255,255,255,0.05);
  --sb-section-lbl: #4a637e;
  --sb-accent:      #3b82f6;

  /* Main area */
  --bg-base:      #eef1f7;
  --bg-surface:   #f4f6fb;
  --bg-elevated:  #edf0f8;
  --bg-card:      #ffffff;
  --bg-hover:     #f0f4ff;
  --bg-input:     #ffffff;

  /* Borders */
  --border:       #dde3ec;
  --border-focus: #3b82f6;
  --border-light: #eaeff7;

  /* Brand */
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-glow: rgba(37,99,235,0.15);
  --secondary:    #0ea5e9;
  --accent:       #7c3aed;

  /* Status */
  --success:      #16a34a;
  --success-bg:   #f0fdf4;
  --warning:      #d97706;
  --warning-bg:   #fffbeb;
  --danger:       #dc2626;
  --danger-bg:    #fef2f2;
  --info:         #0284c7;
  --info-bg:      #f0f9ff;

  /* Text */
  --text-1:       #1e293b;
  --text-2:       #64748b;
  --text-3:       #94a3b8;
  --text-muted:   #cbd5e1;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  --grad-purple:  linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --grad-warm:    linear-gradient(135deg, #f43f5e 0%, #7c3aed 100%);
  --grad-green:   linear-gradient(135deg, #16a34a 0%, #059669 100%);
  --grad-card:    none;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:    0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-glow:  0 0 0 3px rgba(37,99,235,0.15);
  --shadow-card:  0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);

  /* Misc */
  --radius-sm:    4px;
  --radius:       6px;
  --radius-lg:    8px;
  --radius-xl:    12px;
  --radius-md:    8px;
  --radius-full:  9999px;

  --transition:   all 0.18s ease;
  --transition-slow: all 0.3s ease;

  --sidebar-w:    230px;
  --header-h:     52px;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-title:   'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;

  /* Aliases */
  --bg-1:       #eef1f7;
  --bg-2:       #f4f6fb;
  --bg-3:       #edf0f8;
  --surface-1:  #ffffff;
  --surface-2:  #f4f6fb;
  --border-1:   #dde3ec;
  --border-2:   #eaeff7;
  --shadow-auth: 0 8px 30px rgba(0,0,0,0.1);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::selection { background: rgba(37,99,235,0.2); }

/* ── Layout ──────────────────────────────────────────────────── */
.panel-layout {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR — Estilo SonicPanel (azul oscuro profesional)
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--sb-border);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* Logo */
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 54px;
  background: #111d2c;
  border-bottom: 1px solid rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.sidebar__logo-icon {
  width: 32px; height: 32px;
  background: var(--sb-accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar__logo-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.sidebar__logo-text span {
  display: block;
  font-size: 0.62rem;
  color: var(--sb-text);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Server status badge */
.sidebar__server-badge {
  margin: 10px 12px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--sb-text);
  flex-shrink: 0;
}

.sidebar__server-badge > div > div:first-child {
  color: #c8ddf0 !important;
  font-weight: 600;
}

.online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.online-dot.warning { background: #f59e0b; }
.online-dot.danger  { background: #ef4444; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Nav sections */
.sidebar__section {
  padding: 4px 0;
  flex-shrink: 0;
}

.sidebar__section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sb-section-lbl);
  padding: 10px 16px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar__section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.05);
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px 7px 16px;
  color: var(--sb-text);
  font-size: 0.82rem;
  font-weight: 400;
  transition: var(--transition);
  position: relative;
  margin: 1px 6px;
  border-radius: 5px;
}

.nav-item:hover {
  background: var(--sb-hover);
  color: var(--sb-text-hover);
}

.nav-item.active {
  background: var(--sb-active);
  color: var(--sb-text-active);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -6px; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--sb-accent);
  border-radius: 0 3px 3px 0;
}

.nav-item__icon {
  width: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-item__icon { opacity: 1; color: var(--sb-accent); }
.nav-item:hover .nav-item__icon  { opacity: 1; }

.nav-item__badge {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(59,130,246,0.2);
  color: #7dd3fc;
}

.nav-item__badge.danger {
  background: rgba(220,38,38,0.2);
  color: #fca5a5;
}

/* Sub-nav */
.nav-sub { margin-left: 24px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.07); }

/* Sidebar footer */
.sidebar__footer {
  margin-top: auto;
  padding: 10px 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 5px;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar__user:hover { background: var(--sb-hover); }

.sidebar__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--sb-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar__user-info { min-width: 0; flex: 1; }
.sidebar__user-name { font-size: 0.78rem; font-weight: 600; color: #c8ddf0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 0.65rem; color: var(--sb-section-lbl); margin-top: 1px; text-transform: capitalize; }

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ──────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: 0.8rem;
}
.topbar__breadcrumb a { color: var(--text-2); transition: var(--transition); }
.topbar__breadcrumb a:hover { color: var(--primary); }
.topbar__breadcrumb strong { color: var(--text-1); font-weight: 600; }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__btn {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  background: transparent;
  font-size: 0.9rem;
  transition: var(--transition);
  position: relative;
  border: 1px solid transparent;
}
.topbar__btn:hover { background: var(--bg-elevated); color: var(--text-1); border-color: var(--border); }

.topbar__notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
  font-size: 0; line-height: 0;
}

/* ── PAGE CONTENT ────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 20px 22px;
}

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

.page-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
}

.page-subtitle {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 2px;
  font-weight: 400;
}

/* ══════════════════════════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.stat-card::before { display: none; }

.stat-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card__icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.stat-card__icon.purple  { background: #ede9fe; color: #7c3aed; }
.stat-card__icon.teal    { background: #e0f2fe; color: #0284c7; }
.stat-card__icon.green   { background: #dcfce7; color: #16a34a; }
.stat-card__icon.orange  { background: #fef3c7; color: #d97706; }
.stat-card__icon.red     { background: #fee2e2; color: #dc2626; }
.stat-card__icon.blue    { background: #dbeafe; color: #2563eb; }

.stat-card__value {
  font-family: var(--font-sans);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card__label {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 500;
}

.stat-card__delta {
  position: absolute;
  top: 14px; right: 14px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.stat-card__delta.up   { background: #dcfce7; color: #16a34a; }
.stat-card__delta.down { background: #fee2e2; color: #dc2626; }

/* ══════════════════════════════════════════════════════════════
   DATA TABLE
   ══════════════════════════════════════════════════════════════ */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
  background: #fafbfc;
}

.table-card__title {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 7px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead th {
  padding: 9px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: #f8f9fc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f5f8ff; }

tbody td {
  padding: 10px 14px;
  color: var(--text-1);
  vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-success::before { background: #16a34a; }

.badge-warning { background: #fef3c7; color: #b45309; }
.badge-warning::before { background: #d97706; }

.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-danger::before { background: #dc2626; }

.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-info::before { background: #2563eb; }

.badge-muted   { background: #f1f5f9; color: #64748b; }
.badge-muted::before { background: #94a3b8; }

.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-purple::before { background: #7c3aed; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary {
  background: #ffffff;
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-elevated); border-color: #bfdbfe; color: var(--primary); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #15803d; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-1); }

.btn-sm { padding: 4px 10px; font-size: 0.73rem; }
.btn-lg { padding: 10px 20px; font-size: 0.9rem; }
.btn-icon { padding: 6px; }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-1);
  font-size: 0.82rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-control::placeholder { color: var(--text-3); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.form-hint  { font-size: 0.73rem; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 0.73rem; color: var(--danger); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════════
   CARDS — Nuevo estilo: blancas con sombra sutil
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.card__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 7px;
}

.card__body {
  padding: 16px;
}

/* Alias for templates using old names */
.card-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-title   { font-size: 0.87rem; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 7px; }

/* ══════════════════════════════════════════════════════════════
   SERVER CARDS
   ══════════════════════════════════════════════════════════════ */
.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.server-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-md); }

.server-card__header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.server-card__name   { font-weight: 700; font-size: 0.87rem; color: var(--text-1); }
.server-card__ip     { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2); margin-top: 2px; }

/* Resource bars */
.resource-bar { margin-bottom: 10px; }
.resource-bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-2);
  margin-bottom: 4px;
}
.resource-bar__track {
  height: 5px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.resource-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
  background: var(--primary);
}
.resource-bar__fill.warning { background: var(--warning); }
.resource-bar__fill.danger  { background: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   LIVE WIDGET
   ══════════════════════════════════════════════════════════════ */
.live-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.live-widget__header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #dc2626;
  background: #fee2e2;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.live-label::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #dc2626;
  animation: pulse-dot 1s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════════════
   SEARCH BOX
   ══════════════════════════════════════════════════════════════ */
.search-box { position: relative; display: flex; align-items: center; }
.search-box__icon { position: absolute; left: 10px; color: var(--text-3); font-size: 0.82rem; pointer-events: none; }
.search-box input { padding-left: 32px; min-width: 220px; }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.page-link {
  min-width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 0.78rem;
  color: var(--text-2);
  background: #ffffff;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.page-link:hover { background: var(--bg-elevated); color: var(--primary); border-color: #bfdbfe; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.alert-item.critical { background: #fef2f2; border-left: 3px solid var(--danger); color: #991b1b; }
.alert-item.warning  { background: #fffbeb; border-left: 3px solid var(--warning); color: #92400e; }
.alert-item.info     { background: #eff6ff; border-left: 3px solid var(--info);    color: #1e40af; }

/* ══════════════════════════════════════════════════════════════
   STREAM INFO GRID
   ══════════════════════════════════════════════════════════════ */
.stream-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.info-block {
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.info-block__label {
  font-size: 0.68rem;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.info-block__value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-1);
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: var(--transition);
  cursor: pointer;
}
.copy-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   AUTODJ CONTROLS
   ══════════════════════════════════════════════════════════════ */
.autodj-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.autodj-panel__header {
  padding: 13px 16px;
  background: #f0f7ff;
  border-bottom: 1px solid #dbeafe;
  display: flex;
  align-items: center;
  gap: 10px;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.now-playing__vinyl {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.now-playing__vinyl.spinning {
  animation: spin-vinyl 3s linear infinite;
}

@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════════
   CHARTS
   ══════════════════════════════════════════════════════════════ */
.chart-container {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.chart-container canvas { max-height: 200px; }

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open,
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}

.modal-overlay.open .modal,
.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.modal__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal__body { padding: 18px 20px; }

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  min-width: 280px;
  max-width: 380px;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  cursor: pointer;
}

.toast.show { transform: translateX(0); }
.toast.hide  { transform: translateX(110%); }

.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__icon { font-size: 1rem; }
.toast.success .toast__icon { color: var(--success); }
.toast.error   .toast__icon { color: var(--danger); }
.toast.warning .toast__icon { color: var(--warning); }
.toast.info    .toast__icon { color: var(--info); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state__icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
  opacity: 0.3;
}

.empty-state__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-state__subtitle {
  font-size: 0.82rem;
  color: var(--text-3);
}

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab-btn:hover { color: var(--primary); background: var(--bg-elevated); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   STATUS DOT
   ══════════════════════════════════════════════════════════════ */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online  { background: var(--success); }
.status-dot.offline { background: var(--text-3); }
.status-dot.error   { background: var(--danger); }
.status-dot.warning { background: var(--warning); }

/* ══════════════════════════════════════════════════════════════
   DROPDOWN
   ══════════════════════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-size: 0.82rem;
  color: var(--text-1);
  transition: var(--transition);
  cursor: pointer;
}
.dropdown-item:hover { background: #f5f8ff; color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ══════════════════════════════════════════════════════════════
   PROGRESS BAR (genérica)
   ══════════════════════════════════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.6s ease;
}

/* ══════════════════════════════════════════════════════════════
   AUDIO PLAYER MINI
   ══════════════════════════════════════════════════════════════ */
.mini-player {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ══════════════════════════════════════════════════════════════
   MEDIA QUERIES (Mobile)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .table-card__header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-3)  !important; }
.text-bold    { font-weight: 700 !important; }
.text-mono    { font-family: var(--font-mono) !important; }

.d-flex  { display: flex; }
.d-grid  { display: grid; }
.d-none  { display: none !important; }
.d-block { display: block !important; }

.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

.w-100 { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded { border-radius: var(--radius-full) !important; }
