/* ============================================================
   LMS STREAMING PANEL — IDENTIDAD VISUAL LMS CORPORATION
   Paleta principal inspirada en LMS Tag (Plomo Grafito + #FF1755)
   ============================================================ */
:root,
[data-theme="dark"],
[data-theme="graphite"] {
  color-scheme: dark;
  --bg: #222730;             /* Plomo Grafito Base (LMS Tag) */
  --sidebar: #1c2128;        /* Plomo Profundo Sidebar */
  --card: #2a303a;           /* Plomo Paneles / Tarjetas */
  --card-alt: #323946;       /* Plomo Elevado */
  --surface: #1c2128;        /* Plomo Inset para Listas e Inputs */
  --btn-secondary: #373e4a;
  --btn-secondary-hover: #444d5c;
  --subtab-bg: #323946;
  --upload-bg: rgba(28, 33, 40, 0.72);
  --toast-bg: #2a303a;
  --modal-backdrop: rgba(15, 18, 24, 0.78);
  --border: #3b4351;
  --text: #f5f7fa;           /* Blanco Suave Alto Contraste */
  --muted: #afb9c6;          /* Plomo Claro Muted */
  --accent: #ff1755;         /* Rosa Carmesí Oficial LMS */
  --accent-hover: #e1124a;
  --accent-soft: rgba(255, 23, 85, 0.14);
  --accent-border: rgba(255, 23, 85, 0.45);
  --accent-fg: #ffffff;
  --info: #38bdf8;
  --brand-pink: #ff1755;
  --green: #22c55e;
  --red: #ef4444;
  --danger-text: #fca5a5;
  --urgent-text: #fecaca;
  --amber: #f59e0b;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.22);
}

[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0b1120;
  --sidebar: #0f172a;
  --card: #151f33;
  --card-alt: #1a263d;
  --surface: #0b1222;
  --btn-secondary: #273549;
  --btn-secondary-hover: #334155;
  --subtab-bg: #1e293b;
  --upload-bg: rgba(15, 23, 42, 0.65);
  --toast-bg: #1e293b;
  --modal-backdrop: rgba(2, 6, 23, 0.78);
  --border: #26344d;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --accent-border: rgba(56, 189, 248, 0.45);
  --accent-fg: #082f49;
  --info: #38bdf8;
  --brand-pink: #ff1755;
  --green: #22c55e;
  --red: #ef4444;
  --danger-text: #fca5a5;
  --urgent-text: #fecaca;
  --amber: #f59e0b;
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f6;
  --sidebar: #ffffff;
  --card: #ffffff;
  --card-alt: #f6f8fb;
  --surface: #f4f6f9;
  --btn-secondary: #e2e8f0;
  --btn-secondary-hover: #cbd5e1;
  --subtab-bg: #e2e8f0;
  --upload-bg: rgba(244, 246, 249, 0.92);
  --toast-bg: #ffffff;
  --modal-backdrop: rgba(15, 23, 42, 0.45);
  --border: #d5dce6;
  --text: #141937;           /* Azul Marino Corporativo LMS */
  --muted: #526075;
  --accent: #e11d48;         /* Rosa Carmesí Corporativo LMS */
  --accent-hover: #be123c;
  --accent-soft: rgba(225, 29, 72, 0.1);
  --accent-border: rgba(225, 29, 72, 0.4);
  --accent-fg: #ffffff;
  --info: #0284c7;
  --brand-pink: #e11d48;
  --green: #16a34a;
  --red: #dc2626;
  --danger-text: #b91c1c;
  --urgent-text: #991b1b;
  --amber: #d97706;
  --shadow-card: 0 2px 8px rgba(20, 25, 55, 0.06);
}

* { box-sizing: border-box; }

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

.layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  border-top: 3px solid var(--brand-pink);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border);
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.theme-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-select {
  width: auto !important;
  padding: 5px 8px !important;
  font-size: 0.74rem !important;
  font-weight: 600;
  border-radius: 7px !important;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
}

.theme-toggle-btn {
  background: var(--btn-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.theme-toggle-btn:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--accent);
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.sidebar-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 0 8px;
}

.station-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.station-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}

.station-item:hover {
  background: var(--accent-soft);
}

.station-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.station-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--red);
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.station-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-item-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.listener-pill {
  font-size: 0.74rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  flex-shrink: 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* MAIN CONTENT */
.main {
  padding: 24px 28px;
  overflow-y: auto;
  max-width: 1280px;
  width: 100%;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.topbar-title h2 {
  margin: 0;
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.badge.online { background: rgba(34, 197, 94, 0.16); color: var(--green); }
.badge.offline { background: rgba(239, 68, 68, 0.16); color: var(--red); }

/* KPI ROW */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

/* PLAYER BAR */
.player-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.monitor-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  max-width: 340px;
}

.monitor-cover {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.monitor-text {
  min-width: 0;
  line-height: 1.2;
}

.monitor-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}

.monitor-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.monitor-artist {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.player-bar audio {
  flex: 1;
  min-width: 240px;
  height: 38px;
}

/* TABS */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 0;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* CARDS & GRID */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow-card);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 1.02rem;
}

/* BUTTONS */
button {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

button:hover { opacity: 0.92; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  background: var(--btn-secondary);
  color: var(--text);
}

button.danger {
  background: rgba(239, 68, 68, 0.16);
  color: var(--danger-text);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

button.small {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* TRIGGER ROWS */
.trigger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

select, input[type="text"], input[type="number"], input[type="password"], input[type="date"], input[type="time"], textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.88rem;
  width: 100%;
}

/* CONNECTION TABLE */
.conn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.conn-row code {
  color: var(--accent);
  word-break: break-all;
}

/* LIBRARY & UPLOAD */
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.subtab-btn {
  background: var(--subtab-bg);
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.subtab-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: var(--upload-bg);
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.86rem;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* FORM */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.88rem;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.modal h3 { margin: 0 0 14px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--toast-bg);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 200;
  display: none;
}

.toast.show { display: block; }
.toast.error { border-color: var(--red); color: var(--danger-text); }

.hidden { display: none !important; }

/* SCHEDULER */
.day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-pill {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.day-pill.selected {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.event-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.event-row.disabled { opacity: 0.55; }

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.tag.warn {
  background: rgba(245, 158, 11, 0.16);
  color: var(--amber);
}

/* VISOR RADIOBOSS (QUE SONO / SONANDO AHORA / QUE VA A VENIR) */
.rb-viewer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.rb-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rb-box.now-playing {
  border-color: rgba(34, 197, 94, 0.55);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.1) 0%, var(--card) 100%);
}

.rb-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-weight: 700;
}

.rb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.rb-item-eta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.rb-item-eta.warn {
  color: var(--amber);
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
}

.rb-item-eta.urgent {
  color: var(--urgent-text);
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.65);
  animation: rbPulse 1s infinite;
}

.rb-cover-lg {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.rb-cover-sm {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.rb-now-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rb-track.event-up {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.09);
}

.rb-track.trigger-up {
  border-color: rgba(168, 85, 247, 0.65);
  background: rgba(168, 85, 247, 0.14);
}

.rb-mini-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
}

.rb-mini-clock.warn { color: var(--amber); background: rgba(245, 158, 11, 0.16); }
.rb-mini-clock.urgent { color: var(--urgent-text); background: rgba(239, 68, 68, 0.25); animation: rbPulse 1s infinite; }

.rb-track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.rb-track.next-up {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.08);
}

.rb-track-info {
  min-width: 0;
  flex: 1;
}

.rb-track-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-track-meta {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* RELOJ EN RETROCESO Y ALERTA DE PRÓXIMA CANCIÓN */
.rb-countdown-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.rb-countdown {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--green);
  line-height: 1;
}

.rb-countdown.warn {
  color: var(--amber);
}

.rb-countdown.urgent {
  color: var(--red);
  animation: rbPulse 1s infinite;
}

.rb-progress-bg {
  position: relative;
  width: 100%;
  height: 14px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.rb-progress-bg:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.rb-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.35s linear;
  pointer-events: none;
}

.rb-seek-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-top: 4px;
}

.rb-progress-fill.warn { background: var(--amber); }
.rb-progress-fill.urgent { background: var(--red); }

.rb-next-alert {
  margin-bottom: 14px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.rb-next-alert.urgent {
  border-color: rgba(239, 68, 68, 0.85);
  background: rgba(239, 68, 68, 0.18);
  color: var(--urgent-text);
  animation: rbPulse 1s infinite;
}

@keyframes rbPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.58; }
}

/* TELEGRAM GENRE FOLDERS */
.tg-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tg-folder-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.tg-folder-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tg-folder-card.active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.13);
}

.tg-folder-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 1.25rem;
}

.tg-folder-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.tg-folder-card-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.tg-folder-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-alt);
  margin-bottom: 12px;
  overflow: hidden;
}

.tg-folder-group-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
}

.tg-folder-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
}

/* EXPLORADOR DE CARPETAS ESTILO WINDOWS / RADIOBOSS */
.rb-explorer {
  display: grid;
  grid-template-columns: 240px 1fr 1fr;
  gap: 12px;
  min-height: 410px;
}

.rb-explorer-pane {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 0;
}

.rb-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--card-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
}

.rb-pane-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.rb-pane-toolbar input {
  padding: 6px 9px;
  font-size: 0.82rem;
}

.rb-tree-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  max-height: 390px;
}

.rb-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  user-select: none;
  border: 1px solid transparent;
}

.rb-tree-row:hover {
  background: rgba(56, 189, 248, 0.09);
}

.rb-tree-row.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  font-weight: 700;
}

.rb-tree-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rb-tree-toggle {
  width: 16px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
}

.rb-explorer-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 345px;
}

.rb-exp-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.12s;
}

.rb-exp-file:hover {
  border-color: var(--accent);
}

.rb-exp-file-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.rb-exp-file-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-exp-file-sub {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1080px) {
  .rb-explorer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}
