/* ─────────────────────────────────────────────────────────────
   Capa visual "app premium" de Well-Being (2026-09-26)
   Referencia: tableros bancarios modernos — fondo suave, tarjetas
   blancas flotantes, menú con íconos y píldora activa, tipografía
   geométrica. Solo cambia la apariencia: la estructura y las
   funciones siguen iguales. Va después de style.css y movil.css.
   ───────────────────────────────────────────────────────────── */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --card-border: rgba(22, 43, 34, .05);
}
:root[data-theme="dark"] { --card-border: rgba(255, 255, 255, .06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --card-border: rgba(255, 255, 255, .06); } }

body { font-family: var(--font); font-size: 14px; letter-spacing: -.005em; }

/* Barras de desplazamiento discretas */
* { scrollbar-width: thin; scrollbar-color: var(--n-200) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--n-200); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── Estructura en computador: menú flotante + contenido ── */
@media (min-width: 901px) {
  .shell { padding: 16px; gap: 20px; }
  .sidebar {
    width: 248px; flex: 0 0 248px; height: calc(100vh - 32px); top: 16px;
    background: var(--surface); border: 1px solid var(--card-border); border-radius: 22px;
    box-shadow: var(--shadow); padding: 20px 14px 14px;
  }
  .main { padding: 2px 6px 48px; max-width: 1600px; }

  /* Chats: la bandeja completa es una tarjeta del alto de la ventana */
  .shell .main:has(.kb) { padding: 0; }
  .shell .kb { height: calc(100vh - 32px); border-radius: 22px; overflow: hidden; border: 1px solid var(--card-border); box-shadow: var(--shadow); }
  .main:has(.kb) .topbar { display: none; }
}

/* ── Marca ── */
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 18px; margin-bottom: 6px; border-bottom: none; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; letter-spacing: -.03em;
  box-shadow: 0 6px 14px var(--accent-ring);
}
.brand-name { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.brand-sub { font-size: 10px; margin-top: 1px; }

.buscador input { border-radius: 12px; padding-top: 10px; padding-bottom: 10px; background: var(--n-50); }

/* ── Menú con íconos ── */
.nav { gap: 3px; }
.nav a {
  justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px;
  font-size: 13.5px; font-weight: 560; color: var(--text-muted);
}
.nav a:hover { background: var(--n-50); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-ic { width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex; color: var(--text-faint); transition: color .12s ease; }
.nav-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover .nav-ic { color: var(--text-muted); }
.nav a.on .nav-ic { color: var(--accent); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-weight: 700; padding: 1px 8px; }
.nav a.on .count { background: var(--accent); }
.nav-grupo { padding: 18px 12px 6px; font-size: 10.5px; letter-spacing: .09em; }

.sidebar-foot {
  border-top: none; margin-top: auto; padding: 12px; background: var(--n-50);
  border-radius: 16px; color: var(--text-muted); font-size: 12px;
}
.sidebar-foot > div:first-child { font-weight: 650; color: var(--text); }
.tema { background: var(--surface); }

/* ── Barra superior (computador) ── */
.topbar { display: none; }
@media (min-width: 901px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 2px 22px; }
}
.tb-saludo b { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.tb-saludo span { font-size: 12.5px; color: var(--text-faint); text-transform: capitalize; }
.tb-acciones { display: flex; align-items: center; gap: 10px; }
.tb-btn {
  position: relative; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--card-border);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.tb-btn:hover { text-decoration: none; background: var(--n-25); }
.tb-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tb-btn .tb-luna { display: inline-flex; }
.tb-btn .tb-sol { display: none; }
:root[data-theme="dark"] .tb-btn .tb-luna { display: none; }
:root[data-theme="dark"] .tb-btn .tb-sol { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tb-btn .tb-luna { display: none; }
  :root:not([data-theme="light"]) .tb-btn .tb-sol { display: inline-flex; }
}
.tb-badge {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 750; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.tb-yo { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.tb-avatar {
  width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 750; font-size: 13px;
}
.tb-yo small { display: block; font-size: 11px; color: var(--text-faint); text-transform: capitalize; line-height: 1.2; }
.tb-yo b { display: block; font-size: 13px; font-weight: 700; line-height: 1.25; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Encabezados ── */
.page-head { margin-bottom: 22px; }
.page-head h1, .page-title { font-size: 26px; font-weight: 780; letter-spacing: -.03em; }
.page-sub { font-size: 13.5px; margin-top: 4px; }

/* ── Tarjetas ── */
.card, .stat {
  border: 1px solid var(--card-border); border-radius: 20px; box-shadow: var(--shadow);
}
.card-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border-soft); }
.card-head h2, .card-title { font-size: 15.5px; font-weight: 720; letter-spacing: -.015em; }
.card-pad { padding: 18px 22px; }
.grid { gap: 18px; }
.stat { padding: 18px 20px; }
.stat-label { font-size: 11px; letter-spacing: .07em; color: var(--text-faint); font-weight: 650; }
.stat-value { font-size: 30px; font-weight: 780; letter-spacing: -.035em; }

/* ── Tablas ── */
th { background: var(--n-50); border-bottom: none; padding: 11px 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; }
td { padding: 13px 20px; font-size: 13.5px; }
tbody tr:hover { background: var(--n-25); }

/* ── Botones ── */
.btn { border-radius: 11px; padding: 9px 16px; font-size: 13.5px; font-weight: 620; border-color: var(--border); }
.btn:hover { background: var(--n-50); border-color: var(--border-strong); }
.btn-primary { box-shadow: 0 6px 16px var(--accent-ring); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-sm { border-radius: 9px; padding: 6px 12px; font-size: 12.5px; }
.btn-ghost { box-shadow: none; }

/* ── Formularios ── */
input[type=text], input[type=search], input[type=email], input[type=number], input[type=tel],
input[type=password], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  border-radius: 11px; padding: 10px 13px; font-size: 14px; border-color: var(--border);
  background: var(--surface);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
label { font-size: 12.5px; font-weight: 650; }

/* ── Etiquetas y avisos ── */
.chip { padding: 3px 10px; font-weight: 620; }
.alert { border-radius: 14px; padding: 12px 16px; }

/* ── Pestañas: segmentadas ── */
.tabs { border-bottom: none; background: var(--n-100); border-radius: 14px; padding: 4px; gap: 4px; display: inline-flex; max-width: 100%; }
.tabs a { border-bottom: none; margin: 0; border-radius: 10px; padding: 8px 16px; font-weight: 620; }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ── Búsqueda global ── */
#paleta { backdrop-filter: blur(6px); background: rgba(15, 25, 20, .32); }
.paleta-caja { border-radius: 20px; border: 1px solid var(--card-border); }
.paleta-item { border-radius: 10px; }

/* ── Celular: mismas tarjetas, un poco más compactas ── */
@media (max-width: 900px) {
  .card, .stat { border-radius: 18px; }
  .card-head { padding: 15px 16px 12px; }
  .card-pad { padding: 15px 16px; }
  .page-head h1, .page-title { font-size: 22px; }
  .m-top { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
  .m-marca { background: linear-gradient(145deg, var(--accent), var(--accent-dark)); border-radius: 10px; }
  .tabs { display: flex; }
}

@media print {
  .topbar { display: none !important; }
  .card, .stat { box-shadow: none; border: none; }
}

/* Ajustes finos */
.buscador input { padding-left: 34px; }
.tb-saludo span { display: block; text-transform: none; }
.tb-saludo span::first-letter { text-transform: uppercase; }
#kc-form { gap: 6px; }
#kc-form .kc-clip { width: 38px; height: 38px; flex: 0 0 38px; font-size: 16px; }
#kc-form textarea { min-width: 120px; padding: 10px 14px; border-radius: 20px; }

/* ── Identidad OTR: titulares en Poppins, marca navy + teal ── */
h1, h2, .brand-name, .page-head h1 { font-family: "Poppins", var(--font); }
.brand-logo { background: linear-gradient(145deg, #0F172A, #1e293b); font-size: 12px; box-shadow: 0 6px 14px rgba(15, 23, 42, .18); }
