/* ═══════════════════════════════════════════════════════════════
   HAZTEUNSITIO STREAMING — Panel Design System
   Inspirado en: DigitalOcean, Stripe Dashboard, Linear
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:      #07070f;
  --bg-surface:   #0d0d1c;
  --bg-elevated:  #111128;
  --bg-card:      #13132a;
  --bg-hover:     #181835;
  --bg-input:     #0e0e20;

  /* Borders */
  --border:       rgba(108, 99, 255, 0.14);
  --border-focus: rgba(108, 99, 255, 0.5);
  --border-light: rgba(255,255,255,0.06);

  /* Brand */
  --primary:      #6c63ff;
  --primary-dark: #4f48c4;
  --primary-glow: rgba(108,99,255,0.25);
  --secondary:    #3ecfcf;
  --accent:       #f72585;

  /* Status */
  --success:      #10d98a;
  --success-bg:   rgba(16,217,138,0.1);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245,158,11,0.1);
  --danger:       #ef4444;
  --danger-bg:    rgba(239,68,68,0.1);
  --info:         #3b82f6;
  --info-bg:      rgba(59,130,246,0.1);

  /* Text */
  --text-1:       #f0f0ff;
  --text-2:       #9898c0;
  --text-3:       #5c5c82;
  --text-muted:   #3d3d5c;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6c63ff 0%, #3ecfcf 100%);
  --grad-purple:  linear-gradient(135deg, #7c3aed 0%, #6c63ff 100%);
  --grad-warm:    linear-gradient(135deg, #f72585 0%, #7209b7 100%);
  --grad-green:   linear-gradient(135deg, #10d98a 0%, #059669 100%);
  --grad-card:    linear-gradient(145deg, rgba(108,99,255,0.07) 0%, rgba(62,207,207,0.03) 100%);

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow:  0 0 30px rgba(108,99,255,0.2);
  --shadow-card:  0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--border);

  /* Misc */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    20px;
  --radius-full:  9999px;

  --transition:   all 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.35s cubic-bezier(0.4,0,0.2,1);

  --sidebar-w:    260px;
  --header-h:     64px;
  --font-sans:    'Inter', -apple-system, sans-serif;
  --font-title:   'Space Grotesk', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Aliases v3 — usados en templates de auth y admin */
  --bg-1:       #07070f;
  --bg-2:       #0d0d1c;
  --surface-1:  #13132a;
  --border-1:   rgba(108,99,255,0.14);
  --radius-md:  12px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-1);
  line-height: 1.6;
  -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: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::selection { background: rgba(108,99,255,0.3); }

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

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  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;
}

.sidebar::-webkit-scrollbar { width: 0; }

/* Logo */
.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar__logo-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar__logo-text {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar__logo-text span {
  display: block;
  font-size: 0.65rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Server status badge */
.sidebar__server-badge {
  margin: 12px 16px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
}

.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.online-dot.warning { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.online-dot.danger  { background: var(--danger);  box-shadow: 0 0 8px var(--danger); }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}

/* Nav sections */
.sidebar__section {
  padding: 16px 12px 4px;
}

.sidebar__section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 8px;
  margin-bottom: 6px;
}

/* Nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.87rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
}

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

.nav-item.active {
  background: rgba(108,99,255,0.12);
  color: var(--primary);
}

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

.nav-item__icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: transparent;
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item.active .nav-item__icon {
  background: rgba(108,99,255,0.15);
  color: var(--primary);
}

.nav-item:hover .nav-item__icon {
  background: var(--bg-elevated);
}

.nav-item__badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--primary-glow);
  color: var(--primary);
}

.nav-item__badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Sub-nav */
.nav-sub { margin-left: 16px; border-left: 1px solid var(--border); padding-left: 8px; }

/* Sidebar footer */
.sidebar__footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}

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

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

.sidebar__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar__user-info { min-width: 0; }
.sidebar__user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-1); truncate: ellipsis; }
.sidebar__user-role { font-size: 0.72rem; color: var(--primary); font-weight: 600; }

/* ── 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: rgba(13,13,28,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

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

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

.topbar__notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-surface);
}

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

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

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

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

/* ── STAT CARDS ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  pointer-events: none;
}

.stat-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.stat-card__icon.purple  { background: rgba(108,99,255,0.15); color: var(--primary); }
.stat-card__icon.teal    { background: rgba(62,207,207,0.12); color: var(--secondary); }
.stat-card__icon.green   { background: var(--success-bg);    color: var(--success); }
.stat-card__icon.orange  { background: var(--warning-bg);    color: var(--warning); }
.stat-card__icon.red     { background: var(--danger-bg);     color: var(--danger); }
.stat-card__icon.blue    { background: var(--info-bg);       color: var(--info); }

.stat-card__value {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 6px;
}

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

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

.stat-card__delta.up   { background: var(--success-bg); color: var(--success); }
.stat-card__delta.down { background: var(--danger-bg);  color: var(--danger); }

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

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

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

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

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

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

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

/* ── BADGES / STATUS ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

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

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-success::before { background: var(--success); }

.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-warning::before { background: var(--warning); }

.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-danger::before { background: var(--danger); }

.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-info::before { background: var(--info); }

.badge-muted   { background: rgba(255,255,255,0.05); color: var(--text-2); }
.badge-muted::before { background: var(--text-3); }

.badge-purple  { background: var(--primary-glow); color: var(--primary); }
.badge-purple::before { background: var(--primary); }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(108,99,255,0.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.5);
}

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

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16,217,138,0.3);
}
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

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

.btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.btn-lg { padding: 11px 22px; font-size: 0.95rem; }
.btn-icon { padding: 8px; }

/* ── FORMS ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

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

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-1);
  font-size: 0.87rem;
  transition: var(--transition);
}

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

.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='%239898c0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

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

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

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

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

/* ── SERVER CARDS ────────────────────────────────────────────── */
.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.server-card:hover { border-color: var(--border-focus); box-shadow: var(--shadow-glow); }

.server-card__header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}

.server-card__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-1);
}

.server-card__ip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  margin-top: 2px;
}

/* Gauges de recursos */
.resource-bar { margin-bottom: 12px; }
.resource-bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 5px;
}
.resource-bar__track {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.resource-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
  background: var(--grad-primary);
}
.resource-bar__fill.warning { background: linear-gradient(90deg, var(--warning), #ff8c00); }
.resource-bar__fill.danger  { background: linear-gradient(90deg, var(--danger), #ff0058); }

/* ── LIVE STATS WIDGET ───────────────────────────────────────── */
.live-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

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

.live-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.live-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse-dot 1s ease-in-out infinite;
}

/* ── SEARCH ──────────────────────────────────────────────────── */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box__icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  font-size: 0.9rem;
  pointer-events: none;
}
.search-box input {
  padding-left: 36px;
  min-width: 240px;
}

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

.page-link {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  font-size: 0.83rem;
  color: var(--text-2);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.page-link:hover { background: var(--bg-hover); color: var(--text-1); }
.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: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.alert-item.critical { background: var(--danger-bg); border-left: 3px solid var(--danger); }
.alert-item.warning  { background: var(--warning-bg);border-left: 3px solid var(--warning);}
.alert-item.info     { background: var(--info-bg);   border-left: 3px solid var(--info);  }

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

.info-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

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

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

.copy-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: var(--transition);
}
.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;
}

.autodj-panel__header {
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(108,99,255,0.1), rgba(62,207,207,0.05));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.now-playing__vinyl {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  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: 20px;
}

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

/* ── MODAL ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

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

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s 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: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
}

.modal__body { padding: 20px 24px; }
.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── TOAST ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes toast-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.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);    }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state__title { font-weight: 700; font-size: 1.1rem; margin-bottom: 6px; }
.empty-state__desc { font-size: 0.87rem; color: var(--text-3); margin-bottom: 20px; }

/* ── TABS ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  width: fit-content;
}

.tab {
  padding: 7px 16px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-2);
  transition: var(--transition);
  cursor: pointer;
}

.tab.active, .tab:hover {
  background: var(--bg-card);
  color: var(--text-1);
}
.tab.active { box-shadow: var(--shadow-sm); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}

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

/* ── LOADING ─────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
