/**
 * BDTR GridAccess - Next-Gen Broadcast Studio Architecture
 * Diseñado completamente desde cero con la identidad corporativa oficial BDTR
 * Diseño 100% Responsivo y Adaptable a Cualquier Tamaño de Pantalla
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Raleway:wght@600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-core: #041219;
  --bg-surface: #08212d;
  --bg-card: #0d2f3f;
  --bg-card-hover: #133f54;
  --border-subtle: #164052;
  --border-focus: #245b73;
  --border-glow: rgba(0, 185, 158, 0.4);

  --text-primary: #ffffff;
  --text-secondary: #d5e5ec;
  --text-muted: #85a4b1;
  --text-dim: #547481;

  --accent: #00B99E;
  --accent-hover: #00dfbe;
  --accent-active: #008f7b;
  --accent-glow: rgba(0, 185, 158, 0.35);
  --accent-subtle: rgba(0, 185, 158, 0.12);

  --mark-in: #00B99E;
  --mark-out: #f59e0b;
  --danger: #ef4444;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Raleway', var(--font-main);
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-core); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */
#ga_app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-core);
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   TOP BAR (Workflow Status Strip Adaptativo)
   ========================================================================== */
.ga-header {
  min-height: 54px;
  height: auto;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  flex-shrink: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  gap: 10px;
  flex-wrap: wrap; /* Permite adaptación fluida */
}

.ga-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
  flex-shrink: 0;
}
.ga-logo {
  height: 30px;
  width: auto;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s ease;
}
.ga-logo:hover {
  transform: scale(1.04);
}
.ga-brand-meta {
  display: flex;
  flex-direction: column;
}
.ga-brand-name {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #fff;
  line-height: 1.1;
  white-space: nowrap;
}
.ga-brand-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ga-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 2s infinite ease-in-out;
}
@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.5; }
}

/* Workflow Pills Strip - Centrado y Adaptable */
.ga-nav-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  padding: 2px 0;
}
.ga-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ga-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}
.ga-pill-icon {
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
}
.ga-pill-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  white-space: nowrap;
}
.ga-pill-label {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
}
.ga-pill-val {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Primary Play Button */
.ga-btn-load {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #03141b;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.2s ease;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ga-btn-load:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* User Menu Separado */
.ga-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ga-user-menu {
  position: relative;
  flex-shrink: 0;
}
.ga-user-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ga-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-active);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ga-user-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.ga-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
  min-width: 170px;
  display: none;
  overflow: hidden;
  z-index: 300;
}
.ga-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}
.ga-user-dropdown a:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
}
.ga-user-menu:hover .ga-user-dropdown {
  display: block;
}

/* ==========================================================================
   VIEWPORT DEL REPRODUCTOR (Studio Monitor)
   ========================================================================== */
.ga-viewport {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #01080d;
  padding: 8px 14px 4px;
  overflow: hidden;
  min-height: 160px;
}
.ga-screen-frame {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
video.ga-native-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}

/* Overlay HUDs */
.ga-hud-top-left {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.ga-hud-chip {
  background: rgba(4, 18, 25, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.ga-hud-top-right {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 20;
  background: rgba(4, 18, 25, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.8px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
}

/* ==========================================================================
   CONSOLA NLE DE EDICIÓN Y TIEMPO (Master Editing Strip)
   ========================================================================== */
.ga-console {
  min-height: 84px;
  height: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 14px 8px;
  flex-shrink: 0;
  z-index: 200;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
  gap: 6px;
}

/* Timeline Scrubber */
.ga-scrubber-track {
  width: 100%;
  height: 16px;
  background: rgba(1, 8, 13, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  overflow: visible;
  transition: height 0.15s ease;
  flex-shrink: 0;
}
.ga-scrubber-track:hover {
  height: 18px;
  border-color: var(--border-focus);
}
.ga-scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #008773, var(--accent));
  border-radius: 7px;
  transition: width 0.08s linear;
}
.ga-scrubber-range {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(0, 185, 158, 0.35);
  border-left: 3px solid var(--mark-in);
  border-right: 3px solid var(--mark-out);
  box-shadow: 0 0 10px rgba(0, 185, 158, 0.5);
  display: none;
  z-index: 10;
}

/* Tooltip Flotante de Hora de Transmisión */
.ga-scrubber-tooltip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  background: rgba(4, 18, 25, 0.95);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* Controls Cluster Row */
.ga-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.ga-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Botones NLE - Invarianza de Texto */
.ga-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 35px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ga-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: #fff;
  transform: translateY(-1px);
}
.ga-btn:active {
  transform: translateY(0);
}

/* GoTo Amplio y Cómodo */
.ga-goto-cluster {
  display: flex;
  align-items: center;
  background: rgba(1, 8, 13, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 35px;
  padding: 2px 4px 2px 8px;
  gap: 6px;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ga-goto-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.ga-goto-input {
  width: 82px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  text-align: center;
}
.ga-goto-submit {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  height: 27px;
  padding: 0 9px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ga-goto-submit:hover {
  background: var(--accent);
  color: #03141b;
  border-color: var(--accent);
}

/* Markers In / Out */
.ga-btn-in {
  background: rgba(0, 185, 158, 0.12);
  border-color: var(--mark-in);
  color: var(--mark-in);
  font-weight: 700;
}
.ga-btn-in:hover {
  background: var(--mark-in);
  color: #03141b;
  box-shadow: 0 0 10px var(--accent-glow);
}
.ga-btn-out {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--mark-out);
  color: var(--mark-out);
  font-weight: 700;
}
.ga-btn-out:hover {
  background: var(--mark-out);
  color: #03141b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.ga-tc-box {
  display: flex;
  align-items: center;
  background: rgba(1, 8, 13, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 35px;
  padding: 0 8px;
  gap: 5px;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
.ga-tc-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.ga-tc-tag.tag-in { color: var(--mark-in); }
.ga-tc-tag.tag-out { color: var(--mark-out); }
.ga-tc-val {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  width: 66px;
  outline: none;
  text-align: center;
}

.ga-tc-editable {
  cursor: text;
  border-radius: 4px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ga-tc-editable:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ga-tc-editable:focus {
  background: rgba(0, 185, 158, 0.15);
  box-shadow: 0 0 0 1px var(--accent);
}

.ga-clip-quick-dur {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 2px;
  flex-shrink: 0 !important;
}

.ga-btn-tiny {
  background: rgba(14, 47, 63, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
  white-space: nowrap !important;
  transition: all 0.15s ease;
  line-height: 1;
}
.ga-btn-tiny:hover {
  background: rgba(0, 185, 158, 0.2);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.ga-btn-tiny:active {
  transform: translateY(0);
}
.ga-btn-tiny-active {
  border-color: rgba(0, 185, 158, 0.5);
  color: var(--accent);
}

@keyframes gaMarkPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 185, 158, 0.7); }
  50% { transform: scale(1.08); box-shadow: 0 0 12px 4px rgba(0, 185, 158, 0.5); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 185, 158, 0); }
}

.ga-highlight-pulse {
  animation: gaMarkPulse 1.2s infinite ease-in-out !important;
}

.ga-dur-chip {
  background: rgba(4, 18, 25, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 35px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Action Exports */
.ga-btn-preview {
  background: rgba(0, 185, 158, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.ga-btn-preview:hover {
  background: var(--accent);
  color: #03141b;
}

.ga-btn-dl {
  background: var(--accent);
  border-color: var(--accent);
  color: #03141b;
  font-weight: 800;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.ga-btn-dl:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ==========================================================================
   MODALES MODERNOS
   ========================================================================== */
.ga-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 8, 13, 0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ga-modal-backdrop.active {
  display: flex;
}

.ga-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-glow);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}
.ga-modal-lg {
  max-width: 980px;
  height: 680px;
}
@keyframes modalPop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.ga-modal-header {
  height: 52px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
}
.ga-modal-title {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.ga-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.ga-modal-close:hover {
  color: #fff;
}

.ga-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.ga-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-core);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 40px;
  padding: 0 14px;
  margin-bottom: 12px;
  gap: 10px;
}
.ga-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-main);
  outline: none;
}
.ga-search-input::placeholder {
  color: var(--text-dim);
}

.ga-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.ga-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ga-tab-btn:hover, .ga-tab-btn.active {
  background: var(--accent);
  color: #03141b;
  border-color: var(--accent);
}

.ga-cities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.ga-city-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ga-city-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.ga-city-card.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.ga-city-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ga-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 10px;
}
.ga-channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 100px;
}
.ga-channel-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 10px var(--accent-glow);
}
.ga-channel-logo {
  max-width: 70px;
  max-height: 44px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.ga-channel-title {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}
.ga-channel-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3px;
}

.ga-epg-table {
  width: 100%;
  border-collapse: collapse;
}
.ga-epg-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  white-space: nowrap;
}
.ga-epg-row {
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(22, 64, 82, 0.4);
}
.ga-epg-row:hover {
  background: var(--bg-card-hover);
}
.ga-epg-cell {
  padding: 12px 14px;
  font-size: 12px;
}
.ga-epg-time {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.ga-epg-title {
  font-weight: 600;
  color: #fff;
}
.ga-epg-dur {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.ga-epg-btn {
  background: var(--accent);
  color: #03141b;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.ga-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.ga-preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ga-preset-btn:hover {
  background: var(--accent);
  color: #03141b;
  border-color: var(--accent);
}

/* Selector Libre de Hora de Inicio */
.ga-custom-time-card {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.ga-custom-time-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 12px;
  text-align: center;
}
.ga-time-picker-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ga-time-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ga-time-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.ga-time-select {
  background: var(--bg-core);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  height: 38px;
  width: 64px;
  text-align: center;
  padding: 0 4px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ga-time-select:focus {
  border-color: var(--accent);
}
.ga-time-select option {
  background: var(--bg-surface);
  color: #fff;
}
.ga-time-sep {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 14px;
}
.ga-btn-apply-time {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #03141b;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  height: 38px;
  padding: 0 14px;
  cursor: pointer;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.ga-btn-apply-time:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.ga-time-direct-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.ga-time-direct-input {
  width: 105px !important;
  height: 34px !important;
  text-align: center;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #fff;
}

/* Barra de Herramientas de la EPG */
.ga-epg-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(4, 18, 25, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}
.ga-epg-info-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.ga-epg-badge-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: rgba(0, 185, 158, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

#ga_toast {
  position: fixed;
  bottom: 110px;
  right: 24px;
  background: rgba(4, 18, 25, 0.95);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 14px var(--accent-glow);
  z-index: 9999;
  backdrop-filter: blur(12px);
  animation: toastIn 0.25s ease-out;
  white-space: nowrap;
}
@keyframes toastIn {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Portal Login */
#ga_login_overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, #0b3749 0%, #062330 50%, #03121a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
}
#ga_login_overlay.hidden {
  display: none !important;
}

.ga-login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(8, 33, 45, 0.92);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 38px 34px 32px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--border-glow);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}
.ga-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.ga-login-logo {
  max-height: 50px;
  width: auto;
  margin-bottom: 20px;
}
.ga-login-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 4px;
}
.ga-login-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.ga-form-group {
  margin-bottom: 16px;
  text-align: left;
}
.ga-form-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.ga-form-input {
  width: 100%;
  height: 44px;
  background: var(--bg-core);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  color: #fff;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.2s;
}
.ga-form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.ga-btn-submit {
  width: 100%;
  height: 46px;
  background: var(--accent);
  color: #03141b;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.8px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: all 0.2s;
}
.ga-btn-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.ga-login-error {
  margin-top: 14px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  display: none;
}

/* ==========================================================================
   REGLAS RESPONSIVAS INTELIGENTES (Breakpoints Fluidos)
   ========================================================================== */

/* Laptops y Pantallas Medianas (<= 1360px) */
@media (max-width: 1360px) {
  .ga-header {
    padding: 6px 10px;
  }
  .ga-pill {
    padding: 0 7px;
  }
  .ga-pill-val {
    max-width: 100px;
  }
  .ga-controls-row {
    justify-content: center;
  }
}

/* Tablets y Ventanas de Tamaño Reducido (<= 1100px) */
@media (max-width: 1100px) {
  .ga-header {
    justify-content: center;
    gap: 8px;
    padding: 6px 8px;
  }
  .ga-brand {
    margin-right: auto;
  }
  .ga-header-right {
    margin-left: auto;
  }
  .ga-nav-strip {
    width: 100%;
    order: 3;
    justify-content: center;
    gap: 5px;
    margin-top: 2px;
  }
  .ga-brand-badge {
    display: none;
  }
  .ga-pill-val {
    max-width: 90px;
  }
  .ga-controls-row {
    gap: 6px;
  }
}

/* Dispositivos Compactos y Móviles (<= 768px) */
@media (max-width: 768px) {
  .ga-header {
    padding: 6px;
  }
  .ga-pill {
    padding: 0 6px;
    gap: 4px;
  }
  .ga-pill-label {
    display: none; /* Muestra icono y valor para máxima compacidad */
  }
  .ga-pill-val {
    font-size: 10.5px;
    max-width: 80px;
  }
  .ga-btn-load {
    padding: 0 10px;
    font-size: 10px;
  }
  .ga-controls-row {
    justify-content: center;
  }
  .ga-group {
    flex-wrap: wrap;
    justify-content: center;
  }
  .ga-presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
