:root {
  --bg-main: #0a0e17;
  --bg-card: #141a29;
  --bg-card-elevated: #1c2438;
  --bg-input: #101624;
  --border-subtle: #25314c;
  --border-focus: #00d2ff;
  --cyan-primary: #00d2ff;
  --cyan-glow: rgba(0, 210, 255, 0.25);
  --violet-accent: #7b61ff;
  --violet-glow: rgba(123, 97, 255, 0.25);
  --green-success: #10b981;
  --green-glow: rgba(16, 185, 129, 0.25);
  --red-danger: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.25);
  --amber-warning: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* LAYOUT GERAL COM MENU LATERAL ESQUERDO */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-main);
}

/* MENU LATERAL ESQUERDO (SIDEBAR) */
.app-sidebar {
  width: 290px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 22px;
}

.brand-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-logout-mobile {
  display: none;
}

.sidebar-brand .brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cyan-primary), var(--violet-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-main);
  box-shadow: 0 4px 16px var(--cyan-glow);
  flex-shrink: 0;
}

.sidebar-brand h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand .brand-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--cyan-primary);
  display: block;
  margin-top: 2px;
}

/* NAVEGAÇÃO DA SIDEBAR */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 10px;
}

.app-sidebar .nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.app-sidebar .nav-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.app-sidebar .nav-tab.active {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.16), rgba(123, 97, 255, 0.08));
  border-color: rgba(0, 210, 255, 0.35);
  color: var(--cyan-primary);
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.12);
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(123, 97, 255, 0.08);
  border: 1px solid rgba(123, 97, 255, 0.22);
  color: var(--violet-accent);
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.sidebar-action-btn:hover {
  background: rgba(123, 97, 255, 0.18);
  color: #fff;
  border-color: var(--violet-accent);
  transform: translateY(-1px);
}

/* RODAPÉ DA SIDEBAR */
.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-footer .status-indicator {
  width: 100%;
  justify-content: center;
}

.auth-wrapper {
  width: 100%;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* CONTEÚDO PRINCIPAL (ÁREA À DIREITA) */
.app-main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px;
  overflow-y: auto;
  height: 100vh;
}

.main-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}

.page-title-group h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-datetime-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(18, 25, 41, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}

.header-datetime-badge:hover {
  border-color: rgba(0, 210, 255, 0.4);
}

.header-datetime-badge svg {
  color: var(--cyan-primary);
  flex-shrink: 0;
}

.header-datetime-badge #liveHeaderDateTime {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.2px;
}

.header-datetime-badge .timezone-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-primary);
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.28);
  padding: 3px 7px;
  border-radius: 10px;
  letter-spacing: 0.4px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-success);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--green-success);
  box-shadow: 0 0 10px var(--green-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan-primary);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  outline: none;
}

.btn-primary {
  background: var(--cyan-primary);
  color: var(--bg-main);
  box-shadow: 0 4px 14px var(--cyan-glow);
}

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

.btn-secondary {
  background: var(--bg-card-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: #25334f;
  border-color: var(--cyan-primary);
}

/* VISÕES / ABAS */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* METRICS GRID - 4 MÉTRICAS */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

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

/* 1. Clientes Ativos */
.metric-active .metric-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
}

/* 2. Clientes Vencendo */
.metric-expiring .metric-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-warning);
}

/* 3. Dispositivos Conectados */
.metric-connected .metric-icon {
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan-primary);
}

/* 4. Versões do Aplicativo */
.metric-versions .metric-icon {
  background: rgba(123, 97, 255, 0.15);
  color: var(--violet-accent);
}

.metric-info {
  overflow: hidden;
}

.metric-info h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
}

.metric-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.metric-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.versions-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.version-badge {
  background: rgba(123, 97, 255, 0.18);
  border: 1px solid rgba(123, 97, 255, 0.4);
  color: #c4b5fd;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

/* CONTROLS BAR */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.search-box svg {
  color: var(--text-muted);
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

.filter-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-card-elevated);
  color: var(--cyan-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table thead tr {
  background: var(--bg-card-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(37, 49, 76, 0.5);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(30, 39, 61, 0.5);
}

.mono-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan-primary);
  background: rgba(0, 210, 255, 0.08);
  padding: 3px 6px;
  border-radius: 6px;
  display: inline-block;
}

.date-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.dns-cell {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  display: block;
}

.online-tag {
  color: var(--cyan-primary);
  font-size: 11px;
  font-weight: 700;
  display: block;
}

.offline-tag {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-blocked {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-expired {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.text-right {
  text-align: right;
}

.actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

/* BOTÕES DE AÇÃO ESPECÍFICOS SOLICITADOS */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-act-lock {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-act-lock:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-act-unlock {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-act-unlock:hover {
  background: rgba(16, 185, 129, 0.3);
}

.btn-act-edit {
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan-primary);
  border-color: rgba(0, 210, 255, 0.4);
}

.btn-act-edit:hover {
  background: var(--cyan-primary);
  color: var(--bg-main);
  box-shadow: 0 0 14px var(--cyan-glow);
  transform: translateY(-1px);
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--cyan-primary);
  color: var(--text-primary);
}

.btn-icon.btn-danger:hover {
  border-color: var(--red-danger);
  background: rgba(239, 68, 68, 0.15);
}

/* ========================================================================= */
/* VISÃO 2: CONTROLE REMOTO & HOME */
/* ========================================================================= */
.remote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 20px;
}

.remote-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.card-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-top: 6px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-item input {
  accent-color: var(--cyan-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.banner-preview {
  margin-top: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: #0d131f;
  background-size: cover;
  background-position: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.preview-label {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--cyan-primary);
}

.preview-content h4 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.preview-content p {
  font-size: 12px;
  color: #cbd5e1;
}

/* ========================================================================= */
/* VISÃO 3: ESPORTES (/sports/today) */
/* ========================================================================= */
.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.sports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.sport-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.sport-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 85% 50%, transparent 40%, rgba(255, 255, 255, 0.035) 41%, rgba(255, 255, 255, 0.035) 43%, transparent 44%),
    linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.03) 100%),
    radial-gradient(circle at 85% 50%, rgba(255, 255, 255, 0.04) 2.5px, transparent 3px),
    radial-gradient(circle at 10% 50%, transparent 58%, rgba(255, 255, 255, 0.035) 59%, rgba(255, 255, 255, 0.035) 61%, transparent 62%);
  background-size: 100% 100%, 1.5px 100%, 100% 100%, 100% 100%;
  background-position: center, 85% center, center, center;
  background-repeat: no-repeat;
  z-index: 0;
}

.sport-card > * {
  position: relative;
  z-index: 1;
}

.sport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.champ-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan-primary);
  letter-spacing: 0.5px;
}

.sport-status {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.status-live {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red-danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-scheduled {
  background: rgba(123, 97, 255, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(123, 97, 255, 0.4);
}

.status-finished {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.4);
}

.match-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
}

.team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90px;
  text-align: center;
  gap: 6px;
}

.team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.team-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-display {
  font-size: 24px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  gap: 8px;
  color: var(--text-primary);
}

.match-time {
  font-size: 11px;
  color: var(--text-muted);
}

.match-channel {
  background: var(--bg-card-elevated);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.match-channel strong {
  color: var(--cyan-primary);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalSlide 0.2s ease-out;
  overflow: hidden;
}

.modal-sm {
  max-width: 420px;
}

.modal-tester {
  max-width: 720px;
}

@keyframes modalSlide {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.close-modal {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
}

.close-modal:hover {
  color: var(--text-primary);
}

/* FORMS */
form {
  padding: 22px;
}

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

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15);
}

.mono-input {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 600;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* TESTER */
.tester-body {
  padding: 20px;
}

.tester-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tester-tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tester-tab-btn.active {
  background: var(--bg-card-elevated);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
}

.quick-devices {
  margin: 12px 0 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.quick-buttons-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.quick-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--cyan-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.api-response-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 14px;
}

.response-header {
  background: var(--bg-card-elevated);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

pre#jsonOutput {
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #a5f3fc;
  overflow-x: auto;
  max-height: 240px;
}

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

.toast {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
}

.toast.toast-success {
  border-color: var(--green-success);
}

.toast.toast-error {
  border-color: var(--red-danger);
}

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

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
    min-height: 100vh;
  }
  
  .app-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 15, 29, 0.97);
    backdrop-filter: blur(16px);
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 10px 14px 6px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
  
  .sidebar-brand {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .sidebar-brand .brand-logo {
    width: 34px;
    height: 34px;
  }
  
  .sidebar-brand h1 {
    font-size: 15px;
  }
  
  .sidebar-brand .brand-tag {
    font-size: 8px;
    letter-spacing: 1px;
  }
  
  .btn-logout-mobile {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .btn-logout-mobile:hover, .btn-logout-mobile:active {
    background: var(--red-danger);
    color: #ffffff;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
    padding-top: 2px;
  }
  
  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }
  
  .sidebar-nav-title {
    display: none;
  }
  
  .app-sidebar .nav-tab,
  .sidebar-action-btn {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 7px 13px;
    font-size: 12.5px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .app-sidebar .nav-tab.active {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--cyan-primary);
    color: var(--cyan-primary);
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .app-main {
    padding: 16px 14px;
    height: auto;
    overflow-y: visible;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .full-width {
    grid-column: span 1;
  }
}

/* RESPONSIVIDADE PARA CELULARES (< 640px) */
@media (max-width: 640px) {
  .app-sidebar {
    padding: 8px 10px 6px 10px;
  }
  
  .app-main {
    padding: 12px 10px;
  }

  .main-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }
  
  .page-title-group h2 {
    font-size: 18px;
  }
  
  .page-subtitle {
    font-size: 11.5px;
  }
  
  .topbar-actions {
    width: 100%;
  }
  
  .header-datetime-badge {
    width: 100%;
    justify-content: space-between;
    font-size: 11px;
    padding: 6px 10px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metric-card {
    padding: 12px 14px;
    gap: 12px;
  }
  
  .metric-icon {
    width: 42px;
    height: 42px;
  }
  
  .metric-info h2 {
    font-size: 20px;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .search-box {
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }
  
  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 11.5px;
  }
  
  .controls-bar .btn,
  .controls-bar .btn-primary,
  .controls-bar .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 13px;
  }

  .table-container {
    border-radius: 10px;
    margin-left: -2px;
    margin-right: -2px;
  }

  .data-table th, 
  .data-table td {
    padding: 10px 10px;
    font-size: 12px;
  }
  
  .actions-cell {
    flex-direction: column;
    gap: 4px;
  }

  .actions-cell .btn-action {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  
  .section-title-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .section-title-bar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================================================= */
/* ESTILOS ADICIONAIS — MODAL TABS, BLOCOS DA HOME E BADGES */
/* ========================================================================= */
.modal-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.modal-tab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.modal-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-tab-btn.active {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

/* Ordem dos blocos */
.blocks-order-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-md);
}

.block-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.block-order-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-order-actions {
  display: flex;
  gap: 6px;
}

.btn-move {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

.btn-move:hover {
  background: var(--cyan-primary);
  color: #000;
}

/* Badges e tags */
.badge-ts {
  background: rgba(123, 97, 255, 0.2);
  color: var(--violet-accent);
  border: 1px solid rgba(123, 97, 255, 0.4);
}

.badge-m3u {
  background: rgba(0, 210, 255, 0.2);
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 210, 255, 0.4);
}

.perm-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 170px;
}

.perm-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.perm-badge.perm-on {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.perm-badge.perm-off {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.5;
}

.contact-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================================================= */
/* MÓDULO: JOGOS DO DIA — GERADOR INTELIGENTE DE BANNERS (9:16 / WHATSAPP)   */
/* ========================================================================= */

.nav-subtab {
  transition: all 0.2s ease;
}
.nav-subtab:hover, .nav-subtab.active {
  background: rgba(0, 210, 255, 0.12) !important;
  color: #fff !important;
}

.banner-subnav-bar {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.banner-nav-btn {
  flex: 1;
  min-width: 140px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.banner-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.banner-nav-btn.active {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(123, 97, 255, 0.2));
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.15);
}

.banner-workspace-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 24px;
  align-items: flex-start;
}

@media (max-width: 1200px) {
  .banner-workspace-layout {
    grid-template-columns: 1fr;
  }
}

.banner-subview {
  display: none;
}

.banner-subview.active {
  display: block;
}

.banner-config-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

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

.badge-tag-cyan {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(0, 210, 255, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 210, 255, 0.3);
}

/* Chips de Quantidade de Jogos */
.chips-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chip-btn {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.chip-btn:hover {
  border-color: rgba(0, 210, 255, 0.4);
  color: #fff;
}

.chip-btn.active {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

/* Seletor de Templates */
.template-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.template-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: rgba(0, 210, 255, 0.5);
  transform: translateY(-2px);
}

.template-card.active {
  border-color: var(--cyan-primary);
  background: rgba(0, 210, 255, 0.1);
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
}

.tpl-swatch {
  width: 32px;
  height: 48px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tpl-premium {
  background: linear-gradient(180deg, #0a1128 0%, #001f54 50%, #d4af37 100%);
}

.tpl-modern {
  background: linear-gradient(180deg, #04151f 0%, #183a37 60%, #00ff88 100%);
}

.tpl-neon {
  background: linear-gradient(180deg, #0d0221 0%, #0f084b 50%, #00f0ff 100%);
}

.tpl-tv {
  background: linear-gradient(180deg, #111 0%, #1e293b 60%, #e11d48 100%);
}

.tpl-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.tpl-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Lista de Partidas Selecionáveis */
.match-selection-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.match-select-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.match-select-item.selected {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.3);
}

.match-select-item input[type="checkbox"] {
  transform: scale(1.15);
  cursor: pointer;
}

.match-select-teams {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #fff;
}

.match-select-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--cyan-primary);
}

/* Pacote Diário: Grid de Ligas */
.package-leagues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.pkg-league-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.pkg-league-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pkg-league-card.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--green-success);
}

.package-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.package-thumb-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s;
}

.package-thumb-card:hover {
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
}

.package-thumb-img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Critérios e Ranking IA */
.criteria-list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .criteria-list-grid {
    grid-template-columns: 1fr;
  }
}

.ai-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.ai-match-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.ai-match-card.super-highlight {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.2);
}

.ai-score-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--cyan-primary), var(--violet-accent));
  color: #0b0f19;
}

.ai-match-card.super-highlight .ai-score-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
}

/* Painel de Preview 9:16 */
.sticky-preview {
  position: sticky;
  top: 24px;
}

.preview-card-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.preview-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--cyan-primary);
  background: rgba(0, 210, 255, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.preview-headline {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.banner-canvas-container {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.canvas-9-16 {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.canvas-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
}

.preview-actions-bar {
  width: 100%;
  margin-top: 16px;
}

/* Histórico de Banners */
.history-banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.history-banner-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.history-banner-item:hover {
  border-color: var(--cyan-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.history-banner-img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  cursor: pointer;
}

.history-banner-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.btn-xs-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-xs-tag:hover {
  background: rgba(0, 210, 255, 0.1);
  color: var(--cyan-primary);
  border-color: var(--cyan-primary);
}

/* ========================================================================= */
/* TELA DE LOGIN ADMINISTRATIVO FULLSCREEN                                   */
/* ========================================================================= */

.admin-login-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background-color: #060911;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 20px;
  animation: loginFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-login-screen.hidden-auth {
  display: none !important;
}

/* Efeitos Luminosos de Fundo */
.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.28;
  animation: loginFloat 14s ease-in-out infinite alternate;
}

.login-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #00d2ff 0%, rgba(0, 119, 255, 0.5) 70%, transparent 100%);
  top: -120px;
  right: -80px;
}

.login-orb-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #7b61ff 0%, rgba(59, 130, 246, 0.4) 70%, transparent 100%);
  bottom: -100px;
  left: -80px;
  animation-delay: -7s;
}

.login-grid-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 85%);
}

/* Card Central de Login */
.login-card-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
}

.login-card {
  background: rgba(16, 23, 39, 0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  padding: 38px 34px 30px;
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 210, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

.login-card.shake {
  animation: loginShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Cabeçalho do Card */
.login-card-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.18), rgba(123, 97, 255, 0.22));
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: var(--cyan-primary);
  margin-bottom: 14px;
  box-shadow: 0 0 25px rgba(0, 210, 255, 0.3);
}

.logo-glow-ring {
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  border: 1px solid rgba(0, 210, 255, 0.25);
  animation: loginPulse 3s infinite ease-in-out;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #ffffff 40%, var(--cyan-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.login-security-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: rgba(0, 210, 255, 0.08);
  border: 1px solid rgba(0, 210, 255, 0.22);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan-primary);
  letter-spacing: 0.3px;
}

.security-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
  animation: loginPulse 2s infinite ease-in-out;
}

/* Alerta de Erro */
.login-alert-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  color: #fca5a5;
  font-size: 13px;
  animation: loginFadeIn 0.3s ease;
}

.login-alert-box svg {
  flex-shrink: 0;
  color: var(--red-danger);
}

/* Campos do Formulário */
.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.2px;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #0d1320;
  border: 1.5px solid #233149;
  border-radius: 12px;
  transition: all 0.25s ease;
}

.login-input-wrapper:focus-within {
  border-color: var(--cyan-primary);
  background: #101828;
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2), 0 0 16px rgba(0, 210, 255, 0.15);
}

.login-input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.login-input-wrapper:focus-within .login-input-icon {
  color: var(--cyan-primary);
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 44px;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.login-input::placeholder {
  color: #475569;
  font-size: 13.5px;
}

.login-toggle-pw {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.login-toggle-pw:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Opções (Lembrar + SHA-256) */
.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
}

.login-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.login-checkbox-label input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 17px;
  height: 17px;
  border: 1.5px solid #334155;
  border-radius: 5px;
  background: #0d1320;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.login-checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background: var(--cyan-primary);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

.login-checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '✓';
  font-size: 11px;
  font-weight: 800;
  color: #060911;
}

.checkbox-text {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.login-badge-secure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

/* Botão de Submit */
.btn-login-submit {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 6px;
  background: linear-gradient(135deg, #00d2ff 0%, #0072ff 100%);
  border: none;
  border-radius: 12px;
  color: #060911;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.35);
}

.btn-login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 210, 255, 0.55);
  filter: brightness(1.08);
}

.btn-login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-submit-arrow {
  transition: transform 0.2s;
}

.btn-login-submit:hover .btn-submit-arrow {
  transform: translateX(4px);
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(6, 9, 17, 0.25);
  border-top-color: #060911;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

/* Rodapé do Card */
.login-card-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
}

.footer-security-note {
  display: flex;
  align-items: center;
  gap: 5px;
}

.version-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #475569;
}

/* Sidebar User Session & Botão Sair */
.user-session-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.user-session-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-primary);
  box-shadow: 0 0 8px var(--cyan-primary);
}

.user-session-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-logout-sidebar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout-sidebar:hover {
  background: var(--red-danger);
  border-color: var(--red-danger);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Keyframe Animations */
@keyframes loginFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes loginFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.1); }
}

@keyframes loginPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

@keyframes loginShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsividade Mobile */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px 22px;
  }
  .login-title {
    font-size: 21px;
  }
}

/* ========================================================================== */
/* MÓDULO TMDB & HOME CONFIG                                                  */
/* ========================================================================== */

.tmdb-workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .tmdb-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Chips de busca rápida */
.btn-xs-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-xs-tag:hover {
  background: rgba(0, 210, 255, 0.15);
  color: var(--cyan-primary);
  border-color: var(--cyan-primary);
  transform: translateY(-1px);
}

/* Grid de Resultados do TMDB */
.tmdb-results-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 650px;
  overflow-y: auto;
  padding-right: 4px;
}

.tmdb-card {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tmdb-card:hover {
  background: rgba(0, 210, 255, 0.04);
  border-color: rgba(0, 210, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.tmdb-poster-box {
  width: 78px;
  height: 116px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: #0d1322;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.tmdb-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tmdb-card:hover .tmdb-poster-img {
  transform: scale(1.05);
}

.tmdb-info-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tmdb-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.tmdb-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.tmdb-badge-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.tmdb-meta-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tmdb-type-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(123, 97, 255, 0.18);
  color: #a78bfa;
  border: 1px solid rgba(123, 97, 255, 0.3);
}

.tmdb-year-text {
  font-size: 11px;
  color: var(--text-muted);
}

.tmdb-overview-text {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.tmdb-card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-apply-hero {
  background: linear-gradient(135deg, #00d2ff, #0077ff);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-apply-hero:hover {
  filter: brightness(1.15);
  box-shadow: 0 2px 10px rgba(0, 210, 255, 0.4);
  transform: translateY(-1px);
}

/* SIMULADOR DE TV (HERO BANNER 16:9) */
.home-tv-preview-card {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 210, 255, 0.2);
}

.home-tv-backdrop-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background: #090d16 url('https://image.tmdb.org/t/p/original/xOMo8BRK7PfcJv9JCnx7s520DRq.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  box-sizing: border-box;
  transition: background-image 0.4s ease-in-out;
}

.home-tv-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(10, 14, 23, 0.95) 0%,
    rgba(10, 14, 23, 0.65) 45%,
    rgba(10, 14, 23, 0.15) 100%
  ),
  linear-gradient(
    90deg,
    rgba(10, 14, 23, 0.85) 0%,
    rgba(10, 14, 23, 0.4) 50%,
    transparent 100%
  );
  pointer-events: none;
}

.home-tv-content {
  position: relative;
  z-index: 2;
  max-width: 85%;
}

.home-tv-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.home-tv-logo {
  max-height: 36px;
  max-width: 120px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}

.home-tv-rating {
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.home-tv-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.85);
  margin-bottom: 6px;
  line-height: 1.2;
}

.home-tv-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.home-tv-buttons-row {
  display: flex;
  gap: 8px;
}

.tv-btn-mock {
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  user-select: none;
}

.tv-btn-primary {
  background: #ffffff;
  color: #0a0e17;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.5);
}

.tv-btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.home-tv-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 16px;
  font-size: 10px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  animation: loginPulse 2s infinite ease-in-out;
}

/* ========================================================================= */
/* NOVO LAYOUT UNIFICADO: CADASTRO / EDIÇÃO DE CLIENTES (SAAS PREMIUM)      */
/* ========================================================================= */

.client-modal-unified {
  background: linear-gradient(145deg, #0b111e 0%, #080d16 100%);
  border: 1px solid rgba(14, 165, 233, 0.25);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(14, 165, 233, 0.15);
  border-radius: 18px;
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.client-modal-unified .modal-header {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-badge-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--cyan-primary, #00d2ff);
  text-transform: uppercase;
}

.client-modal-unified .modal-header h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.client-unified-form {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

/* Layout em 2 Colunas no Desktop / 1 Coluna no Mobile */
.client-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 768px) {
  .client-form-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Cards de Conteúdo Modular */
.form-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-card.card-highlight {
  border-left: 3px solid var(--cyan-primary, #00d2ff);
}

.form-card.card-glow {
  border-left: 3px solid #eab308;
}

.card-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.card-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-primary, #00d2ff), #0284c7);
  color: #040914;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.35);
  flex-shrink: 0;
}

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
}

.card-subtitle {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

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

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

/* Grupo de Input com Botão de Copiar */
.device-input-action-group {
  display: flex;
  position: relative;
  align-items: center;
}

.device-input-action-group input {
  padding-right: 92px !important;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan-primary, #00d2ff);
  background: rgba(4, 9, 20, 0.8) !important;
  border: 1px solid rgba(0, 210, 255, 0.3) !important;
}

.device-input-action-group input:focus {
  border-color: var(--cyan-primary, #00d2ff) !important;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.25) !important;
}

.btn-copy-device {
  position: absolute;
  right: 6px;
  height: 32px;
  padding: 0 12px;
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.15), rgba(14, 165, 233, 0.25));
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: var(--cyan-primary, #00d2ff);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-copy-device:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.3), rgba(14, 165, 233, 0.45));
  border-color: var(--cyan-primary, #00d2ff);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
  transform: translateY(-1px);
}

.btn-copy-device:active {
  transform: translateY(0);
}

/* Seletor Visual de Modo IPTV (Cards Grandes) */
.iptv-mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.iptv-mode-card {
  background: rgba(10, 16, 28, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  user-select: none;
}

.iptv-mode-card:hover {
  border-color: rgba(0, 210, 255, 0.4);
  background: rgba(14, 165, 233, 0.08);
}

.iptv-mode-card.active {
  border-color: var(--cyan-primary, #00d2ff);
  background: linear-gradient(145deg, rgba(0, 210, 255, 0.12), rgba(14, 165, 233, 0.05));
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
}

.iptv-mode-card .mode-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  flex-shrink: 0;
}

.iptv-mode-card.active .mode-icon {
  background: rgba(0, 210, 255, 0.2);
}

.iptv-mode-card .mode-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.iptv-mode-card .mode-info strong {
  font-size: 13px;
  color: #ffffff;
  font-weight: 700;
}

.iptv-mode-card.active .mode-info strong {
  color: var(--cyan-primary, #00d2ff);
}

.iptv-mode-card .mode-info span {
  font-size: 10.5px;
  color: var(--text-muted, #94a3b8);
}

.iptv-mode-card .mode-check {
  display: none;
  font-size: 12px;
  font-weight: 900;
  color: var(--cyan-primary, #00d2ff);
}

.iptv-mode-card.active .mode-check {
  display: block;
}

/* Password Toggle */
.password-toggle-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-group input {
  padding-right: 42px !important;
}

.btn-toggle-pw {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.btn-toggle-pw:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Acordeom de Configurações Avançadas */
.advanced-accordion {
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 14px;
  transition: all 0.25s ease;
}

.advanced-accordion[open] {
  background: rgba(15, 23, 42, 0.7);
  border-style: solid;
  border-color: rgba(14, 165, 233, 0.3);
  padding-bottom: 16px;
}

.advanced-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 8px 0;
  user-select: none;
}

.advanced-summary::-webkit-details-marker {
  display: none;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
}

.summary-sub {
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.summary-arrow {
  font-size: 14px;
  color: var(--cyan-primary, #00d2ff);
  transition: transform 0.2s ease;
}

.advanced-accordion[open] .summary-arrow {
  transform: rotate(180deg);
}

.advanced-content {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeIn 0.2s ease;
}

/* Rodapé do Modal */
.client-modal-footer {
  padding: 14px 24px;
  background: rgba(10, 16, 28, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.btn-save-client-lg {
  padding: 11px 24px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #0284c7 0%, var(--cyan-primary, #00d2ff) 100%) !important;
  color: #040914 !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.35) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease !important;
  cursor: pointer;
}

.btn-save-client-lg:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5) !important;
}

.btn-save-client-lg:active {
  transform: translateY(0);
}

/* Responsividade Mobile Estrita */
@media (max-width: 600px) {
  .client-modal-unified {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
    width: 100vw;
  }

  .client-unified-form {
    padding: 14px 16px;
    gap: 14px;
  }

  .iptv-mode-selector {
    grid-template-columns: 1fr;
  }

  .client-modal-footer {
    padding: 12px 16px;
  }

  .btn-save-client-lg {
    flex: 1;
    justify-content: center;
  }
}
