/* ============================================================
   Fábrica de Rádios — Painel de Gestão
   Design System: Dark sidebar + Light content (mesmo molde do Admin Master)
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --sidebar-bg:   #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-hover:#1e293b;
  --primary:      #6366f1;
  --primary-hover:#4f46e5;
  --danger:       #dc2626;
  --danger-hover: #b91c1c;
  --success:      #10b981;
  --warn:         #f59e0b;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg:    0 10px 25px rgba(0,0,0,0.1);
  --font:         'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:         'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  --accent:       #6366f1;
  --accent-bg:    rgba(99,102,241,0.08);
}

html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
}

/* --- Login Overlay --- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}
.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.login-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 90%;
  max-width: 360px;
  text-align: center;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.login-box h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}
.login-box h2 span { color: #818cf8; }
.login-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
}
.login-form { text-align: left; }
.login-form .form-group { margin-bottom: 0.75rem; }
.login-form label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}
.login-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: 0.2s;
}
.login-form input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.login-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  text-align: center;
}
.login-error.hidden { display: none; }

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo { font-size: 2rem; }
.sidebar-brand h1 { font-size: 1.2rem; font-weight: 700; color: #fff; }
.sidebar-brand small { font-size: 0.7rem; color: var(--sidebar-text); opacity: 0.7; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.nav-tab:hover { background: var(--sidebar-hover); color: #fff; }
.nav-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  max-width: 1400px;
}

.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.6rem; font-weight: 700; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); }

/* --- Stats Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat-card .stat-icon { font-size: 1.3rem; margin-bottom: 6px; }
.stat-card .stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; margin: 2px 0; }
.stat-card .stat-sub { font-size: 0.75rem; color: var(--text-muted); }

/* --- Toolbar --- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.toolbar .search-box {
  flex: 1;
  min-width: 180px;
  max-width: 360px;
  position: relative;
}
.toolbar .search-box input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
}
.toolbar .search-box input:focus { border-color: var(--primary); }
.toolbar .search-box .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}
.toolbar select {
  padding: 9px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font);
  outline: none;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}
.toolbar select:focus { border-color: var(--primary); }
.toolbar .toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* --- Radio Cards Grid --- */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.radio-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.radio-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.radio-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.radio-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.radio-card-title {
  flex: 1;
  min-width: 0;
}
.radio-card-title h4 { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-card-title .slug { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); }
.radio-card-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.radio-card-body { padding: 14px 20px; }
.radio-card-body .desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.radio-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.radio-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 3px 0;
}
.radio-meta .meta-item .meta-label { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.3px; min-width: 50px; }

.radio-card-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  flex-wrap: wrap;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-test { background: #fef3c7; color: #92400e; }
.badge-paused { background: #f1f5f9; color: #475569; }
.badge-archived { background: #fee2e2; color: #991b1b; }

.badge-plan { border-radius: 4px; padding: 2px 8px; font-size: 0.65rem; background: #eef2ff; color: #4338ca; }
.badge-plan.plan-basic { background: #f1f5f9; color: #475569; }
.badge-plan.plan-pro { background: #eef2ff; color: #4338ca; }
.badge-plan.plan-enterprise { background: #f3e8ff; color: #7c3aed; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:active { transform: scale(0.97); }

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

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

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

.btn-warn { background: var(--warn); color: #fff; }
.btn-warn:hover { background: #d97706; }

.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #f1f5f9; border-color: #94a3b8; }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* --- Forms --- */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  max-width: 800px;
}
.form-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.form-card .form-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color 0.2s;
  background: #fafbfc;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
}

/* --- Color/Icon Pickers --- */
.color-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }

.icon-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.icon-option {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}
.icon-option:hover { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.icon-option.selected { border-color: var(--primary); background: rgba(99,102,241,0.15); }

/* --- Contact Section --- */
.contact-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}
.contact-section h3 { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 12px; }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 0.9rem; }
.empty-state.error { color: var(--danger); }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}

/* --- Modal Details (rádio) --- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-field { margin-bottom: 4px; }
.detail-field .detail-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
.detail-field .detail-value { font-size: 0.9rem; margin-top: 2px; word-break: break-word; }
.detail-field.full { grid-column: 1 / -1; }

/* --- Spinner --- */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

/* --- Toast --- */
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: slideInRight 0.3s ease;
  margin-top: 8px;
}
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-warn { background: #f59e0b; }
.toast-info { background: #6366f1; }

/* --- Data Table (Backup) --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 16px;
}
.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.data-table tr:hover td { background: #f8fafc; }

/* --- Backup Section --- */
.backup-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.backup-file-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px dashed var(--border);
  cursor: pointer;
  transition: 0.2s;
}
.backup-file-input:hover { border-color: var(--primary); background: rgba(99,102,241,0.04); }
.backup-file-input input[type=file] { display: none; }

/* --- Animation --- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Responsive --- */
@media (max-width: 768px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
    gap: 6px;
  }
  .sidebar-brand { padding: 10px; flex: 1; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 6px; }
  .nav-tab { padding: 8px 12px; font-size: 0.78rem; }
  .sidebar-footer { display: none; }
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .radio-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-box { width: 95%; }
  .toolbar { flex-direction: column; }
  .toolbar .search-box { max-width: 100%; }
  .toolbar .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar .toolbar-actions .btn { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ===================================================================
   DASHBOARD — Comerciais nos cards
   =================================================================== */
.radio-comerciais {
  margin: 12px 0 4px;
  padding: 10px 12px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 10px;
}
.radio-comerciais-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.radio-comerciais-header .badge-count {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--card);
  padding: 1px 8px;
  border-radius: 10px;
}
.radio-comerciais-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.comercial-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 4px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}
.comercial-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.comercial-time {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--card);
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.comercial-duration {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===================================================================
   MONITOR — AzuraCast Live Status
   =================================================================== */
.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.monitor-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.monitor-stat {
  font-size: 0.82rem;
  background: var(--card);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.monitor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.monitor-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.monitor-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.monitor-card.online {
  border-left: 4px solid var(--success);
}
.monitor-card.offline {
  border-left: 4px solid var(--danger);
}
.monitor-card.checking {
  border-left: 4px solid var(--text-muted);
}
.monitor-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.monitor-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.monitor-card-info {
  flex: 1;
  min-width: 0;
}
.monitor-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-card-slug {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-status-indicator {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.monitor-status-indicator.online {
  background: rgba(16,185,129,0.12);
}
.monitor-status-indicator.offline {
  background: rgba(239,68,68,0.12);
}
.monitor-nowplaying {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.monitor-nowplaying.dimmed {
  opacity: 0.6;
}
.monitor-song {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.monitor-song-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.monitor-song-text {
  flex: 1;
  min-width: 0;
}
.monitor-song-title {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-song-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-listeners {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--card);
  border-radius: 20px;
}
.monitor-live-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--danger);
  background: rgba(239,68,68,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.monitor-error {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
}
.monitor-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.monitor-comerciais-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 4px 10px;
  background: rgba(99,102,241,0.06);
  border-radius: 8px;
  transition: background 0.2s;
}
.monitor-comerciais-info:hover {
  background: rgba(99,102,241,0.12);
}
.monitor-card-buttons {
  display: flex;
  gap: 6px;
}

/* ===================================================================
   COMERCIAIS PANEL (inside modal)
   =================================================================== */
.comerciais-panel {
  max-height: 65vh;
  overflow-y: auto;
}
.comerciais-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.comerciais-novo {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(99,102,241,0.04);
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.comerciais-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.comerciais-form input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  background: var(--input-bg);
  color: var(--text);
}
.comerciais-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comercial-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: opacity 0.3s;
}
.comercial-item.inactive {
  opacity: 0.5;
}
.comercial-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.comercial-icon {
  font-size: 1.2rem;
}
.comercial-name {
  font-weight: 600;
  font-size: 0.85rem;
}
.comercial-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.comercial-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 20px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

@media (max-width: 720px) {
  .monitor-grid { grid-template-columns: 1fr; }
  .monitor-stats { gap: 8px; }
  .monitor-header { flex-direction: column; align-items: stretch; }
  .monitor-card-buttons .btn { font-size: 0.72rem; padding: 5px 8px; }
}
