/* ============================================================
   DASHBOARD - ESTILOS VISUAIS
   Design de Alto Padrão, Dark Mode Glassmorphism & Microinterações
   ============================================================ */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(26, 36, 56, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #ef4444;
  --brand-red: #ef4444;
  --brand-red-glow: rgba(239, 68, 68, 0.35);
  --brand-emerald: #10b981;
  --brand-cyan: #06b6d4;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(239, 68, 68, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  padding-bottom: 4rem;
  -webkit-font-smoothing: antialiased;
}

/* ==============================================
   NAVBAR
   ============================================== */
.dash-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: var(--brand-red);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px var(--brand-red-glow);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.nav-status-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.online {
  background: var(--brand-emerald);
  box-shadow: 0 0 10px var(--brand-emerald);
}

.tv-pill.connected {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.tv-pill.connected .status-dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.tv-pill.disconnected {
  color: var(--text-muted);
}

.client-profile-pill {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
}

.logout-link-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  cursor: pointer;
}

.logout-link-btn:hover {
  background: var(--brand-red);
  color: #ffffff;
}

/* BANNER DE ADMIN MASTER */
.admin-impersonate-banner {
  background: linear-gradient(90deg, #1e1b4b, #31104b);
  border-bottom: 1px solid rgba(168, 85, 247, 0.4);
  padding: 10px 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: #e9d5ff;
}

.btn-return-admin {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.3);
  border: 1px solid rgba(168, 85, 247, 0.6);
  padding: 4px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.78rem;
  transition: var(--transition);
}

.btn-return-admin:hover {
  background: #a855f7;
}

.nav-action-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.nav-action-link:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

/* ==============================================
   CONTAINER PRINCIPAL
   ============================================== */
.dash-container {
  max-width: 1360px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* ==============================================
   CARDS GERAIS
   ============================================== */
.dash-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.dash-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5rem;
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.card-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-tv { background: rgba(239, 68, 68, 0.12); color: var(--brand-red); border: 1px solid rgba(239, 68, 68, 0.2); }
.icon-monitor { background: rgba(6, 182, 212, 0.12); color: var(--brand-cyan); border: 1px solid rgba(6, 182, 212, 0.2); }
.icon-upload { background: rgba(16, 185, 129, 0.12); color: var(--brand-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.icon-playlist { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.icon-settings { background: rgba(168, 85, 247, 0.12); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.2); }

.header-actions {
  margin-left: auto;
}

/* ==============================================
   GRID: PAREAMENTO + MONITOR
   ============================================== */
.grid-pair-monitor {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.8rem;
}

/* CAMPO PARA NOME MANUAL DO DISPOSITIVO NO PAREAMENTO */
.custom-tv-name-group {
  margin: 0.5rem 0 1rem 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.custom-tv-name-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-tv-name-label svg {
  color: #3b82f6;
}

.custom-tv-name-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 14px;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  transition: var(--transition);
}

.custom-tv-name-input:focus {
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.custom-tv-name-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

/* CARD DE PAREAMENTO */
.code-input-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 1.5rem 0;
}

.code-char {
  width: 54px;
  height: 68px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: var(--transition);
}

.code-char:focus {
  border-color: var(--brand-red);
  background: rgba(239, 68, 68, 0.08);
  box-shadow: 0 0 16px var(--brand-red-glow);
  transform: translateY(-2px);
}

.pairing-action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.detected-tvs-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.sub-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.detected-tvs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.no-tvs-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.tv-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.tv-badge-pill:hover {
  background: var(--brand-red);
  color: #ffffff;
  transform: scale(1.04);
}

/* PAINEL DE CONTROLE QUANDO CONECTADO */
.paired-controls-panel {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.3s ease;
}

/* CONTADOR DE LIMITE DE TELAS */
.tv-limit-pill {
  margin-left: auto;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.82rem;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.tv-limit-pill.full {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

.connect-new-tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.slots-available-tag {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* LISTA DE TODAS AS TELAS CONECTADAS */
.connected-tvs-list-wrapper {
  margin-bottom: 1.5rem;
}

.connected-tvs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px 0;
}

.tv-connected-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.tv-connected-card:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
}

.tv-connected-card.offline {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.tv-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.tv-details {
  flex: 1;
  min-width: 0;
}

.tv-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-display-heading {
  font-size: 0.98rem;
  font-weight: 800;
  color: #34d399;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.tv-connected-card.offline .tv-display-heading {
  color: #cbd5e1;
}

.tv-name-label {
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px dashed transparent;
}

.tv-name-label:hover {
  border-bottom-color: currentColor;
}

.btn-edit-tv-name {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.btn-edit-tv-name:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #60a5fa;
  transform: scale(1.08);
}

.tv-badges-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tv-code-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

/* CAIXA DE EDIÇÃO INLINE DO NOME DA TV */
.tv-rename-box {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  width: 100%;
}

.tv-rename-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #3b82f6;
  border-radius: 6px;
  color: #ffffff;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.btn-save-name {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.btn-save-name:hover {
  background: #059669;
}

.btn-cancel-name {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel-name:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
}

.tv-online-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #10b981;
  color: #fff;
}

.tv-offline-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #64748b;
  color: #fff;
}

.tv-sub-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-family: monospace;
}

.tv-connected-card .btn-danger {
  margin-left: auto;
  flex-shrink: 0;
}

/* AVISO DE LIMITE ATINGIDO */
.limit-reached-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 1rem;
}

.limit-icon-box {
  font-size: 2rem;
  line-height: 1;
}

.limit-reached-notice h4 {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}

.limit-reached-notice p {
  font-size: 0.84rem;
  color: #e2e8f0;
  line-height: 1.4;
}

.remote-controls-wrapper {
  margin-top: 14px;
}

.remote-btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.remote-btn-group .btn-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.remote-btn-group .btn-dark:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.tv-connected-card .btn-disconnect-single-tv {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 7px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}

.tv-connected-card .btn-disconnect-single-tv:hover {
  background: var(--brand-red);
  color: #ffffff;
  border-color: var(--brand-red);
}

/* ==============================================
   MONITOR AO VIVO
   ============================================== */
.live-tag {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse 2s infinite;
}

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

.monitor-screen-wrapper {
  background: #000000;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.monitor-screen {
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070c;
  overflow: hidden;
}

.monitor-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.monitor-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.monitor-overlay-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-subtle);
}

.monitor-track-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#monitorMediaTitle {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-type-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.media-type-badge.image { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.media-type-badge.video { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.media-type-badge.youtube { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.media-type-badge.instagram {
  background: linear-gradient(45deg, rgba(240, 148, 51, 0.25), rgba(220, 39, 67, 0.25), rgba(188, 24, 136, 0.25));
  color: #f472b6;
  border: 1px solid rgba(225, 48, 108, 0.45);
}
.media-type-badge.tiktok { background: rgba(6, 182, 212, 0.2); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.4); }
.media-type-badge.vimeo { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }
.media-type-badge.facebook { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.media-type-badge.kwai { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }

.chip-btn.chip-yt { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.chip-btn.chip-yt:hover { background: #ef4444; color: #ffffff; }

.chip-btn.chip-ig {
  background: rgba(225, 48, 108, 0.15);
  color: #fb7185;
  border-color: rgba(225, 48, 108, 0.35);
}
.chip-btn.chip-ig:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #ffffff;
}

.thumb-instagram-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  gap: 2px;
}

.monitor-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==============================================
   GERENCIADOR DE MÍDIA & UPLOAD
   ============================================== */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dropzone-area {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
  position: relative;
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--brand-red);
  background: rgba(239, 68, 68, 0.04);
}

.file-input-hidden {
  display: none;
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.dropzone-content h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.dropzone-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.upload-progress-container {
  margin-top: 1rem;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand-emerald);
  transition: width 0.2s ease;
}

#uploadProgressText {
  font-size: 0.75rem;
  color: var(--brand-emerald);
  font-weight: 600;
}

/* ADICIONAR POR LINK EXTERNO */
.url-add-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.url-add-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.url-input-row {
  display: flex;
  gap: 8px;
}

.input-text, .input-select {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 12px;
  outline: none;
  transition: var(--transition);
}

.input-text:focus, .input-select:focus {
  border-color: var(--brand-red);
}

.sample-library-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ==============================================
   PLAYLIST / GRADE DE PROGRAMAÇÃO
   ============================================== */
.playlist-items-wrapper {
  margin-top: 1rem;
}

.playlist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.playlist-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: var(--transition);
}

.playlist-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.playlist-row.inactive {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 1.1rem;
}

.item-thumb-box {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
  position: relative;
}

.item-thumb-box img, .item-thumb-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-info-col {
  flex: 1;
  min-width: 0;
}

.item-info-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.item-config-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.duration-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.duration-selector select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  outline: none;
}

.item-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-icon-action.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-icon-action.play-now:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

/* ==============================================
   CONFIGURAÇÕES VISUAIS
   ============================================== */
.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-container input {
  display: none;
}

.toggle-slider {
  width: 42px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  position: relative;
  transition: var(--transition);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: var(--transition);
}

.toggle-container input:checked + .toggle-slider {
  background: var(--brand-emerald);
}

.toggle-container input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

/* ==============================================
   BOTÕES E COMPONENTES
   ============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: var(--brand-red);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--brand-red-glow);
}

.btn-primary:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-success, .btn-sync {
  background: var(--brand-emerald);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--brand-red);
  color: #ffffff;
}

.btn-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 0.8rem;
  padding: 8px 12px;
}

.btn-dark:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ==============================================
   TOAST NOTIFICATION
   ============================================== */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-content {
  background: #0f172a;
  border: 1px solid var(--brand-emerald);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.2);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
}

@keyframes slideInRight {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==============================================
   CUSTOMIZAÇÃO DO LOGOTIPO DA EMPRESA
   ============================================== */
.logo-customization-group {
  margin-top: 0.5rem;
}

.logo-uploader-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.logo-preview-wrapper {
  width: 90px;
  height: 60px;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.qr-preview-fallback {
  background: var(--brand-red);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 4px 10px;
  border-radius: 4px;
}

.logo-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-uploader-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo-btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-hint {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* ==============================================
   ESTILOS: ASSINATURA & PAGAMENTO PIX
   ============================================== */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(16, 185, 129, 0.15));
  border: 1.5px solid rgba(6, 182, 212, 0.45);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.15);
}

.trial-banner.hidden {
  display: none !important;
}

.trial-banner .trial-icon-box {
  font-size: 2rem;
  background: rgba(6, 182, 212, 0.15);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.trial-banner .trial-content {
  flex: 1;
}

.trial-banner h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 4px;
}

.trial-banner p {
  font-size: 0.92rem;
  color: #f1f5f9;
  line-height: 1.5;
}

.trial-timer-pill {
  padding: 8px 16px;
  background: rgba(6, 182, 212, 0.25);
  border: 1px solid rgba(6, 182, 212, 0.5);
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.95rem;
  color: #a5f3fc;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.pix-custom-notice-box {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  margin-top: 12px;
}

.pix-custom-notice-box .custom-pix-badge {
  display: inline-block;
  background: #06b6d4;
  color: #042f2e;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.pix-custom-notice-box p {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.4;
}

.subscription-blocked-alert {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.15));
  border: 2px solid rgba(239, 68, 68, 0.6);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.25);
  animation: pulseAlert 2.5s infinite ease-in-out;
}

.subscription-blocked-alert.hidden {
  display: none !important;
}

@keyframes pulseAlert {
  0%, 100% { box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 12px 40px rgba(239, 68, 68, 0.45); }
}

.subscription-blocked-alert .alert-icon-box {
  font-size: 2.2rem;
  background: rgba(239, 68, 68, 0.2);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.subscription-blocked-alert h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fca5a5;
  margin-bottom: 4px;
}

.subscription-blocked-alert p {
  font-size: 0.92rem;
  color: #f1f5f9;
  line-height: 1.5;
}

.pix-subscription-card {
  margin-bottom: 2rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(24, 34, 53, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.icon-pix {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.subscription-status-pill {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.subscription-status-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.subscription-status-pill.expired {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.pix-subscription-body {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  margin-top: 1.2rem;
}

.plan-highlight-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

.plan-price-large {
  font-size: 2.2rem;
  font-weight: 900;
  color: #10b981;
  margin: 6px 0;
}

.plan-price-large .per-month {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.plan-screens-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.plan-breakdown {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.validity-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.validity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.val-label {
  color: var(--text-secondary);
}

.val-status-ok {
  color: #34d399;
}

.val-status-warn {
  color: #ef4444;
}

.pix-pay-action-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.pix-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pix-qr-box {
  width: 140px;
  height: 140px;
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pix-qr-box img, .pix-qr-box canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.pix-qr-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 140px;
}

.pix-details-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pix-field-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 5px;
}

.pix-copy-row {
  display: flex;
  gap: 8px;
}

.pix-key-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.9) !important;
  font-family: monospace;
  font-weight: 700;
  color: #f59e0b !important;
  font-size: 0.95rem;
}

.btn-copy {
  padding: 0 16px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.pix-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 8px;
}

.pix-amount-text {
  font-size: 1.2rem;
  color: #10b981;
}

.btn-pay-confirm {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-pay-confirm:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

.pix-auto-status-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 10px;
}

.pix-auto-status-box.approved {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.pix-status-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pixPulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pixPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pix-status-text strong {
  display: block;
  font-size: 0.95rem;
  color: #10b981;
  margin-bottom: 3px;
}

.pix-status-text p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
}

.pix-manual-notice-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pix-manual-info-row .manual-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pix-manual-info-row p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0;
}

.btn-whatsapp {
  background: #25d366 !important;
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none !important;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-whatsapp:hover {
  background: #1eb857 !important;
  transform: translateY(-1px);
}

/* ==============================================
   RESPONSIVIDADE
   ============================================== */
@media (max-width: 1024px) {
  .grid-pair-monitor { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .settings-form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
  .pix-subscription-body { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dash-navbar { padding: 1rem; flex-direction: column; gap: 12px; align-items: flex-start; }
  .nav-status-group { width: 100%; justify-content: space-between; }
  .code-char { width: 42px; height: 56px; font-size: 1.8rem; }
  .remote-btn-group { grid-template-columns: repeat(2, 1fr); }
  .playlist-row { flex-wrap: wrap; }
  .pix-pay-action-box { flex-direction: column; text-align: center; }
}
