/* ==========================================================================
   FLManager — Tema XUIOne (Fase 1: presentación)
   Se activa cuando xuione-theme.js añade body.flm-xuione.
   Sin esa clase, el panel queda exactamente como estaba (degradación elegante).
   ========================================================================== */

/* ---------- Layout: barra superior (Fase 6, estilo XUI) ---------- */
body.flm-xuione { padding-top: 54px; }
body.flm-xuione .navbar { display: none !important; }

.flm-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 54px; z-index: 5000;
  background: linear-gradient(90deg, #131c2b 0%, #182335 100%);
  display: flex; align-items: center; gap: 16px; padding: 0 18px;
  box-shadow: 0 2px 14px rgba(0,0,0,.30);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.flm-topbar-brand {
  display: flex; align-items: center; gap: 9px; color: #fff;
  text-decoration: none; white-space: nowrap; font-size: 14.5px; font-weight: 750; letter-spacing: .2px;
}
.flm-topbar-brand i { color: #38b6d8; font-size: 18px; }
.flm-topbar-brand small { display: block; font-size: 9px; color: #7f93ab; font-weight: 600; letter-spacing: .18em; }

.flm-topbar-burger { display: none; border: 0; background: rgba(255,255,255,.07); color: #c7d2e0; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 14px; }

.flm-topbar-nav { flex: 1; display: flex; align-items: center; gap: 2px; overflow: visible; }
.flm-nav-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-radius: 8px; color: #c7d2e0; text-decoration: none; font-size: 13px;
  white-space: nowrap; border: 0; background: transparent; cursor: pointer; font-family: inherit;
}
.flm-nav-link i { font-size: 13px; color: #8fa4bd; }
.flm-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.flm-nav-link:hover i { color: #c7d2e0; }
.flm-nav-link.flm-active { background: rgba(42,172,200,.16); color: #fff; box-shadow: inset 0 -2px 0 #38b6d8; }
.flm-nav-link.flm-active i { color: #38b6d8; }

.flm-nav-more { position: relative; }
.flm-more-chev { font-size: 9px !important; margin-left: 2px; transition: transform .15s ease; }
.flm-nav-more.open .flm-more-chev { transform: rotate(180deg); }
.flm-nav-more.flm-has-active > .flm-nav-link { color: #fff; box-shadow: inset 0 -2px 0 rgba(56,182,216,.55); }
.flm-nav-drop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px;
  background: #182335; border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0,0,0,.45); padding: 7px; z-index: 5100;
}
.flm-nav-more.open .flm-nav-drop { display: block; }
.flm-drop-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: #c7d2e0; text-decoration: none; font-size: 12.5px; white-space: nowrap;
}
.flm-drop-link i { width: 16px; text-align: center; font-size: 12px; color: #8fa4bd; }
.flm-drop-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.flm-drop-link.flm-active { background: rgba(42,172,200,.16); color: #fff; }
.flm-drop-link.flm-active i { color: #38b6d8; }

.flm-topbar-right { display: flex; align-items: center; gap: 10px; }
.flm-topbar-user { display: flex; align-items: center; gap: 9px; color: #dbe6f2; font-size: 12.5px; text-decoration: none; padding: 5px 8px; border-radius: 8px; white-space: nowrap; }
.flm-topbar-user:hover { background: rgba(255,255,255,.06); }
.flm-topbar-user .flm-avatar { width: 28px; height: 28px; border-radius: 50%; background: #2aacc8; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.flm-topbar-logout { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; color: #e08a8a; text-decoration: none; font-size: 13px; }
.flm-topbar-logout:hover { background: rgba(224,138,138,.14); }

@media (max-width: 1080px) {
  .flm-nav-link span.flm-side-label { display: none; }
  .flm-nav-link { padding: 9px 11px; }
}
@media (max-width: 860px) {
  body.flm-xuione { padding-top: 54px; }
  .flm-topbar { flex-wrap: nowrap; }
  .flm-topbar-burger { display: inline-flex; align-items: center; justify-content: center; }
  .flm-topbar-nav {
    display: none; position: fixed; top: 54px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #131c2b; padding: 10px 12px 14px; box-shadow: 0 14px 30px rgba(0,0,0,.4);
    max-height: calc(100vh - 54px); overflow-y: auto;
  }
  body.flm-topbar-open .flm-topbar-nav { display: flex; }
  .flm-nav-link span.flm-side-label { display: inline; }
  .flm-nav-more { width: 100%; }
  .flm-nav-drop {
    position: static; display: block; box-shadow: none; border: 0; background: rgba(255,255,255,.03);
    margin: 2px 0 4px 12px; min-width: 0;
  }
  .flm-topbar-user span.flm-side-label { display: none; }
}

/* ---------- Modal de descarga por formato (users.php) ---------- */
.flm-dl-overlay {
  position: fixed; inset: 0; background: rgba(9,15,26,.55); z-index: 9000;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.flm-dl-modal {
  background: #fff; border-radius: 10px; box-shadow: 0 18px 50px rgba(0,0,0,.3);
  width: 100%; max-width: 460px; padding: 20px; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.flm-dl-modal h3 { margin: 0 0 4px; font-size: 16px; color: #17263a; display: flex; align-items: center; gap: 8px; }
.flm-dl-modal .flm-dl-sub { color: #77879b; font-size: 12px; margin: 0 0 14px; }
.flm-dl-modal .flm-dl-close { float: right; border: 0; background: #f0f4f8; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; color: #5b6c81; }
.flm-dl-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  border: 1px solid #dce5ec; background: #f8fafc; color: #17263a; border-radius: 8px;
  padding: 11px 14px; margin: 7px 0; cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.flm-dl-btn:hover { border-color: #2aacc8; background: #eef9fc; }
.flm-dl-btn i { color: #2aacc8; font-size: 15px; }
.flm-dl-btn small { font-weight: 400; color: #77879b; }

/* ---------- Pulido XUIOne de componentes (solo con tema activo) ---------- */
body.flm-xuione .page, body.flm-xuione .container { max-width: 1400px; }
body.flm-xuione table { border-collapse: collapse; }
body.flm-xuione th { background: #f2f6fa !important; color: #51637a !important; font-size: 10.5px !important; text-transform: uppercase; letter-spacing: .06em; }
body.flm-xuione tr:hover td { background: #f6fafd; }
body.flm-xuione .status-badge { border-radius: 999px; padding: 3px 10px; font-size: 10.5px; font-weight: 700; }
body.flm-xuione .status-active { background: #e3f7ec; color: #14804a; }
body.flm-xuione .status-suspended, body.flm-xuione .status-expired, body.flm-xuione .status-disabled, body.flm-xuione .status-error { background: #fdecec; color: #b34141; }
body.flm-xuione .status-waiting, body.flm-xuione .status-missing { background: #fff5e0; color: #a1731c; }

/* ---------- Fase 2: dashboard en vivo ---------- */
body.flm-xuione .xui-topbar { display: none !important; }
.flm-live-bar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #5f7186; margin: -6px 0 16px; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.flm-live-bar .flm-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9c3cf; }
.flm-live-bar.ok .flm-dot { background: #1fa97c; animation: flmpulse 2s infinite; }
@keyframes flmpulse { 0% { box-shadow: 0 0 0 0 rgba(31,169,124,.30); } 70% { box-shadow: 0 0 0 7px rgba(31,169,124,0); } 100% { box-shadow: 0 0 0 0 rgba(31,169,124,0); } }

/* ==========================================================================
   FASE 4 — PIEL TOTAL XUIONE (todas las páginas)
   Rediseño completo de superficie: fondo, tarjetas, botones, formularios,
   tablas, modales, alertas y login. Solo activo con body.flm-xuione.
   ========================================================================== */
body.flm-xuione {
  background: #eef2f7 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  color: #1f2d3d !important;
}

/* ---------- Contenedores de página ---------- */
body.flm-xuione .page,
body.flm-xuione .container,
body.flm-xuione .xui-container { max-width: 1400px !important; margin: 0 auto !important; padding: 24px 28px 64px !important; }
body.flm-xuione .page-header { margin: 2px 0 20px !important; }
body.flm-xuione h1,
body.flm-xuione .page-title,
body.flm-xuione .xui-page-title { font-size: 23px !important; font-weight: 750 !important; color: #16263b !important; letter-spacing: -.015em; margin: 0 0 4px; }
body.flm-xuione .xui-page-subtitle,
body.flm-xuione .page-header small,
body.flm-xuione .muted { color: #77879b !important; font-size: 12.5px !important; }
body.flm-xuione h2 { font-size: 16px !important; font-weight: 700 !important; color: #16263b !important; }
body.flm-xuione h3 { font-size: 14.5px !important; font-weight: 700 !important; color: #22334a !important; }

/* ---------- Tarjetas ---------- */
body.flm-xuione .card,
body.flm-xuione .xui-card {
  background: #fff !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 12px rgba(16,42,67,.08) !important;
  margin-bottom: 18px !important;
  overflow: hidden;
}
body.flm-xuione .card h2,
body.flm-xuione .card-head,
body.flm-xuione .card-head h2 {
  border-bottom: 1px solid #eef2f7 !important;
  background: #fff !important;
  padding: 15px 20px !important;
  font-size: 14.5px !important;
}
body.flm-xuione .card-body,
body.flm-xuione .body { padding: 18px 20px !important; background: #fff !important; }
body.flm-xuione .module {
  background: #fff !important; border: 0 !important; border-radius: 14px !important;
  box-shadow: 0 2px 12px rgba(16,42,67,.08) !important; padding: 18px !important;
}
body.flm-xuione .module b { color: #0ea5c4 !important; font-size: 26px !important; }
body.flm-xuione .kpi {
  background: linear-gradient(135deg, #0ea5c4 0%, #22c1a9 100%) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 22px rgba(14,165,196,.35) !important;
  min-height: 118px !important;
}
body.flm-xuione .kpi-value { font-size: 33px !important; font-weight: 800 !important; }
body.flm-xuione .quick { border-radius: 12px !important; border: 1px solid #e6ecf3 !important; }
body.flm-xuione .quick:hover { border-color: #7fd7e6 !important; background: #f2fbfd !important; box-shadow: 0 4px 14px rgba(42,172,200,.14); }
body.flm-xuione .quick-icon { border-radius: 10px !important; background: #e2f5f9 !important; }

/* ---------- Botones ---------- */
body.flm-xuione .button,
body.flm-xuione .btn,
body.flm-xuione .xbtn,
body.flm-xuione button[type="submit"]:not(.flm-bulk-btn):not(.flm-pg):not(.flm-dl-btn):not(.flm-bulk-close) {
  border: 0 !important;
  border-radius: 9px !important;
  padding: 10px 16px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  background: linear-gradient(180deg, #35c0d8, #22a7c4) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(34,167,196,.32) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
body.flm-xuione .button:hover, body.flm-xuione .btn:hover, body.flm-xuione .xbtn:hover { filter: brightness(1.05); transform: translateY(-1px); }
body.flm-xuione .btn.gray, body.flm-xuione .xbtn.secondary, body.flm-xuione .btn-action.gray {
  background: linear-gradient(180deg, #7a8ba0, #64748b) !important;
  box-shadow: 0 3px 10px rgba(100,116,139,.28) !important;
}
body.flm-xuione .btn.red, body.flm-xuione .btn-action.delete {
  background: linear-gradient(180deg, #ef6b7e, #e1566b) !important;
  box-shadow: 0 3px 10px rgba(225,86,107,.30) !important;
}
body.flm-xuione .btn-action {
  padding: 7px 10px !important; font-size: 12px !important; border-radius: 7px !important;
  box-shadow: none !important; background: #eef4f9 !important; color: #33506b !important;
}
body.flm-xuione .btn-action:hover { background: #dcecf5 !important; }
body.flm-xuione a { color: #1590ad; }

/* ---------- Formularios ---------- */
body.flm-xuione .form-control,
body.flm-xuione input[type="text"], body.flm-xuione input[type="password"],
body.flm-xuione input[type="email"], body.flm-xuione input[type="number"],
body.flm-xuione input[type="date"], body.flm-xuione input[type="search"]:not(.flm-tbl-search),
body.flm-xuione input[type="url"],
body.flm-xuione select, body.flm-xuione textarea {
  border: 1px solid #d7dfea !important;
  border-radius: 9px !important;
  padding: 10px 13px !important;
  font-size: 13px !important;
  background: #fff !important;
  color: #1f2d3d !important;
  box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
  max-width: 100%;
}
body.flm-xuione .form-control:focus,
body.flm-xuione input:focus, body.flm-xuione select:focus, body.flm-xuione textarea:focus {
  outline: none !important;
  border-color: #22a7c4 !important;
  box-shadow: 0 0 0 3px rgba(34,167,196,.16) !important;
}
body.flm-xuione label { font-weight: 640 !important; font-size: 12px !important; color: #51637a !important; margin-bottom: 5px; display: inline-block; }
body.flm-xuione small { color: #8296ad !important; }
body.flm-xuione input[type="checkbox"] { width: auto !important; accent-color: #22a7c4; }

/* ---------- Tablas ---------- */
body.flm-xuione .table-scroll, body.flm-xuione .table { background: #fff !important; }
body.flm-xuione th {
  background: #f4f7fb !important; color: #51637a !important;
  font-size: 10.5px !important; text-transform: uppercase; letter-spacing: .07em;
  padding: 12px 14px !important; border-bottom: 1px solid #e6ecf3 !important;
}
body.flm-xuione td { padding: 12px 14px !important; border-bottom: 1px solid #f0f4f8 !important; font-size: 12.5px !important; color: #2a3b52 !important; }
body.flm-xuione tr:hover td { background: #f7fbfd !important; }

/* ---------- Modales ---------- */
body.flm-xuione .modal { background: rgba(13,24,41,.58) !important; }
body.flm-xuione .modal-content {
  border-radius: 16px !important; border: 0 !important;
  box-shadow: 0 26px 80px rgba(0,0,0,.35) !important;
  background: #fff !important;
}
body.flm-xuione .modal-header, body.flm-xuione .modal-content h2 { border-bottom: 1px solid #eef2f7 !important; }
body.flm-xuione .modal-footer { border-top: 1px solid #eef2f7 !important; background: #fbfdfe !important; border-radius: 0 0 16px 16px !important; }

/* ---------- Alertas y avisos ---------- */
body.flm-xuione .alert { border-radius: 11px !important; border: 0 !important; padding: 12px 16px !important; font-size: 13px !important; font-weight: 600 !important; }
body.flm-xuione .alert-success, body.flm-xuione .success { background: #e6f8ef !important; color: #127a4c !important; }
body.flm-xuione .alert-danger, body.flm-xuione .alert-error, body.flm-xuione .error { background: #fdecee !important; color: #b34141 !important; }
body.flm-xuione .alert-warning, body.flm-xuione .warning { background: #fff6e2 !important; color: #96650f !important; }
body.flm-xuione .note { border-radius: 11px !important; }

/* ---------- Paginación propia del panel (users.php) ---------- */
body.flm-xuione .pagination { gap: 5px; display: flex; list-style: none; padding: 0; }
body.flm-xuione .pagination li a, body.flm-xuione .pagination li span {
  border: 1px solid #d7dfea !important; border-radius: 7px !important; padding: 6px 11px !important;
  font-size: 12px !important; color: #33506b !important; background: #fff !important;
}
body.flm-xuione .pagination li.active span { background: #22a7c4 !important; border-color: #22a7c4 !important; color: #fff !important; }

/* ---------- Badges ---------- */
body.flm-xuione .badge { border-radius: 999px !important; padding: 4px 10px !important; font-size: 10.5px !important; font-weight: 700 !important; }
body.flm-xuione .badge.off { background: #fdecee !important; color: #b34141 !important; }
body.flm-xuione .status-badge { border-radius: 999px !important; }

/* ---------- Login ---------- */
body.flm-xuione.login-skin { background: linear-gradient(160deg, #101b2d 0%, #16263f 55%, #0e2a3a 100%) !important; min-height: 100vh; }
body.flm-xuione.login-skin .card, body.flm-xuione.login-skin form {
  border-radius: 18px !important; box-shadow: 0 30px 90px rgba(0,0,0,.5) !important;
}

/* ==========================================================================
   FASE 5 — Resellers con créditos + historial + monitoreo por usuario
   ========================================================================== */
body.flm-xuione .credits-badge, body.flm-xuione .flm-res-badge { border-radius: 999px !important; }
body.flm-xuione .mu-user .mu-row { transition: background .12s ease; }

/* ==========================================================================
   FASE 6 — Barra superior XUI + Users (admins con grupos y permisos)
   ========================================================================== */
body.flm-xuione .flm-topbar { border-radius: 0; }

/* ==========================================================================
   FASE 7 — Un solo menú: se retiran los menús heredados
   - xcvm shell (sidebar izquierda + topbar del rediseño anterior)
   - headers propios de media_library (.topbar) y flussonic_channels (.nav)
   - columna lateral de profile (pasa a una columna)
   ========================================================================== */
body.flm-xuione.xcvm-shell { padding: 54px 0 0 0 !important; }
body.flm-xuione .xcvm-sidebar,
body.flm-xuione .xcvm-topbar,
body.flm-xuione header.topbar,
body.flm-xuione .topbar,
body.flm-xuione nav.nav { display: none !important; }
body.flm-xuione .profile-grid { grid-template-columns: 1fr !important; }
body.flm-xuione .profile-sidebar { max-width: 460px; }

/* ==========================================================================
   FASE 8 — MODO OSCURO XUI.one (por defecto; body.flm-light = modo claro)
   Paleta: fondo #0f1117 · superficie #1e2230 · bordes #2a2f42 · texto
   #e6e8ef/#8b90a5 · acento cian #00d1ff · secundario morado #7c3aed.
   ========================================================================== */
body.flm-xuione {
  --flm-bg: #0f1117;
  --flm-bg-2: #12141c;
  --flm-surface: #1e2230;
  --flm-surface-2: #161a26;
  --flm-border: #2a2f42;
  --flm-text: #e6e8ef;
  --flm-text-2: #8b90a5;
  --flm-accent: #00d1ff;
  --flm-accent-2: #7c3aed;
  --flm-ok: #22c55e;
  --flm-warn: #f59e0b;
  --flm-bad: #ef4444;
  --flm-chart-grid: rgba(139, 144, 165, .18);
}
body.flm-xuione.flm-light {
  --flm-bg: #eef2f7;
  --flm-bg-2: #f5f8fb;
  --flm-surface: #ffffff;
  --flm-surface-2: #f2f6fa;
  --flm-border: #e3eaf3;
  --flm-text: #1f2d3d;
  --flm-text-2: #77879b;
  --flm-accent: #0ea5c4;
  --flm-accent-2: #7c3aed;
  --flm-chart-grid: rgba(119, 135, 155, .25);
}

/* ---------- Superficies y tipografía ---------- */
body.flm-xuione:not(.flm-light) { background: var(--flm-bg) !important; color: var(--flm-text) !important; }
body.flm-xuione:not(.flm-light) .page,
body.flm-xuione:not(.flm-light) .container,
body.flm-xuione:not(.flm-light) .xui-container { background: transparent !important; }
body.flm-xuione:not(.flm-light) h1,
body.flm-xuione:not(.flm-light) h2,
body.flm-xuione:not(.flm-light) h3,
body.flm-xuione:not(.flm-light) .page-title,
body.flm-xuione:not(.flm-light) .xui-page-title { color: #f2f4f9 !important; }
body.flm-xuione:not(.flm-light) .muted,
body.flm-xuione:not(.flm-light) .xui-page-subtitle,
body.flm-xuione:not(.flm-light) .sub,
body.flm-xuione:not(.flm-light) .empty { color: var(--flm-text-2) !important; }

/* ---------- Tarjetas / paneles ---------- */
body.flm-xuione:not(.flm-light) .card,
body.flm-xuione:not(.flm-light) .xui-card,
body.flm-xuione:not(.flm-light) .module,
body.flm-xuione:not(.flm-light) .panel,
body.flm-xuione:not(.flm-light) .stat,
body.flm-xuione:not(.flm-light) .kpi-card,
body.flm-xuione:not(.flm-light) .mu-table-wrap,
body.flm-xuione:not(.flm-light) .users-list,
body.flm-xuione:not(.flm-light) .modal-box,
body.flm-xuione:not(.flm-light) .modal-content {
  background: var(--flm-surface) !important;
  border: 1px solid var(--flm-border) !important;
  box-shadow: 0 2px 14px rgba(0, 0, 0, .35) !important;
}
body.flm-xuione:not(.flm-light) .card-head,
body.flm-xuione:not(.flm-light) .card h2,
body.flm-xuione:not(.flm-light) .card-head h2 {
  background: var(--flm-surface) !important;
  border-bottom: 1px solid var(--flm-border) !important;
}
body.flm-xuione:not(.flm-light) .card-body,
body.flm-xuione:not(.flm-light) .body { background: var(--flm-surface) !important; }

/* ---------- KPIs: número grande + borde izquierdo de color ---------- */
body.flm-xuione:not(.flm-light) .kpis .kpi,
body.flm-xuione:not(.flm-light) .kpi {
  background: var(--flm-surface) !important;
  border: 1px solid var(--flm-border) !important;
  border-left: 3px solid var(--flm-accent) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  color: var(--flm-text) !important;
}
body.flm-xuione:not(.flm-light) .kpis .kpi:nth-child(2),
body.flm-xuione:not(.flm-light) .kpi.kpi-2 { border-left-color: var(--flm-accent-2) !important; }
body.flm-xuione:not(.flm-light) .kpis .kpi:nth-child(3) { border-left-color: var(--flm-ok) !important; }
body.flm-xuione:not(.flm-light) .kpis .kpi:nth-child(4) { border-left-color: var(--flm-warn) !important; }
body.flm-xuione:not(.flm-light) .kpi-value { color: #ffffff !important; }
body.flm-xuione:not(.flm-light) .kpi-label { color: var(--flm-text-2) !important; opacity: 1 !important; }
body.flm-xuione:not(.flm-light) .kpi-icon { background: rgba(0, 209, 255, .12) !important; }
body.flm-xuione:not(.flm-light) .kpi-card .v { color: #ffffff !important; }
body.flm-xuione:not(.flm-light) .kpi-card.teal .v { color: var(--flm-accent) !important; }
body.flm-xuione:not(.flm-light) .kpi-card.warn .v { color: var(--flm-warn) !important; }
body.flm-xuione:not(.flm-light) .module b { color: var(--flm-accent) !important; }

/* ---------- Tablas: filas alternadas + hover ---------- */
body.flm-xuione:not(.flm-light) table { border-collapse: collapse; }
body.flm-xuione:not(.flm-light) th {
  background: var(--flm-surface-2) !important;
  color: var(--flm-text-2) !important;
  border-bottom: 1px solid var(--flm-border) !important;
  font-size: 10.5px !important;
  text-transform: uppercase !important;
  letter-spacing: .07em !important;
}
body.flm-xuione:not(.flm-light) td { border-bottom: 1px solid var(--flm-border) !important; color: var(--flm-text); }
body.flm-xuione:not(.flm-light) tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .018); }
body.flm-xuione:not(.flm-light) tr:hover td { background: rgba(0, 209, 255, .06) !important; }
body.flm-xuione:not(.flm-light) .table-wrap,
body.flm-xuione:not(.flm-light) .table-scroll { background: transparent !important; }

/* ---------- Badges de estado (verde/rojo/amarillo) ---------- */
body.flm-xuione:not(.flm-light) .status-active { background: rgba(34, 197, 94, .14) !important; color: #4ade80 !important; }
body.flm-xuione:not(.flm-light) .status-suspended,
body.flm-xuione:not(.flm-light) .status-expired,
body.flm-xuione:not(.flm-light) .status-disabled,
body.flm-xuione:not(.flm-light) .status-error { background: rgba(239, 68, 68, .14) !important; color: #f87171 !important; }
body.flm-xuione:not(.flm-light) .status-waiting,
body.flm-xuione:not(.flm-light) .status-missing { background: rgba(245, 158, 11, .14) !important; color: #fbbf24 !important; }
body.flm-xuione:not(.flm-light) .status-run { color: #4ade80 !important; }
body.flm-xuione:not(.flm-light) .status-stop { color: #f87171 !important; }
body.flm-xuione:not(.flm-light) .badge { background: rgba(0, 209, 255, .12) !important; color: #67e8f9 !important; }
body.flm-xuione:not(.flm-light) .badge.off { background: rgba(239, 68, 68, .14) !important; color: #f87171 !important; }
body.flm-xuione:not(.flm-light) .badge.estimated { background: rgba(245, 158, 11, .14) !important; color: #fbbf24 !important; }
body.flm-xuione:not(.flm-light) .badge-full { background: rgba(124, 58, 237, .22) !important; color: #c4b5fd !important; }
body.flm-xuione:not(.flm-light) .mu-chip { background: var(--flm-surface-2) !important; color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .mu-chip.conn { background: rgba(0, 209, 255, .12) !important; color: #67e8f9 !important; }
body.flm-xuione:not(.flm-light) .mu-chip.over { background: rgba(239, 68, 68, .16) !important; color: #f87171 !important; }
body.flm-xuione:not(.flm-light) .mu-badge { background: rgba(0, 209, 255, .12) !important; color: #67e8f9 !important; }
body.flm-xuione:not(.flm-light) .mu-badge.restream { background: rgba(34, 197, 94, .14) !important; color: #4ade80 !important; }
body.flm-xuione:not(.flm-light) .credits-badge { background: rgba(0, 209, 255, .12) !important; color: #67e8f9 !important; }
body.flm-xuione:not(.flm-light) .credits-badge.low { background: rgba(239, 68, 68, .16) !important; color: #f87171 !important; }
body.flm-xuione:not(.flm-light) .flm-res-badge { background: rgba(124, 58, 237, .18) !important; color: #c4b5fd !important; }
body.flm-xuione:not(.flm-light) .chip { background: var(--flm-surface-2) !important; color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .chip.on { background: rgba(0, 209, 255, .12) !important; color: #67e8f9 !important; }
body.flm-xuione:not(.flm-light) .est { background: rgba(245, 158, 11, .14) !important; color: #fbbf24 !important; }
body.flm-xuione:not(.flm-light) .dot { border-color: var(--flm-border); }

/* ---------- Botones: sólidos u outline, 4px ---------- */
body.flm-xuione:not(.flm-light) .button,
body.flm-xuione:not(.flm-light) .btn,
body.flm-xuione:not(.flm-light) .xbtn,
body.flm-xuione:not(.flm-light) button[type="submit"]:not(.flm-bulk-btn):not(.flm-pg):not(.flm-dl-btn):not(.flm-bulk-close):not(.flm-topbar-burger):not(.flm-nav-link) {
  background: var(--flm-accent) !important;
  color: #052030 !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}
body.flm-xuione:not(.flm-light) .btn:hover,
body.flm-xuione:not(.flm-light) .button:hover { filter: brightness(1.1); }
body.flm-xuione:not(.flm-light) .btn.secondary,
body.flm-xuione:not(.flm-light) .btn.gray,
body.flm-xuione:not(.flm-light) .xbtn.secondary,
body.flm-xuione:not(.flm-light) .btn-action.modal-close-btn {
  background: transparent !important;
  color: var(--flm-text) !important;
  border: 1px solid var(--flm-border) !important;
}
body.flm-xuione:not(.flm-light) .btn.secondary:hover,
body.flm-xuione:not(.flm-light) .btn.gray:hover { border-color: var(--flm-accent) !important; color: var(--flm-accent) !important; }
body.flm-xuione:not(.flm-light) .btn.danger,
body.flm-xuione:not(.flm-light) .btn.red,
body.flm-xuione:not(.flm-light) .xbtn.danger { background: var(--flm-bad) !important; color: #fff !important; border-color: transparent !important; }
body.flm-xuione:not(.flm-light) .disconnect-btn,
body.flm-xuione:not(.flm-light) .kick-btn { background: rgba(239, 68, 68, .14) !important; color: #f87171 !important; }
body.flm-xuione:not(.flm-light) .kick-btn:hover { background: rgba(239, 68, 68, .24) !important; }
body.flm-xuione:not(.flm-light) .btn-action {
  background: var(--flm-surface-2) !important;
  border: 1px solid var(--flm-border) !important;
  color: var(--flm-text-2) !important;
}
body.flm-xuione:not(.flm-light) .btn-action:hover { border-color: var(--flm-accent) !important; color: var(--flm-accent) !important; }
body.flm-xuione:not(.flm-light) .flm-dl-btn { background: var(--flm-surface-2) !important; border: 1px solid var(--flm-border) !important; color: var(--flm-text) !important; }
body.flm-xuione:not(.flm-light) .flm-dl-btn:hover { border-color: var(--flm-accent) !important; }
body.flm-xuione:not(.flm-light) .quick { background: var(--flm-surface) !important; border: 1px solid var(--flm-border) !important; color: var(--flm-text) !important; }
body.flm-xuione:not(.flm-light) .quick:hover { border-color: var(--flm-accent) !important; background: rgba(0, 209, 255, .05) !important; }
body.flm-xuione:not(.flm-light) .quick-icon { background: rgba(0, 209, 255, .12) !important; color: var(--flm-accent) !important; }

/* ---------- Formularios ---------- */
body.flm-xuione:not(.flm-light) .form-control,
body.flm-xuione:not(.flm-light) input[type="text"],
body.flm-xuione:not(.flm-light) input[type="password"],
body.flm-xuione:not(.flm-light) input[type="number"],
body.flm-xuione:not(.flm-light) input[type="date"],
body.flm-xuione:not(.flm-light) input[type="email"],
body.flm-xuione:not(.flm-light) input[type="search"],
body.flm-xuione:not(.flm-light) select,
body.flm-xuione:not(.flm-light) textarea {
  background: var(--flm-surface-2) !important;
  border: 1px solid var(--flm-border) !important;
  color: var(--flm-text) !important;
  border-radius: 4px !important;
}
body.flm-xuione:not(.flm-light) .form-control:focus,
body.flm-xuione:not(.flm-light) input:focus,
body.flm-xuione:not(.flm-light) select:focus,
body.flm-xuione:not(.flm-light) textarea:focus {
  border-color: var(--flm-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 209, 255, .14) !important;
  outline: none !important;
}
body.flm-xuione:not(.flm-light) .form-group label,
body.flm-xuione:not(.flm-light) .filters label,
body.flm-xuione:not(.flm-light) label { color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) ::placeholder { color: #5c6478 !important; }
body.flm-xuione:not(.flm-light) .search-input { background: var(--flm-surface-2) !important; border: 1px solid var(--flm-border) !important; color: var(--flm-text) !important; }
body.flm-xuione:not(.flm-light) .search-wrap i { color: #5c6478 !important; }
body.flm-xuione:not(.flm-light) input[type="checkbox"],
body.flm-xuione:not(.flm-light) input[type="radio"] { accent-color: #00bcd4; }

/* ---------- Modales ---------- */
body.flm-xuione:not(.flm-light) .modal { background: rgba(2, 6, 16, .68) !important; }
body.flm-xuione:not(.flm-light) .modal-head { border-bottom: 1px solid var(--flm-border) !important; }
body.flm-xuione:not(.flm-light) .modal-head h3 { color: #f2f4f9 !important; }
body.flm-xuione:not(.flm-light) .modal-close { background: var(--flm-surface-2) !important; color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .flm-dl-modal { background: var(--flm-surface) !important; border: 1px solid var(--flm-border) !important; }
body.flm-xuione:not(.flm-light) .flm-dl-modal h3 { color: #f2f4f9 !important; }

/* ---------- Alertas y mensajes ---------- */
body.flm-xuione:not(.flm-light) .alert-success,
body.flm-xuione:not(.flm-light) .msg { background: rgba(34, 197, 94, .12) !important; color: #4ade80 !important; border: 1px solid rgba(34, 197, 94, .25) !important; }
body.flm-xuione:not(.flm-light) .alert-danger,
body.flm-xuione:not(.flm-light) .msg.error { background: rgba(239, 68, 68, .12) !important; color: #f87171 !important; border: 1px solid rgba(239, 68, 68, .25) !important; }
body.flm-xuione:not(.flm-light) .srv-err { background: rgba(245, 158, 11, .12) !important; color: #fbbf24 !important; }
body.flm-xuione:not(.flm-light) .warning-line { color: #fbbf24 !important; }

/* ---------- Topbar (nueva paleta) ---------- */
body.flm-xuione:not(.flm-light) .flm-topbar {
  background: #1a1d29 !important;
  border-bottom: 1px solid var(--flm-border) !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .5) !important;
}
body.flm-xuione:not(.flm-light) .flm-topbar-brand small { color: #5c6478 !important; }
body.flm-xuione:not(.flm-light) .flm-nav-link { color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .flm-nav-link i { color: #5c6478 !important; }
body.flm-xuione:not(.flm-light) .flm-nav-link:hover { background: rgba(255, 255, 255, .05) !important; color: #fff !important; }
body.flm-xuione:not(.flm-light) .flm-nav-link.flm-active {
  background: rgba(0, 209, 255, .10) !important;
  color: var(--flm-accent) !important;
  box-shadow: inset 0 -2px 0 var(--flm-accent) !important;
}
body.flm-xuione:not(.flm-light) .flm-nav-link.flm-active i { color: var(--flm-accent) !important; }
body.flm-xuione:not(.flm-light) .flm-nav-drop {
  background: var(--flm-surface) !important;
  border: 1px solid var(--flm-border) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .55) !important;
}
body.flm-xuione:not(.flm-light) .flm-drop-link { color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .flm-drop-link:hover { background: rgba(255, 255, 255, .05) !important; color: #fff !important; }
body.flm-xuione:not(.flm-light) .flm-drop-link.flm-active,
body.flm-xuione:not(.flm-light) .flm-drop-link.flm-active i { color: var(--flm-accent) !important; background: rgba(0, 209, 255, .10) !important; }
body.flm-xuione:not(.flm-light) .flm-topbar-user { color: var(--flm-text) !important; }
body.flm-xuione:not(.flm-light) .flm-topbar-theme { color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .flm-topbar-theme:hover { background: rgba(0, 209, 255, .10) !important; color: var(--flm-accent) !important; }

/* ---------- Paginación y varios ---------- */
body.flm-xuione:not(.flm-light) .pagination a,
body.flm-xuione:not(.flm-light) .pagination li a,
body.flm-xuione:not(.flm-light) .pager a,
body.flm-xuione:not(.flm-light) .pager span,
body.flm-xuione:not(.flm-light) .mu-pager button.pg {
  background: var(--flm-surface-2) !important;
  color: var(--flm-text-2) !important;
  border: 1px solid var(--flm-border) !important;
}
body.flm-xuione:not(.flm-light) .pagination .active a,
body.flm-xuione:not(.flm-light) .pager .cur,
body.flm-xuione:not(.flm-light) .mu-pager button.pg.cur {
  background: var(--flm-accent) !important;
  color: #052030 !important;
  border-color: transparent !important;
}
body.flm-xuione:not(.flm-light) .mu-pager button.pg:disabled { opacity: .35 !important; }
body.flm-xuione:not(.flm-light) .avatar { background: var(--flm-accent) !important; color: #052030 !important; }
body.flm-xuione:not(.flm-light) .mu-avatar { background: linear-gradient(135deg, #00bcd4, #7c3aed) !important; }
body.flm-xuione:not(.flm-light) .ip-link { color: var(--flm-accent) !important; border-bottom-color: var(--flm-accent) !important; }
body.flm-xuione:not(.flm-light) a { color: var(--flm-accent); }
body.flm-xuione:not(.flm-light) .flm-live-bar { color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .live-chip { background: var(--flm-surface) !important; color: var(--flm-text-2) !important; }
body.flm-xuione:not(.flm-light) .loading-bar { background: linear-gradient(90deg, #00bcd4, #7c3aed) !important; }
body.flm-xuione:not(.flm-light) ::-webkit-scrollbar { width: 10px; height: 10px; }
body.flm-xuione:not(.flm-light) ::-webkit-scrollbar-track { background: var(--flm-bg); }
body.flm-xuione:not(.flm-light) ::-webkit-scrollbar-thumb { background: #2c3247; border-radius: 5px; border: 2px solid var(--flm-bg); }
body.flm-xuione:not(.flm-light) ::-webkit-scrollbar-thumb:hover { background: #3a4160; }
body.flm-xuione:not(.flm-light) code { background: var(--flm-surface-2) !important; color: #67e8f9 !important; }
body.flm-xuione:not(.flm-light) .details, body.flm-xuione:not(.flm-light) summary { color: var(--flm-text-2); }
body.flm-xuione:not(.flm-light) .user-detail-box,
body.flm-xuione:not(.flm-light) .detail-row { background: transparent !important; color: var(--flm-text-2) !important; }

/* ---------- Login (misma paleta) ---------- */
body.flm-xuione.login-skin:not(.flm-light) { background: linear-gradient(160deg, #0f1117 0%, #12141c 55%, #101722 100%) !important; }

/* ---------- Gráficos Fase 8 (dashboard) ---------- */
.flm-charts { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin: 0 0 18px; }
@media (max-width: 1080px) { .flm-charts { grid-template-columns: 1fr; } }
.flm-chart-card {
  background: var(--flm-surface, #fff); border: 1px solid var(--flm-border, #e3eaf3);
  border-radius: 10px; overflow: hidden;
}
.flm-chart-card .flm-chart-head {
  padding: 13px 16px; border-bottom: 1px solid var(--flm-border, #e3eaf3);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.flm-chart-card .flm-chart-head strong { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--flm-text-2, #77879b); }
.flm-chart-card .flm-chart-head span { font-size: 11px; color: var(--flm-text-2, #8b90a5); }
.flm-chart-card .flm-chart-body { padding: 14px 16px 10px; }
.flm-chart-svg { width: 100%; height: auto; display: block; }
.flm-chart-svg text { font-size: 9px; fill: var(--flm-text-2, #8b90a5); }
.flm-chart-svg .grid line { stroke: var(--flm-chart-grid, rgba(139,144,165,.18)); stroke-width: 1; }
.flm-chart-legend { display: flex; gap: 14px; padding: 0 16px 12px; font-size: 10.5px; color: var(--flm-text-2, #8b90a5); }
.flm-chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
