/* ============================================================================
   WHMCraft — Tema "Jupiter" (réplica del WHM real, cPanel 110.0.150)
   Reemplaza al <style> inline de public/panel.html.
   Cubre: shell nuevo (topbar/stats, sidebar+tools, actionbar, pagehead/crumbs)
   + TODAS las clases heredadas de las secciones y del JS de panel.html.
   Fuente de tokens: docs/real-reference/jupiter-main.css (Bootstrap 5 compilado).
   ========================================================================== */

:root {
  /* ---- Tokens Jupiter (extraídos del CSS real del servidor) ---- */
  --jup-navy: #08193e;            /* topbar / sidebar */
  --jup-navy-2: #132c5c;          /* hover / activo dentro del navy */
  --jup-navy-3: #061229;          /* navy más profundo (sombras) */
  --jup-primary: #0d6efd;         /* azul primario (botones/links) */
  --jup-primary-hover: #0b5ed7;
  --jup-danger: #dc3545;          /* peligro / rojo */
  --jup-danger-soft: #f8d7da;
  --jup-success: #198754;         /* éxito / verde */
  --jup-success-soft: #d1e7dd;
  --jup-secondary: #6c757d;       /* gris secundario */
  --jup-warning: #ffc107;
  --jup-warning-soft: #fff3cd;

  --jup-bg: #f7f8fa;              /* fondo contenido / thead / panel header */
  --jup-surface: #ffffff;         /* tarjetas / panel body */
  --jup-border: #dee2e6;          /* bordes */
  --jup-border-strong: #ced4da;   /* bordes de inputs */

  --jup-text: #08193e;            /* texto principal (body-color real) */
  --jup-text-muted: #6c757d;      /* texto secundario */

  --jup-font: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue",
              Arial, "Noto Sans", sans-serif;
  --jup-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --jup-radius: 4px;              /* .25rem */
  --jup-radius-sm: 3px;
  --jup-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --jup-shadow-lg: 0 6px 20px -6px rgba(0, 0, 0, .22);
  --jup-ring: 0 0 0 3px rgba(13, 110, 253, .25);

  --jup-topbar-h: 60px;                          /* header height real */
  --jup-sidebar-w: clamp(240px, 14.8vw, 320px);  /* sidebar real */

  /* ---- Alias de compatibilidad (los inline styles de panel.html los usan) ---- */
  --whm-dark: #08193e;
  --whm-dark-2: #132c5c;
  --whm-dark-3: #061229;
  --whm-bg: #f7f8fa;
  --whm-card: #ffffff;
  --whm-border: #dee2e6;
  --whm-text: #08193e;
  --whm-muted: #6c757d;
  --whm-accent: #0d6efd;
  --whm-accent-2: #0b5ed7;
  --whm-warn-bg: #fff3cd;
  --whm-warn-border: #ffe69c;
  --whm-warn-text: #664d03;
  --whm-success: #198754;
  --whm-success-soft: #d1e7dd;
  --whm-danger: #dc3545;
  --whm-danger-soft: #f8d7da;

  --bg: #f7f8fa; --card: #ffffff; --text: #08193e;
  --text-soft: #33475b; --muted: #6c757d; --border: #dee2e6;
  --accent: #0d6efd; --accent-strong: #0b5ed7;
  --success: #198754; --success-soft: #d1e7dd;
  --danger: #dc3545; --danger-soft: #f8d7da;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--jup-font);
  font-size: 13px;
  line-height: 1.5;
  background: var(--jup-bg);
  color: var(--jup-text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--jup-primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* ============================================================================
   SHELL
   ========================================================================== */
.whm-shell { min-height: 100vh; }

/* ---- Topbar navy (60px) ---- */
.whm-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--jup-topbar-h);
  background: var(--jup-navy);
  color: #cdd6e0;
  display: flex; align-items: stretch; gap: 24px;
  padding: 0 16px;
  z-index: 1000;
  font-size: 12px;
}
.whm-topbar-logo,
.whm-topbar .whm-logo {
  display: flex; align-items: center;
  font-size: 18px; font-weight: 700; color: #fff; letter-spacing: .3px;
  white-space: nowrap;
}
.whm-topbar-logo em,
.whm-topbar .whm-logo em { color: #4f9bff; font-style: normal; font-weight: 700; }

.whm-topbar-stats,
.whm-topbar .whm-chips {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap; min-width: 0;
  color: #9fb0c4;
}
.whm-stat { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.whm-stat .k,
.whm-topbar-load .k {
  font-size: 10px; color: #8fa3c0; text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
}
.whm-stat .v,
.whm-topbar-load .v { font-size: 13px; color: #fff; font-weight: 500; }
.whm-topbar-stats b,
.whm-topbar .whm-chips b { color: #e6edf5; font-weight: 600; }

.whm-topbar-load {
  display: flex; flex-direction: column; gap: 1px; line-height: 1.25;
  margin-left: auto; text-align: right;
}
.whm-topbar .whm-right {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  color: #9fb0c4; white-space: nowrap;
}
.whm-topbar .whm-right a { color: #cdd6e0; cursor: pointer; }
.whm-topbar .whm-load { display: flex; align-items: center; gap: 7px; }
.whm-topbar .whm-load .dot { width: 8px; height: 8px; border-radius: 50%; background: #4f9bff; }

/* ---- Sidebar navy ---- */
.whm-sidebar {
  position: fixed; top: var(--jup-topbar-h); bottom: 0; left: 0;
  width: var(--jup-sidebar-w);
  background: var(--jup-navy);
  overflow-y: auto;
  z-index: 900;
  display: flex; flex-direction: column;
}

/* Expand/Collapse + buscador del sidebar (dentro del navy) */
.whm-sidebar-tools {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.whm-expand {
  background: transparent; color: #9fb0c4;
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 4px 8px; font-size: 11px; border-radius: 3px; cursor: pointer;
}
.whm-expand:hover { background: var(--jup-navy-2); color: #fff; border-color: rgba(255,255,255,.25); }
.whm-sidebar-search {
  flex: 1; min-width: 90px;
  padding: 6px 9px; border: 1px solid #24344d; background: #16233a; color: #cdd6e0;
  border-radius: 3px; font-size: 12px; font-family: inherit;
}
.whm-sidebar-search::placeholder { color: #6b7c93; }
.whm-sidebar-search:focus { outline: none; border-color: #4f9bff; }

/* Buscador antiguo (wrapper) — compat */
.whm-search { padding: 0; }
.whm-search input {
  width: 100%; padding: 6px 9px; border: 1px solid #24344d; background: #16233a;
  color: #cdd6e0; border-radius: 3px; font-size: 12px; font-family: inherit;
}
.whm-search input::placeholder { color: #6b7c93; }

/* Navegación del sidebar */
.whm-nav, #whm-nav { padding: 4px 0 24px; }
.whm-nav > a, #whm-nav > a {
  display: block; padding: 7px 14px; color: #9fb0c4; font-size: 12.5px; cursor: pointer;
  border-left: 3px solid transparent;
}
.whm-nav > a:hover, #whm-nav > a:hover { background: var(--jup-navy-2); color: #fff; }
.whm-nav > a.active, #whm-nav > a.active {
  background: var(--jup-navy-2); color: #fff; border-left-color: #4f9bff; font-weight: 600;
}

.whm-cat { border-bottom: 1px solid rgba(255, 255, 255, .04); }
.whm-cat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; color: #cbd5e0; font-size: 12.5px; cursor: pointer; font-weight: 500;
}
.whm-cat-head:hover { background: var(--jup-navy-2); color: #fff; }
.whm-cat-ico {
  font-size: 10px; color: #7b8ba3; width: 10px; flex: none;
  display: inline-block; transition: transform .15s;
}
/* El chevron vive a la IZQUIERDA del nombre (como el WHM real) y rota al plegar. */
.whm-cat:not(.open) .whm-cat-ico { transform: rotate(-90deg); }
.whm-cat-head .chev, .whm-chev {
  margin-left: auto; display: inline-block; font-size: 11px; color: #7b8ba3;
  transition: transform .15s; width: 9px; flex: none;
}
.whm-cat:not(.open) .whm-cat-head .chev,
.whm-cat:not(.open) .whm-chev { transform: rotate(-90deg); }
.whm-cat.open .whm-cat-head { color: #fff; background: rgba(255, 255, 255, .06); }
.whm-cat-body { display: none; padding: 2px 0 6px; }
.whm-cat.open .whm-cat-body { display: block; }
.whm-cat-body a {
  display: block; padding: 5px 14px 5px 32px; color: #8fa0b8; font-size: 12px;
  border-left: 3px solid transparent; cursor: pointer;
}
.whm-cat-body a:hover { background: var(--jup-navy-2); color: #fff; }
.whm-cat-body a.active {
  color: #fff; background: var(--jup-navy-2); border-left-color: #4f9bff; font-weight: 600;
}
.whm-cat-body .empty { padding: 3px 14px 3px 32px; color: #64748b; font-size: 11.5px; font-style: italic; }
.whm-cat-body a.disabled { color: #5c6d85; cursor: default; font-style: italic; }
.whm-cat-body a.disabled:hover { background: transparent; color: #5c6d85; }

/* ---- Área principal ---- */
.whm-main {
  margin-left: var(--jup-sidebar-w);
  padding-top: var(--jup-topbar-h);
  min-height: 100vh;
}

/* Barra de acciones (BLANCA): buscador global + campana + avatar */
.whm-actionbar {
  position: sticky; top: var(--jup-topbar-h); z-index: 800;
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 16px;
  background: #fff; border-bottom: 1px solid var(--jup-border);
}
.whm-actionbar .whm-search {
  flex: 1; max-width: 480px; padding: 7px 12px;
  border: 1px solid var(--jup-border-strong); border-radius: var(--jup-radius);
  font-size: 13px; background: var(--jup-bg); color: var(--jup-text); font-family: inherit;
}
.whm-actionbar .whm-search:focus { border-color: #86b7fe; box-shadow: var(--jup-ring); outline: none; }
.whm-bell, .whm-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--jup-bg); border: 1px solid var(--jup-border);
  color: var(--jup-text-muted); cursor: pointer; font-size: 13px;
}
.whm-bell:hover, .whm-avatar:hover { border-color: var(--jup-border-strong); }

.whm-content { padding: 16px 20px 40px; max-width: 1440px; }

/* Header de página: icono gris + título + breadcrumb */
.whm-pagehead {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 4px;
}
.whm-pagehead-icon {
  width: 38px; height: 38px; border-radius: 8px; flex: none;
  background: #e9ecef; border: 1px solid #dee2e6;
  display: grid; place-items: center; font-size: 20px; color: var(--jup-navy);
}
.whm-pagehead h1 {
  font-size: 22px; font-weight: 400; color: var(--jup-text); margin: 0; line-height: 1.2;
}
.whm-crumbs { font-size: 12px; color: var(--jup-text-muted); margin: 0 0 16px; }
.whm-crumbs a { color: var(--jup-primary); }

.page-h { font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--jup-text); }

.section:not(.active) { display: none !important; }
.section.active { display: block; }

/* ---- Footer ---- */
.whm-footer {
  margin-top: 30px; padding: 16px 0; border-top: 1px solid var(--jup-border);
  color: var(--jup-text-muted); font-size: 11.5px; text-align: center;
}
.whm-footer a { color: var(--jup-primary); cursor: pointer; }

/* ============================================================================
   COMPONENTES
   ========================================================================== */

/* Banner (aviso warning) */
.whm-banner {
  background: var(--jup-warning-soft); border: 1px solid #ffe69c; color: #664d03;
  padding: 10px 14px; border-radius: var(--jup-radius); font-size: 12.5px; margin-bottom: 16px;
  display: flex; gap: 12px; align-items: flex-start;
}
.whm-banner button {
  background: var(--jup-primary); color: #fff; border: none; padding: 5px 12px;
  border-radius: 3px; font-size: 12px; white-space: nowrap;
}
.whm-banner button:hover { background: var(--jup-primary-hover); }

/* Panel / tarjeta */
.panel {
  background: var(--jup-surface); border: 1px solid var(--jup-border);
  border-radius: var(--jup-radius); overflow: hidden; box-shadow: var(--jup-shadow);
}
.panel-header {
  padding: 10px 16px; border-bottom: 1px solid var(--jup-border);
  background: var(--jup-bg); font-weight: 600; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  color: var(--jup-text);
}
.panel-body { padding: 16px; }

/* Tablas (thead gris, uppercase 11px) */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: var(--jup-text); }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--jup-border); vertical-align: middle; }
th {
  background: var(--jup-bg); color: var(--jup-text-muted);
  font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
tbody tr:hover { background: #f2f5f9; }
tr:last-child td { border-bottom: none; }

/* Pills de estado */
.pill { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.pill.ok { background: var(--jup-success-soft); color: #0f5132; }
.pill.susp { background: var(--jup-danger-soft); color: #842029; }

/* Botones */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--jup-primary); color: #fff;
  border: 1px solid var(--jup-primary);
  border-radius: var(--jup-radius);
  padding: 6px 14px; font-size: 13px; cursor: pointer; font-weight: 500; line-height: 1.5;
  font-family: inherit;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover, .btn:hover { background: var(--jup-primary-hover); border-color: var(--jup-primary-hover); }
button.ghost, .btn.ghost {
  background: #fff; color: var(--jup-text); border-color: var(--jup-border-strong);
}
button.ghost:hover, .btn.ghost:hover { background: var(--jup-bg); color: var(--jup-text); border-color: var(--jup-border-strong); }
button.danger, .btn.danger {
  background: #fff; color: var(--jup-danger); border-color: #f1aeb5;
}
button.danger:hover, .btn.danger:hover { background: var(--jup-danger-soft); color: #842029; border-color: #f1aeb5; }
button.sm, .btn.sm { padding: 3px 10px; font-size: 12px; border-radius: 3px; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: var(--jup-ring);
}

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--jup-text-muted); font-weight: 600; }
.field input, .field select, .field textarea, .inline-input {
  padding: 7px 10px; border: 1px solid var(--jup-border-strong); border-radius: var(--jup-radius);
  font-size: 13px; background: #fff; color: var(--jup-text); font-family: inherit; line-height: 1.5;
}
.field textarea { min-height: 90px; resize: vertical; font-family: var(--jup-mono); font-size: 12px; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus {
  border-color: #86b7fe; box-shadow: var(--jup-ring); outline: none;
}
.field small { color: var(--jup-text-muted); font-size: 11.5px; }
.inline-input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
input[type=radio], input[type=checkbox] { accent-color: var(--jup-primary); }

/* Notices / toasts */
.notice {
  padding: 10px 14px; border-radius: var(--jup-radius); margin-bottom: 14px;
  font-size: 12.5px; display: none; font-weight: 500;
}
.notice.error { background: var(--jup-danger-soft); color: #842029; border: 1px solid #f1aeb5; display: block; }
.notice.success { background: var(--jup-success-soft); color: #0f5132; border: 1px solid #a3cfbb; display: block; }

/* Utilidades */
.muted { color: var(--jup-text-muted); }
.mono { font-family: var(--jup-mono); font-size: 11.5px; }
.out-box {
  background: var(--jup-bg); border: 1px solid var(--jup-border); border-radius: var(--jup-radius);
  padding: 10px; max-height: 320px; overflow: auto; white-space: pre-wrap; margin: 0;
}
details > summary { cursor: pointer; }

/* Tiles (favoritos / tools) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 10px; }
.tile {
  display: flex; gap: 11px; align-items: flex-start; background: var(--jup-surface);
  border: 1px solid var(--jup-border); border-radius: var(--jup-radius); padding: 12px 14px;
  cursor: pointer; transition: box-shadow .12s, border-color .12s;
}
.tile:hover { border-color: #b6c1cc; box-shadow: var(--jup-shadow-lg); }
.tile .ico { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 15px; color: #fff; }
.tile .t { font-size: 13px; font-weight: 600; color: var(--jup-text); }
.tile .d { font-size: 11.5px; color: var(--jup-text-muted); margin-top: 2px; }
.tile.disabled { opacity: .5; cursor: default; }
.tile.disabled:hover { border-color: var(--jup-border); box-shadow: none; }
.tile .pend { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .4px; }

/* Acordeón de categorías (Home > Tools) */
.whm-section-title {
  background: var(--jup-bg); border: 1px solid var(--jup-border); border-radius: var(--jup-radius);
  padding: 9px 14px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 9px;
  cursor: pointer; margin: 8px 0 0; color: var(--jup-text);
}
.whm-section-title .chev { margin-left: auto; color: var(--jup-text-muted); transition: transform .15s; font-size: 11px; }
.whm-section-title.open .chev { transform: rotate(180deg); }
.whm-section-body { display: none; padding: 10px 0 6px; }
.whm-section-body.open { display: block; }

/* Panel de estadísticas */
.stats-card { background: var(--jup-surface); border: 1px solid var(--jup-border); border-radius: var(--jup-radius); padding: 14px; }
.stats-card .st { display: flex; gap: 10px; padding: 5px 0; font-size: 12.5px; border-bottom: 1px solid #f2f5f8; }
.stats-card .st:last-child { border-bottom: none; }
.stats-card .st .k { color: var(--jup-text-muted); min-width: 118px; }
.stats-card .st .v { color: var(--jup-text); font-weight: 500; }

/* Home grid / cards */
.home-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.block-title { font-size: 15px; font-weight: 700; margin: 16px 0 10px; display: flex; align-items: center; gap: 10px; color: var(--jup-text); }
.block-title a { font-size: 12px; color: var(--jup-primary); cursor: pointer; font-weight: 500; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--jup-surface); border: 1px solid var(--jup-border); border-radius: var(--jup-radius); padding: 14px; }
.card .label { color: var(--jup-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.card .value { font-size: 24px; font-weight: 700; margin-top: 4px; }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .home-grid, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .whm-sidebar { width: 56px; }
  .whm-main { margin-left: 56px; }
  .whm-nav > a span, #whm-nav > a span,
  .whm-cat-head span, .whm-cat-body, .whm-sidebar-tools .whm-expand { display: none; }
  .whm-sidebar-search { display: none; }
  .whm-topbar-stats, .whm-chips { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}


/* =========================================================================
   Diseño fino (patrones del WHM real: Mail Queue Manager, Zone Editor, etc.)
   ========================================================================= */

/* ---- panel de filtros colapsable ---- */
.whm-filter { border: 1px solid var(--jup-border); border-radius: var(--jup-radius); background: var(--jup-surface); margin-bottom: 14px; }
.whm-filter-head { display: flex; align-items: center; gap: 10px; background: var(--jup-bg); border-bottom: 1px solid var(--jup-border); padding: 8px 12px; font-weight: 600; font-size: 13px; color: var(--jup-text); }
.whm-filter-head .sp { margin-left: auto; font-weight: 400; }
.whm-filter-head a { color: var(--jup-primary); cursor: pointer; font-size: 12.5px; }
.whm-filter-body { padding: 12px; }
.whm-filter-body.collapsed { display: none; }
.whm-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px 18px; }
.whm-grid3 .full { grid-column: 1 / -1; }

/* ---- toolbar de resultados ---- */
.whm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--jup-bg); border: 1px solid var(--jup-border); border-radius: var(--jup-radius); margin-bottom: 12px; font-size: 12.5px; color: var(--jup-text-muted); }
.whm-toolbar .grow { flex: 1; }
.whm-count { background: #e9ecef; color: #495057; border-radius: 10px; padding: 1px 8px; font-size: 11.5px; }
.whm-toolbar select { padding: 3px 6px; border: 1px solid var(--jup-border-strong); border-radius: var(--jup-radius-sm); font-size: 12.5px; }

/* ---- barra de acciones en lote ---- */
.whm-bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 12px; background: var(--jup-bg); border: 1px solid var(--jup-border); border-bottom: none; border-radius: var(--jup-radius) var(--jup-radius) 0 0; font-size: 12.5px; }
.whm-bulkbar .sp { margin-left: auto; }
.whm-bulkbar a { color: var(--jup-primary); cursor: pointer; }
.whm-bulkbar a.dgr { color: var(--jup-danger); }

/* ---- tabla densa con acciones por fila ---- */
.whm-tablewrap { border: 1px solid var(--jup-border); border-radius: 0 0 var(--jup-radius) var(--jup-radius); overflow: auto; max-height: 72vh; }
.whm-tablewrap.top { border-radius: var(--jup-radius); }
.whm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--jup-surface); }
.whm-table th { background: var(--jup-bg); border: 1px solid var(--jup-border); padding: 7px 9px; text-align: left; font-weight: 600; color: #495057; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.whm-table td { border: 1px solid var(--jup-border); padding: 6px 9px; vertical-align: top; color: var(--jup-text); word-break: break-word; }
.whm-table tbody tr:nth-child(even) { background: #fcfcfd; }
.whm-table tbody tr:hover { background: #f1f6fc; }
.whm-table.dense td, .whm-table.dense th { padding: 4px 8px; }
.whm-table td.act { text-align: center; white-space: nowrap; width: 1%; }
.whm-table td.chk, .whm-table th.chk { width: 1%; text-align: center; }
.whm-table a { color: var(--jup-primary); cursor: pointer; text-decoration: none; }
.whm-table a:hover { text-decoration: underline; }
.whm-iconbtn { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--jup-border); border-radius: var(--jup-radius-sm); background: var(--jup-surface); color: var(--jup-primary); cursor: pointer; font-size: 12px; padding: 0; }
.whm-iconbtn:hover { background: #e9f2ff; border-color: var(--jup-primary); }
.whm-iconbtn.dgr { color: var(--jup-danger); }
.whm-iconbtn.dgr:hover { background: #fdecee; border-color: var(--jup-danger); }
.whm-sort { color: var(--jup-text-muted); font-size: 10px; margin-left: 4px; }

/* ---- tabs ---- */
.whm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--jup-border); margin-bottom: 14px; flex-wrap: wrap; }
.whm-tab { padding: 8px 16px; font-size: 13px; color: #495057; cursor: pointer; border: 1px solid transparent; border-bottom: none; border-radius: var(--jup-radius) var(--jup-radius) 0 0; }
.whm-tab:hover { background: #f1f6fc; color: var(--jup-primary); }
.whm-tab.active { background: var(--jup-surface); border-color: var(--jup-border); border-bottom-color: var(--jup-surface); color: var(--jup-primary); font-weight: 600; margin-bottom: -1px; }
.whm-tabpane { display: none; }
.whm-tabpane.active { display: block; }

/* tabla densa: las columnas se dimensionan al contenido y el wrapper scrollea
   horizontal (como el WHM real), en vez de partir los valores en varias lineas */
.whm-table { width: max-content; min-width: 100%; }
.whm-table td { white-space: nowrap; }
.whm-table td.wrap, .whm-table td.recip { white-space: normal; min-width: 160px; }
.whm-tablewrap { max-width: 100%; }

/* ---- layout de 2 columnas con panel lateral (como el "PHP Status" del WHM) ---- */
/* OJO: el layout solo puede aplicarse cuando la sección está ACTIVA; si no, el ID
   le gana a `.section{display:none}` y la sección queda siempre visible. */
#section-accounts.active { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 18px; align-items: start; }
.whm-side-info { grid-column: 2; grid-row: 1 / span 12; }
.whm-side-info .panel { margin: 0; }
.whm-side-info table th { background: transparent; border: none; padding: 4px 0; font-weight: 400; color: var(--jup-text-muted); font-size: 12px; }
.whm-side-info table td { border: none; padding: 4px 0; text-align: right; }
@media (max-width: 1180px) {
  #section-accounts.active { grid-template-columns: minmax(0, 1fr); }
  .whm-side-info { grid-column: 1; grid-row: auto; }
}

/* ---- resultados del buscador global (herramientas + cuentas) ---- */
.gs-head { padding: 6px 12px; background: var(--jup-bg); border-bottom: 1px solid var(--jup-border); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--jup-text-muted); font-weight: 600; }
.gs-item { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 7px 12px; border-bottom: 1px solid #f1f4f8; text-decoration: none; color: inherit; }
.gs-item:last-child { border-bottom: none; }
.gs-item:hover { background: #f1f6fc; }
.gs-item b { color: var(--jup-primary); font-weight: 600; }
.gs-item span { color: var(--jup-text-muted); font-size: 11.5px; text-align: right; }

/* ============================================================================
   COMPONENTES v2 — paridad con el WHM/cPanel real (capturas A / A-2)
   ----------------------------------------------------------------------------
   Estas reglas van al final a propósito: pisan por orden (misma especificidad) lo
   de arriba. Los nombres canónicos son `jup-*`; `whm-*` queda como alias para no
   romper el markup existente.
   ========================================================================== */

/* ---- topbar: fila compacta con separadores (como el original) ---- */
.jup-meta {
  display: flex; align-items: center; min-width: 0;
  color: #9fb0c4; font-size: 12px;
}
.jup-meta > span {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 0 14px; border-left: 1px solid rgba(255, 255, 255, .14);
  white-space: nowrap;
}
.jup-meta > span:first-child { border-left: none; padding-left: 0; }
.jup-meta .k { font-size: 11.5px; color: #8fa3c0; font-weight: 400; text-transform: none; letter-spacing: 0; }
.jup-meta .v { font-size: 12.5px; color: #fff; font-weight: 500; }
.whm-topbar .jup-meta { height: 100%; }
.whm-topbar .jup-meta .v a { color: #fff; }

/* buscador "Search Tools and Accounts (/)" con lupa y limpiar */
.jup-searchbox { position: relative; flex: 1; max-width: 560px; }
.jup-searchbox input {
  width: 100%; padding: 7px 34px 7px 32px;
  border: 1px solid var(--jup-border-strong); border-radius: var(--jup-radius);
  background: #fff; color: var(--jup-text); font: inherit; font-size: 13px;
}
.jup-searchbox input::placeholder { color: #8a94a3; }
.jup-searchbox input:focus { outline: none; border-color: #86b7fe; box-shadow: var(--jup-ring); }
.jup-searchbox .ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: #7b8794; display: grid; place-items: center; pointer-events: none;
}
.jup-searchbox .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: none; background: transparent; color: #7b8794;
  font-size: 15px; line-height: 1; padding: 0; border-radius: 50%; cursor: pointer;
}
.jup-searchbox .clear:hover { background: var(--jup-bg); color: var(--jup-text); }

/* ---- pagehead: icono sin caja + título grande + "?" de ayuda ---- */
.jup-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 2px; }
.jup-head-ico {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  color: var(--jup-navy); background: transparent; border: none;
}
.jup-head h1, .jup-head-title {
  font-size: 26px; font-weight: 400; letter-spacing: -.2px; line-height: 1.15;
  color: #3f4a5a; margin: 0;
}
.jup-help {
  width: 17px; height: 17px; flex: none; border-radius: 50%;
  border: 1px solid #aab4c0; color: #7b8794; background: #fff;
  font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
  cursor: help; text-decoration: none;
}
.jup-help:hover { background: var(--jup-bg); color: var(--jup-text); }

/* breadcrumb con icono de home */
.jup-crumbs { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #6c757d; margin: 2px 0 16px; }
.jup-crumbs a { color: var(--jup-primary); cursor: pointer; text-decoration: none; }
.jup-crumbs a:hover { text-decoration: underline; }
.jup-crumbs .home { display: inline-grid; place-items: center; color: #6c757d; }
.jup-crumbs .sep { color: #adb5bd; }

/* ---- tabla canónica: sólo líneas horizontales, th en Title Case ---- */
.jup-table, .whm-table, table.jup-table {
  width: 100%; border-collapse: collapse; background: var(--jup-surface);
  font-size: 12.5px; color: var(--jup-text);
}
.jup-table th, .whm-table th {
  background: #f2f4f7; border: none; border-bottom: 1px solid var(--jup-border);
  padding: 8px 10px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: #3f4a5a;
  text-transform: none; letter-spacing: 0;
  position: sticky; top: 0; z-index: 1;
}
.jup-table th.sortable { cursor: pointer; user-select: none; }
.jup-table th.sortable:hover { background: #e9edf3; }
.jup-table th .sort { color: #8a94a3; font-size: 9px; margin-left: 5px; }
.jup-table th.num, .jup-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.jup-table td, .whm-table td {
  border: none; border-bottom: 1px solid #eef1f5;
  padding: 8px 10px; vertical-align: middle; color: var(--jup-text); white-space: nowrap;
}
.jup-table td.wrap { white-space: normal; min-width: 180px; }
.jup-table tbody tr:hover, .whm-table tbody tr:hover { background: #f6f9fd; }
.jup-table tbody tr.is-susp, .whm-table tbody tr.is-susp { background: #fdf1f1; }
.jup-table tbody tr.is-susp:hover { background: #fbe8e8; }
.jup-table tfoot td { border-top: 1px solid var(--jup-border); font-weight: 600; background: #fafbfc; }
.jup-table .chk { width: 1%; text-align: center; }
.jup-table .act { width: 1%; text-align: center; white-space: nowrap; }
.jup-table a { color: #0b5cc0; text-decoration: none; cursor: pointer; }
.jup-table a:hover { text-decoration: underline; }
.jup-table td.mono, .jup-table td .mono { font-family: var(--jup-mono); font-size: 11.5px; }
.jup-tablewrap {
  border: 1px solid var(--jup-border); border-radius: var(--jup-radius);
  overflow: auto; background: var(--jup-surface);
}
.jup-tablewrap.bare { border: none; border-radius: 0; }
/* tabla con texto largo: el wrapper scrollea igual (no se rompen las filas) */
.jup-table .nowrap { white-space: nowrap; }
.jup-table .empty-row td { text-align: center; color: var(--jup-text-muted); padding: 22px 10px; }

/* ---- paginador WHM: "Page: First 1 2 3 Last All · Per Page 30 · Showing X of Y" ---- */
.jup-pager {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 2px; font-size: 12px; color: var(--jup-text-muted);
}
.jup-pager .lbl { color: #495057; }
.jup-pager a, .jup-pager button.pg {
  color: #0b5cc0; background: transparent; border: none; padding: 1px 5px;
  font: inherit; cursor: pointer; border-radius: 2px; text-decoration: none;
}
.jup-pager a:hover, .jup-pager button.pg:hover { text-decoration: underline; background: transparent; }
.jup-pager .cur {
  display: inline-block; min-width: 20px; text-align: center;
  border: 1px solid var(--jup-border-strong); border-radius: 2px;
  padding: 1px 5px; color: var(--jup-text); background: #fff; font-weight: 600;
}
.jup-pager .sp { flex: 1; }
.jup-pager select {
  padding: 2px 4px; border: 1px solid var(--jup-border-strong);
  border-radius: 2px; font: inherit; font-size: 12px; background: #fff;
}
.jup-pager .total { color: #495057; }
.jup-pager .total b { color: var(--jup-text); }

/* ---- formulario del WHM: label a la IZQUIERDA del control ---- */
.jup-form { display: flex; flex-direction: column; gap: 12px; }
.jup-frow { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.jup-frow > .lbl {
  width: 168px; flex: none; padding-top: 6px;
  font-size: 12.5px; font-weight: 600; color: #495057;
}
.jup-frow > .ctl { flex: 1; min-width: 220px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jup-frow .ctl input[type=text], .jup-frow .ctl input[type=password],
.jup-frow .ctl input[type=date], .jup-frow .ctl input[type=time],
.jup-frow .ctl input[type=number], .jup-frow .ctl select, .jup-frow .ctl textarea {
  padding: 6px 10px; border: 1px solid var(--jup-border-strong);
  border-radius: var(--jup-radius); font: inherit; font-size: 13px; background: #fff;
  color: var(--jup-text); max-width: 100%;
}
.jup-frow .ctl input:focus, .jup-frow .ctl select:focus, .jup-frow .ctl textarea:focus {
  outline: none; border-color: #86b7fe; box-shadow: var(--jup-ring);
}
.jup-frow .hint { font-size: 11.5px; color: var(--jup-text-muted); width: 100%; }
.jup-frow .grow { flex: 1; }
/* radios/checks en línea, como "Search By: (•) Username/Domain ( ) Domain …" */
.jup-radios { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--jup-text); }
.jup-radios label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.jup-radios input[type=radio], .jup-radios input[type=checkbox] { margin: 0; }
/* acciones del formulario (Find / Apply Filter / Run Report) */
.jup-form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jup-form-actions .sp { flex: 1; }
/* grupo colapsable dentro de un formulario (equivalente a <details class="whm-group">) */
.jup-group { border: 1px solid var(--jup-border); border-radius: var(--jup-radius); background: #fff; }
.jup-group > summary {
  padding: 9px 12px; background: var(--jup-bg); font-size: 13px; font-weight: 600;
  color: var(--jup-text); cursor: pointer; border-radius: var(--jup-radius);
}
.jup-group[open] > summary { border-bottom: 1px solid var(--jup-border); border-radius: var(--jup-radius) var(--jup-radius) 0 0; }
.jup-group > .body { padding: 12px; }

/* ---- alertas (Jupiter: barra de color + icono) ---- */
.jup-alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px; border-radius: var(--jup-radius); font-size: 12.5px;
  border: 1px solid var(--jup-border); background: #f8f9fa; color: var(--jup-text);
}
.jup-alert .ico { flex: none; margin-top: 1px; }
.jup-alert.info { background: #eaf3ff; border-color: #bcd6fb; color: #0b3d75; }
.jup-alert.warn { background: var(--jup-warning-soft); border-color: #ffe69c; color: #664d03; }
.jup-alert.danger { background: var(--jup-danger-soft); border-color: #f1aeb5; color: #842029; }
.jup-alert.success { background: var(--jup-success-soft); border-color: #a3cfbb; color: #0f5132; }
.jup-alert a { color: inherit; text-decoration: underline; }

/* ---- pills/badges ---- */
.jup-pill {
  display: inline-block; padding: 1px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  background: #e9ecef; color: #495057; border: 1px solid transparent;
}
.jup-pill.ok { background: var(--jup-success-soft); color: #0f5132; border-color: #a3cfbb; }
.jup-pill.warn { background: var(--jup-warning-soft); color: #664d03; border-color: #ffe69c; }
.jup-pill.bad { background: var(--jup-danger-soft); color: #842029; border-color: #f1aeb5; }
.jup-pill.info { background: #eaf3ff; color: #0b3d75; border-color: #bcd6fb; }

/* ---- tarjeta/panel con header y acciones (equivalente a .panel) ---- */
.jup-card { background: var(--jup-surface); border: 1px solid var(--jup-border); border-radius: var(--jup-radius); overflow: hidden; }
.jup-card > .hd {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: var(--jup-bg); border-bottom: 1px solid var(--jup-border);
  font-size: 13px; font-weight: 600; color: var(--jup-text);
}
.jup-card > .hd .sp { flex: 1; }
.jup-card > .hd a { color: var(--jup-primary); font-weight: 500; font-size: 12.5px; cursor: pointer; }
.jup-card > .bd { padding: 14px; }
.jup-card > .bd.tight { padding: 0; }

/* ---- layout: contenido principal + panel lateral (como "PHP Status") ---- */
.jup-cols { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 18px; align-items: start; }
.jup-side { min-width: 0; }
@media (max-width: 1180px) {
  .jup-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================================
   TEMA CLIENTE (PanelC) — mismo sistema, chrome y densidad del cPanel Jupiter
   ----------------------------------------------------------------------------
   PanelC conserva su chrome (nav oscura + topbar claro, que ya replica al cliente)
   pero los COMPONENTES (tablas, botones, tarjetas, pager, alerts) pasan a ser los
   mismos del admin. Se estilizan las clases `cp-*` existentes: cero HTML nuevo.
   ========================================================================== */
body[data-app="client"] { background: #f3f5f9; }
body[data-app="client"] .cp-main h1 { font-size: 24px; font-weight: 400; color: #3f4a5a; }

body[data-app="client"] .cp-card {
  border: 1px solid var(--jup-border); border-radius: var(--jup-radius);
  background: var(--jup-surface); box-shadow: var(--jup-shadow); padding: 14px;
}
body[data-app="client"] .cp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--jup-primary); color: #fff; border: 1px solid var(--jup-primary);
  border-radius: var(--jup-radius); padding: 6px 14px; font: inherit; font-size: 13px;
  cursor: pointer; font-weight: 500; line-height: 1.5;
}
body[data-app="client"] .cp-btn:hover { background: var(--jup-primary-hover); border-color: var(--jup-primary-hover); }
body[data-app="client"] .cp-btn.ghost { background: #fff; color: var(--jup-text); border-color: var(--jup-border-strong); }
body[data-app="client"] .cp-btn.ghost:hover { background: var(--jup-bg); }
body[data-app="client"] .cp-btn:disabled { opacity: .55; cursor: not-allowed; }
body[data-app="client"] .cpf-table,
body[data-app="client"] table.cpf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
body[data-app="client"] .cpf-table th {
  background: #f2f4f7; border: none; border-bottom: 1px solid var(--jup-border);
  padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 600; color: #3f4a5a;
  text-transform: none; letter-spacing: 0;
}
body[data-app="client"] .cpf-table td {
  border: none; border-bottom: 1px solid #eef1f5; padding: 8px 10px; vertical-align: middle;
}
body[data-app="client"] .cpf-table tbody tr:hover { background: #f6f9fd; }
body[data-app="client"] .cpf-table a { color: #0b5cc0; text-decoration: none; }
body[data-app="client"] .cpf-table a:hover { text-decoration: underline; }
body[data-app="client"] .cp-cat { border-radius: var(--jup-radius); }
body[data-app="client"] .cp-tool .lbl { color: #0b5cc0; }
body[data-app="client"] .cp-panel { border-radius: var(--jup-radius); }
body[data-app="client"] .jup-table,
body[data-app="client"] .whm-table { border-radius: 0; }

/* ---- menú del avatar (PanelC / configuración / logout) ---- */
.jup-usermenu {
  position: absolute; right: 14px; top: calc(100% + 2px);
  min-width: 190px; background: #fff; border: 1px solid var(--jup-border);
  border-radius: var(--jup-radius); box-shadow: var(--jup-shadow-lg);
  padding: 4px 0; z-index: 1200;
}
.jup-usermenu[hidden] { display: none; }
.jup-usermenu a {
  display: block; padding: 7px 14px; font-size: 12.5px; color: var(--jup-text);
  cursor: pointer; text-decoration: none;
}
.jup-usermenu a:hover { background: #f1f6fc; color: var(--jup-primary); }

/* ============================================================================
   AJUSTES DE DENSIDAD (para que las tablas anchas entren como en el original)
   ========================================================================== */
.jup-table th, .jup-table td { padding: 7px 8px; font-size: 12px; }
.jup-table th { font-size: 11.5px; }
.jup-table td.mono, .jup-table td .mono { font-size: 11px; }
.whm-side-info .panel-header { padding: 8px 12px; font-size: 12.5px; }
.whm-side-info .panel-body { padding: 10px 12px; }
.whm-side-info table { font-size: 12px; }
.whm-side-info .jup-pill { font-size: 10.5px; }.jup-frow .ctl input.w-lg { min-width: 300px; }
.jup-form-actions.end { justify-content: flex-end; }

/* ---- campos de LÍMITE del WHM: "personalizado [n] / ilimitado" en una fila ---- */
.jup-limit { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.jup-limit > input { max-width: 104px; }
.jup-check { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.jup-check input[type=checkbox], .jup-check input[type=radio] { margin: 0; }
/* ---- utilidades de layout (reemplazan estilos inline repetidos) ---- */
.jup-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.jup-actions.end { justify-content: flex-end; }
.jup-actions.mb { margin-bottom: 14px; }
.jup-actions.mb16 { margin-bottom: 16px; }
.jup-actions.mt { margin-top: 12px; }
.jup-input-inline { padding: 9px 11px; border: 1px solid var(--jup-border); border-radius: var(--jup-radius); flex: 1 1 auto; font: inherit; font-size: 13px; }.jup-actions.mt8 { margin-top: 8px; }
.jup-actions.gap10 { gap: 10px; }
.jup-actions.mt14 { margin-top: 14px; }
.jup-input-w { padding: 7px 10px; border: 1px solid var(--jup-border-strong); border-radius: var(--jup-radius); font: inherit; font-size: 13px; }.jup-input-w.w-240 { width: 240px; flex: 0 0 240px; }
.jup-input-w.w-220 { width: 220px; flex: 0 0 220px; }
.jup-actions-top { padding-top: 12px; border-top: 1px solid var(--jup-border); }

/* ---- panel de acciones INLINE de una cuenta (paridad con List Accounts del WHM) ---- */
.jup-expand-row > td {
  padding: 0; background: #fff; border-bottom: 1px solid var(--jup-border);
}
.acct-actions { border-top: 1px solid var(--jup-border); }
.acct-actions-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acct-actions-col { padding: 12px 14px; border-right: 1px solid #e9edf2; }
.acct-actions-col:last-child { border-right: none; }
.acct-actions h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--jup-text); }
.acct-actions .row { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.acct-actions .row input[type=password],
.acct-actions .row input[type=text] {
  flex: 1; min-width: 120px; padding: 5px 8px; border: 1px solid var(--jup-border-strong);
  border-radius: 3px; font: inherit; font-size: 12.5px; background: #fff;
}
.acct-actions .row input:focus { outline: none; border-color: #86b7fe; box-shadow: var(--jup-ring); }
.acct-actions .chk { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--jup-text); }
.acct-actions .chk input[type=checkbox] { margin: 0; }
.acct-actions .q {
  display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none;
  border-radius: 50%; border: 1px solid #aab4c0; color: #6c757d; background: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 1; cursor: help;
}
.acct-actions-foot { padding: 12px 14px; border-top: 1px solid var(--jup-border); }
.acct-actions-foot .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.acct-actions-foot .btns .btn { padding: 6px 14px; }
.acct-actions-foot .btns .btn[disabled] { opacity: .55; cursor: not-allowed; }
/* List Accounts: cuando la tabla scrollea en horizontal (tiene mas columnas que el ancho
   visible), el panel de acciones queda pegado a la izquierda y no se corta. */
#acct-tablewrap { overflow-x: auto; }
.jup-expand-row > td { position: sticky; left: 0; }
.acct-actions { position: sticky; left: 0; max-width: 1000px; }
@media (max-width: 1100px) {
  .acct-actions-cols { grid-template-columns: 1fr; }
  .acct-actions-col { border-right: none; border-bottom: 1px solid #e9edf2; }
  .acct-actions { min-width: 0; }
}