
  :root {
    --sidebar-w: 242px;
    --bg: #0a0d13;
    --panel: #11151f;
    --panel2: #171c2a;
    --line: #1f2637;
    --line2: #2a3348;
    --ink: #e8ecf4;
    --muted: #8c96ac;
    --faint: #5c6478;
    --acc: #4d7dfe;
    --acc-hi: #6e95ff;
    --acc-soft: rgba(77, 125, 254, 0.13);
    --ok: #34c77b;
    --ok-soft: rgba(52, 199, 123, 0.12);
    --warn: #e8b54d;
    --warn-soft: rgba(232, 181, 77, 0.12);
    --bad: #f0655a;
    --bad-soft: rgba(240, 101, 90, 0.12);
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background:
      radial-gradient(1100px 520px at 75% -12%, rgba(77, 125, 254, 0.08), transparent 60%),
      var(--bg);
    color: var(--ink);
    font-family: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
  }

  h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
  h1 { font-size: 20px; }
  h2 { font-size: 15px; }
  h3 { font-size: 14px; }
  a { color: inherit; }
  button { font: inherit; }

  .lbl {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--faint);
  }
  .muted { color: var(--muted); }
  .faint { color: var(--faint); }
  .money { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
  .money .cur { color: var(--faint); font-weight: 500; font-size: 0.82em; margin-right: 4px; }
  .currency-values {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 2px 12px;
    min-width: 0;
    max-width: 100%;
    text-align: right;
    vertical-align: middle;
  }
  .currency-value { display: inline-flex; align-items: baseline; }
  .tnum { font-variant-numeric: tabular-nums; }

  /* ---- layout ---- */
  .shell { display: flex; min-height: 100vh; }
  .side {
    width: var(--sidebar-w); flex-shrink: 0;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--line);
    background: rgba(13, 16, 24, 0.75);
    padding: 16px 12px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; }
  .logo {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, #6e95ff 0%, #4d7dfe 55%, #2f55c8 100%);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; color: #fff;
    box-shadow: 0 4px 14px rgba(77, 125, 254, 0.35);
  }
  .brand-mark {
    width: 36px; height: 36px; object-fit: contain; flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(132, 78, 255, .5));
  }
  .brand-t { line-height: 1.2; }
  .brand-t b { display: block; font-size: 13px; font-weight: 700; }
  .brand-t span { font-size: 10.5px; color: var(--muted); }
  .nav-group-label {
    margin-top: 7px;
    padding: 11px 10px 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.035);
    font-size: 9.5px;
    letter-spacing: 0.11em;
  }
  .nav-group-label.nav-group-first { margin-top: 0; padding-top: 8px; border-top: none; }
  .navlink {
    display: flex; align-items: center; gap: 9px; width: 100%;
    font-weight: 500; font-size: 13px; color: var(--muted);
    padding: 7px 10px; border-radius: 9px; text-decoration: none;
    border: none; background: none; cursor: pointer; text-align: left;
  }
  .navlink:hover { color: var(--ink); background: rgba(255, 255, 255, 0.03); }
  .navlink.on { color: var(--ink); background: var(--acc-soft); font-weight: 600; }
  .navlink.on svg { color: var(--acc-hi); }
  .navlink svg { flex-shrink: 0; opacity: 0.85; }
  .side-foot { margin-top: auto; padding: 10px 6px 2px; display: grid; gap: 2px; }

  .content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 26px; border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .who { display: flex; align-items: center; gap: 11px; }
  .av {
    width: 32px; height: 32px; border-radius: 99px; flex-shrink: 0;
    background: var(--acc-soft); color: var(--acc-hi);
    border: 1px solid rgba(77, 125, 254, 0.35);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 11px;
  }
  main.page { padding: 22px 26px 60px; max-width: 1500px; width: 100%; margin-inline: auto; }

  /* ---- componentes ---- */
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
  .card-p { padding: 15px 17px; }

  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
    padding: 2px 9px; border-radius: 99px; text-transform: uppercase;
    border: 1px solid var(--line2); color: var(--muted); background: var(--panel2);
    white-space: nowrap;
  }
  .chip::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--faint); }
  .chip.ok { color: var(--ok); border-color: rgba(52, 199, 123, 0.35); background: var(--ok-soft); }
  .chip.ok::before { background: var(--ok); }
  .chip.warn { color: var(--warn); border-color: rgba(232, 181, 77, 0.4); background: var(--warn-soft); }
  .chip.warn::before { background: var(--warn); }
  .chip.bad { color: var(--bad); border-color: rgba(240, 101, 90, 0.4); background: var(--bad-soft); }
  .chip.bad::before { background: var(--bad); }
  .chip.acc { color: var(--acc-hi); border-color: rgba(77, 125, 254, 0.4); background: var(--acc-soft); }
  .chip.acc::before { background: var(--acc); }

  .btn {
    appearance: none; cursor: pointer; font: inherit;
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 600; font-size: 13px;
    padding: 7px 13px; border-radius: 9px;
    border: 1px solid var(--line2);
    background: var(--panel2); color: var(--ink);
    text-decoration: none;
    transition: border-color 0.12s, background 0.12s;
  }
  .btn:hover { border-color: var(--acc); }
  .btn.primary {
    background: var(--acc); border-color: var(--acc); color: #fff;
    box-shadow: 0 4px 14px rgba(77, 125, 254, 0.28);
  }
  .btn.primary:hover { background: var(--acc-hi); border-color: var(--acc-hi); }
  .btn.danger { color: var(--bad); }
  .btn.danger:hover { border-color: var(--bad); }
  .btn.management-delete {
    background: color-mix(in srgb, var(--bad) 5%, var(--panel2));
    border-color: color-mix(in srgb, var(--bad) 32%, var(--line2));
  }
  .btn.management-delete:hover {
    color: #fff;
    background: color-mix(in srgb, var(--bad) 82%, #111);
    border-color: var(--bad);
  }
  .btn.small { padding: 3px 9px; font-size: 12px; border-radius: 7px; }
  .btn.link { border: none; background: none; color: var(--muted); padding: 3px 6px; text-decoration: underline; text-underline-offset: 3px; }
  .btn.link:hover { color: var(--ink); }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .btn:focus-visible, .navlink:focus-visible, .input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

  .input, select.input, textarea.input {
    font: inherit; color: var(--ink); font-size: 13px;
    background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px;
    padding: 7px 10px; width: 100%;
  }
  .input:focus { outline: 2px solid var(--acc); outline-offset: 0; border-color: var(--acc); }
  .field { display: grid; gap: 5px; }

  /* ---- tablas ---- */
  .twrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
  table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
  .t th {
    text-align: left; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--faint); font-weight: 600; padding: 9px 13px;
    border-bottom: 1px solid var(--line); white-space: nowrap;
  }
  .t td { padding: 8px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
  .t tr:last-child td { border-bottom: none; }
  .t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
  .t tbody tr:hover td { background: rgba(77, 125, 254, 0.045); }

  /* Ventas: la vista principal agrupa la información relacionada para evitar
     una tabla de 14 columnas y el scroll horizontal permanente en escritorio. */
  .ventas-wrap { overflow-x: visible; }
  .ventas-compacta { table-layout: fixed; min-width: 0; }
  .ventas-compacta th, .ventas-compacta td { white-space: normal; overflow-wrap: anywhere; }
  .ventas-compacta th { padding-left: 10px; padding-right: 10px; }
  .ventas-compacta td { padding: 9px 10px; line-height: 1.25; }
  .ventas-compacta .venta-fecha { width: 7%; }
  .ventas-compacta .venta-chatter { width: 16%; }
  .ventas-compacta .venta-modelo { width: 14%; }
  .ventas-compacta .venta-cliente { width: 11%; }
  .ventas-compacta .venta-operacion { width: 16%; }
  .ventas-compacta .venta-honorarios { width: 18%; }
  .ventas-compacta .venta-estado { width: 10%; }
  .ventas-compacta .venta-accion { width: 8%; text-align: right; }
  .ventas-compacta .venta-principal { font-weight: 700; }
  .ventas-compacta .venta-secundario { color: var(--muted); font-size: 11px; margin-top: 3px; }
  .ventas-compacta .venta-terciario { color: var(--faint); font-size: 10px; margin-top: 2px; }
  .ventas-compacta .venta-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--muted); font-size: 10.5px; margin-top: 4px; }
  .ventas-compacta .venta-meta .chip { font-size: 8.5px; padding: 1px 6px; }
  .ventas-compacta .venta-honorario { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 4px 6px; font-size: 11px; }
  .ventas-compacta .venta-honorario + .venta-honorario { margin-top: 4px; }
  .ventas-compacta .venta-honorario > span { color: var(--muted); }
  .ventas-compacta .venta-honorario > b { font-weight: 650; text-align: right; min-width: 0; }
  .ventas-compacta .venta-honorario > small { color: var(--faint); font-size: 9.5px; }
  .ventas-compacta .venta-accion .btn { margin: 2px 0; }

  .honorario-historial { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; }
  .honorario-mes-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel2); border-radius: 9px; padding: 5px 8px; font-size: 11px; color: var(--muted); }
  .honorario-mes-chip b { color: var(--ink); }

  @media (max-width: 900px) {
    .ventas-wrap { overflow-x: auto; }
    .ventas-compacta { min-width: 820px; table-layout: auto; }
  }

  .empty { padding: 26px 16px; text-align: center; color: var(--faint); font-size: 13.5px; }

  .note {
    border: 1px solid var(--line); border-left: 3px solid var(--acc);
    background: var(--panel); border-radius: 10px;
    padding: 9px 13px; font-size: 12.5px; color: var(--muted);
  }

  /* ---- KPIs ---- */
  .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
  .kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; min-width: 0; }
  .kpi .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 5px; }
  .kpi .v.sm { font-size: 14px; color: var(--muted); font-weight: 600; margin-top: 1px; }
  .kpi-currency-list {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 14px;
    margin-top: 5px;
  }
  .kpi-currency-list .v, .kpi-currency-list .v.sm { margin-top: 0; }
  .kpi .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
  a.kpi-link { text-decoration: none; display: block; }

  .delta {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 0 7px; border-radius: 99px; vertical-align: 2px; margin-left: 6px;
  }
  .delta.up { color: var(--ok); background: var(--ok-soft); }
  .delta.down { color: var(--bad); background: var(--bad-soft); }

  /* ---- filtros / segmentos ---- */
  .filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
  .filtros .field { min-width: 130px; }
  .seg { display: inline-flex; gap: 2px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; padding: 2px; }
  .seg a, .seg button {
    font: inherit; font-size: 12px; font-weight: 600; color: var(--muted);
    padding: 3px 11px; border-radius: 7px; text-decoration: none; border: none; background: none; cursor: pointer;
  }
  .seg .on { background: var(--acc); color: #fff; }

  .section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
  }
  .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }

  /* ---- organización del Dashboard ---- */
  .dashboard-title { margin: 2px 0 10px; }
  .dashboard-alertas {
    margin-bottom: 22px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  }
  .dashboard-facturacion { margin-bottom: 18px; }
  .dashboard-filtros {
    display: flex; align-items: end; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 12px;
    margin: 4px 0 16px; background: var(--panel2);
    border: 1px solid var(--line2); border-radius: 12px;
  }
  .dashboard-filtros .filtros { margin-left: auto; }
  .dashboard-filtros-honorarios .dashboard-chatter-field { min-width: 190px; }
  .dashboard-filtros-servicios .filtros { width: 100%; margin-left: 0; }
  .dashboard-filtros-servicios .field:nth-child(-n+2) { min-width: 210px; flex: 1 1 210px; }
  .dashboard-filtros-reportes .filtros { width: 100%; margin-left: 0; }
  .dashboard-filtros-reportes .field:nth-child(-n+4) { min-width: 165px; flex: 1 1 165px; }
  .dashboard-facturacion-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .dashboard-honorarios-nota { font-size: 11.5px; line-height: 1.45; margin-top: 10px; }
  .dashboard-chart-head .seg { flex-shrink: 0; }
  .dashboard-gastos { margin-bottom: 18px; }
  .dashboard-gastos-head { align-items: flex-end; }
  .dashboard-gastos-mes { display: flex; align-items: end; gap: 7px; }
  .dashboard-gastos-mes .field { min-width: 150px; }
  .dashboard-gastos-kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 12px; }
  .dashboard-gastos-gestion {
    border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); overflow: clip;
  }
  .dashboard-gastos-gestion > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 12px;
  }
  .dashboard-gastos-gestion > summary::-webkit-details-marker { display: none; }
  .dashboard-gastos-gestion > summary > span:first-child { display: grid; gap: 2px; }
  .dashboard-gastos-gestion > summary b { font-size: 12.5px; }
  .dashboard-gastos-gestion > summary small { color: var(--muted); font-size: 11px; font-weight: 400; }
  .dashboard-gastos-gestion[open] > summary { border-bottom: 1px solid var(--line); }
  .dashboard-gastos-body { display: grid; gap: 12px; padding: 12px; }
  .dashboard-gasto-form {
    display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(120px, .7fr) 110px minmax(180px, 1.3fr) auto;
    gap: 8px; align-items: end;
  }
  .dashboard-gasto-form .field { min-width: 0; }
  .dashboard-gasto-form .btn { white-space: nowrap; }

  /* ---- liquidaciones: lectura compacta y progresiva ---- */
  .liq-page-head { margin-bottom: 10px; }
  .liq-intro { margin-bottom: 10px; }
  .liq-overview { margin-bottom: 10px; }
  .liquidaciones-stack { display: grid; gap: 10px; }
  .liq-section,
  .liq-subsection {
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    overflow: clip;
  }
  .liq-section > summary,
  .liq-subsection > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center;
    justify-content: space-between; gap: 12px; padding: 10px 13px;
  }
  .liq-section > summary::-webkit-details-marker,
  .liq-subsection > summary::-webkit-details-marker { display: none; }
  .liq-section > summary > span:first-child,
  .liq-subsection > summary > span:first-child { display: grid; gap: 2px; min-width: 0; }
  .liq-section > summary b { font-size: 14px; }
  .liq-subsection > summary b { font-size: 12.5px; }
  .liq-section > summary small,
  .liq-subsection > summary small { color: var(--muted); font-size: 11.5px; font-weight: 400; }
  .liq-section > summary::after,
  .liq-subsection > summary::after {
    content: "+"; flex: 0 0 auto; color: var(--muted); font-size: 17px;
    line-height: 1; margin-left: auto;
  }
  .liq-section[open] > summary::after,
  .liq-subsection[open] > summary::after { content: "−"; }
  .liq-section[open] > summary,
  .liq-subsection[open] > summary { border-bottom: 1px solid var(--line); }
  .liq-section-body { padding: 10px 12px 12px; }
  .liq-subsection { margin-top: 9px; background: var(--panel2); }
  .liq-subsection-body { padding: 9px 10px 10px; }
  .liq-section-toolbar { margin-bottom: 9px; }
  .liq-panel { margin-top: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); }
  .liq-panel .section-head { margin-bottom: 7px; }
  .liq-panel h3 { font-size: 13px; margin: 0; }
  .liq-document-actions { justify-content: flex-end; margin-bottom: 8px; }
  .liq-kpis { gap: 8px; }
  .liq-kpis .kpi { padding: 9px 11px; border-radius: 11px; }
  .liq-kpis .kpi .v { font-size: 17px; }
  .liquidaciones-stack .t th { padding-top: 7px; padding-bottom: 7px; }
  .liquidaciones-stack .t td { padding-top: 6px; padding-bottom: 6px; }
  .liq-inline-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .liq-inline-summary > span {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--panel2);
    color: var(--muted); font-size: 11.5px;
  }
  .liq-inline-summary b { color: var(--ink); font-size: 13px; }
  .liq-note-warn { margin-bottom: 12px; border-left-color: var(--warn); }
  .liq-period-note { margin-bottom: 12px; }
  .liq-model-list { display: grid; gap: 10px; }
  .liq-model-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.005));
  }
  .liq-model-row.liq-state-cerrada { border-color: rgba(46, 204, 113, .28); }
  .liq-model-row.liq-state-borrador { border-color: rgba(91, 123, 255, .28); }
  .liq-model-title {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
  }
  .liq-model-title b { font-size: 15px; }
  .liq-model-meta { display: flex; flex-wrap: wrap; gap: 8px; }
  .liq-model-meta > span {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 8px;
    border-radius: 999px; background: var(--panel2); color: var(--muted); font-size: 11.5px;
  }
  .liq-model-meta > span b { color: var(--ink); font-size: 13px; }
  .liq-model-actions { display: flex; justify-content: flex-end; }
  .liq-action-group { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

  /* ---- directorio combinado: modelos + chatters ---- */
  .people-overview {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px;
    align-items: end; padding: 16px 18px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  }
  .people-overview h2 { margin: 0 0 5px; font-size: 17px; }
  .people-overview p { margin: 0; max-width: 720px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .people-summary { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
  .people-summary > span {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 99px; background: var(--panel2);
    color: var(--muted); font-size: 11.5px; white-space: nowrap;
  }
  .people-summary b { color: var(--ink); font-size: 13px; }
  .people-tabs { display: flex; justify-content: flex-start; margin-bottom: 10px; }
  .people-tabs .seg { min-width: 280px; }
  .people-context-note { margin-bottom: 10px; }
  .people-view { display: grid; gap: 10px; }

  .people-create {
    margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px;
    background: var(--panel); overflow: clip;
  }
  .people-create > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 14px;
  }
  .people-create > summary::-webkit-details-marker { display: none; }
  .people-create > summary > span { display: grid; gap: 2px; }
  .people-create > summary b { font-size: 14px; }
  .people-create > summary small { color: var(--muted); font-size: 11.5px; font-weight: 400; }
  .people-create > summary::after { content: "+"; color: var(--muted); font-size: 18px; }
  .people-create[open] > summary::after { content: "−"; }
  .people-create[open] > summary { border-bottom: 1px solid var(--line); }
  .people-create-body { display: grid; gap: 10px; padding: 12px; }
  .people-create-block {
    display: grid; gap: 11px; padding: 12px; border: 1px solid var(--line);
    border-radius: 11px; background: var(--panel2);
  }
  .people-create-copy { display: grid; gap: 2px; }
  .people-create-copy b { font-size: 13px; }
  .people-create-copy small { color: var(--muted); font-size: 11.5px; }
  .people-create-form { display: flex; gap: 9px; align-items: end; flex-wrap: wrap; }
  .people-create-form .field { flex: 1 1 180px; min-width: 160px; }
  .people-create-form .field:nth-child(2) { flex-basis: 220px; }
  .people-create-form .people-percent-field { flex: 0 1 130px; min-width: 120px; }

  .people-list-card {
    border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: clip;
  }
  .people-list-toolbar {
    display: grid; grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr); gap: 18px;
    align-items: end; padding: 13px 14px; border-bottom: 1px solid var(--line);
  }
  .people-list-heading { display: grid; gap: 3px; min-width: 0; }
  .people-list-heading > b { font-size: 14px; }
  .people-list-heading > small { color: var(--muted); font-size: 11.5px; }
  .people-list-controls {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 280px); gap: 12px;
    align-items: end; min-width: 0;
  }
  .people-control-label,
  .people-search > span {
    color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  }
  .people-team-control { display: grid; gap: 5px; min-width: 0; }
  .people-team-filter {
    display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; overflow-y: hidden;
    padding: 1px 1px 3px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
  }
  .people-team-filter::-webkit-scrollbar { height: 4px; }
  .people-team-filter::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 999px; }
  .people-team-chip {
    appearance: none; border: 1px solid var(--line2); background: var(--panel2); color: var(--muted);
    min-height: 34px; padding: 6px 9px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px;
    font: inherit; font-size: 11.5px; font-weight: 650; white-space: nowrap; cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
  }
  .people-team-chip:hover {
    color: var(--ink); border-color: color-mix(in srgb, var(--team-color) 42%, var(--line2));
    background: color-mix(in srgb, var(--team-color) 6%, var(--panel2)); transform: translateY(-1px);
  }
  .people-team-chip.is-active {
    color: var(--ink); border-color: color-mix(in srgb, var(--team-color) 58%, var(--line2));
    background: color-mix(in srgb, var(--team-color) 13%, var(--panel2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--team-color) 12%, transparent), 0 6px 16px color-mix(in srgb, var(--team-color) 8%, transparent);
  }
  .people-team-chip-dot {
    width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto; background: var(--team-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--team-color) 11%, transparent);
  }
  .people-team-chip > b {
    min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--team-color) 9%, var(--panel)); color: var(--muted); font-size: 9.5px; font-variant-numeric: tabular-nums;
  }
  .people-team-chip.is-active > b { color: var(--ink); background: color-mix(in srgb, var(--team-color) 16%, var(--panel)); }
  .people-team-chip:focus-visible { outline: 2px solid var(--acc-hi); outline-offset: 2px; }
  .people-search { display: grid; gap: 5px; min-width: 0; }
  .people-roster-list { display: grid; }
  .people-roster-row {
    display: grid; gap: 12px; align-items: center; padding: 11px 14px;
    border-bottom: 1px solid var(--line);
  }
  .people-roster-row:last-child { border-bottom: 0; }
  .people-roster-row:hover { background: rgba(255,255,255,.018); }
  .people-model-row-admin { grid-template-columns: minmax(170px,1.4fr) minmax(90px,.55fr) minmax(95px,.55fr) minmax(90px,.55fr) auto; }
  .people-model-row-basic { grid-template-columns: minmax(170px,1.5fr) minmax(90px,.6fr) minmax(90px,.55fr) auto; }
  .people-model-row-chatter-view { grid-template-columns: minmax(170px,1fr) minmax(90px,.55fr) auto; }
  .people-chatter-row { grid-template-columns: minmax(170px,1.2fr) minmax(120px,.7fr) minmax(145px,.8fr) auto; }
  .people-identity { display: grid; gap: 3px; min-width: 0; }
  .people-identity a { width: max-content; max-width: 100%; }
  .people-identity b { font-size: 13.5px; }
  .people-identity small { color: var(--muted); font-size: 11px; }
  .people-cell { display: grid; gap: 2px; min-width: 0; }
  .people-cell > b { font-size: 13px; }
  .people-cell > small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
  .people-cell-label { color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; }
  .people-assignment-count small { max-width: 210px; }
  .people-row-action { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
  .people-filter-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 12px; }
  .people-roster-row[hidden], .people-filter-empty[hidden] { display: none !important; }
  .people-empty { padding: 10px; }


  /* ---- comparativa de rendimiento: grilla ejecutiva, alineada y legible ---- */
  .people-navigation {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 10px;
  }
  .people-navigation .people-tabs,
  .people-navigation .people-mode-tabs { margin: 0; }
  .people-mode-tabs .seg { min-width: 220px; }
  .people-compare-row-btn {
    border-color: color-mix(in srgb, var(--acc-hi) 24%, var(--line2));
    color: color-mix(in srgb, var(--acc-hi) 82%, var(--ink));
  }
  .people-compare-row-btn:hover {
    border-color: color-mix(in srgb, var(--acc-hi) 52%, var(--line2));
    background: color-mix(in srgb, var(--acc-hi) 8%, var(--panel2));
  }
  .people-compare-shell { display: grid; gap: 12px; }
  .people-compare-top,
  .people-compare-period,
  .people-compare-metrics,
  .people-compare-evolution {
    border: 1px solid var(--line); border-radius: 15px; background: var(--panel);
    box-shadow: 0 8px 24px rgba(0,0,0,.035);
  }
  .people-compare-top {
    display: grid; grid-template-columns: minmax(185px,.38fr) minmax(0,1.62fr); gap: 20px;
    align-items: end; padding: 15px 16px;
  }
  .people-compare-title { min-width: 0; }
  .people-compare-kicker {
    display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px;
    font-weight: 800; letter-spacing: .11em; text-transform: uppercase;
  }
  .people-compare-title h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
  .people-compare-profile { display: grid; gap: 6px; min-width: 0; }
  .people-compare-profile-list {
    display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 1px 1px 4px;
    scrollbar-width: thin; scrollbar-color: var(--line2) transparent;
  }
  .people-compare-profile-list::-webkit-scrollbar { height: 4px; }
  .people-compare-profile-list::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 99px; }
  .people-compare-profile-chip {
    display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px;
    border: 1px solid var(--line2); border-radius: 10px; background: var(--panel2);
    color: var(--muted); font-size: 11.5px; font-weight: 650; text-decoration: none; white-space: nowrap;
    transition: .15s ease;
  }
  .people-compare-profile-chip:hover { color: var(--ink); border-color: color-mix(in srgb, var(--acc-hi) 35%, var(--line2)); }
  .people-compare-profile-chip.is-active {
    color: var(--ink); border-color: color-mix(in srgb, var(--acc-hi) 58%, var(--line2));
    background: color-mix(in srgb, var(--acc-hi) 10%, var(--panel2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc-hi) 9%, transparent);
  }
  .people-compare-period {
    display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 10px 12px;
  }
  .people-compare-period-tabs .seg { min-width: 455px; }
  .people-compare-month-form {
    display: flex; align-items: end; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  }
  .people-compare-month-form .field { min-width: 150px; }
  .people-compare-period.is-custom { align-items: stretch; flex-direction: column; gap: 10px; }
  .people-compare-custom-form {
    display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto;
    align-items: end; gap: 10px; padding-top: 2px;
  }
  .people-compare-range-group {
    min-width: 0; display: grid; gap: 6px; padding: 9px 10px;
    border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--panel2) 74%, transparent);
  }
  .people-compare-range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
  .people-compare-range-inputs .field { min-width: 0; }
  .people-compare-range-inputs .input { width: 100%; min-width: 0; }
  .people-compare-vs-custom { align-self: center; margin: 20px 0 0; }
  .people-compare-custom-form > .btn { min-width: 92px; justify-content: center; }
  .people-compare-vs {
    align-self: center; margin: 0 1px 6px; color: var(--muted); font-size: 9px;
    font-weight: 800; letter-spacing: .09em;
  }

  .people-compare-metrics { overflow: hidden; }
  .people-compare-metrics-title {
    min-height: 54px; padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-bottom: 1px solid var(--line);
  }
  .people-compare-metrics-title h3 { margin: 0; font-size: 14px; letter-spacing: -.01em; }
  .people-compare-metrics-note {
    color: var(--muted); font-size: 10px; font-weight: 650; padding: 5px 8px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); white-space: nowrap;
  }
  .people-compare-table-head,
  .people-compare-metric-row {
    display: grid;
    grid-template-columns: minmax(155px,.66fr) minmax(235px,1.12fr) minmax(235px,1.12fr) minmax(170px,.78fr);
    align-items: stretch;
  }
  .people-compare-table-head {
    min-height: 68px; padding: 0 15px; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel2) 78%, transparent);
  }
  .people-compare-table-head > span {
    min-width: 0; display: flex; align-items: center;
  }
  .people-compare-head-label {
    color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  }
  .people-compare-head-change { justify-content: flex-end; padding-left: 18px; }
  .people-compare-period-head {
    display: grid !important; align-content: center; justify-items: end; gap: 2px;
    padding: 9px 18px; border-left: 1px solid var(--line);
  }
  .people-compare-period-head small {
    color: var(--muted); font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  }
  .people-compare-period-head b {
    color: var(--ink); font-size: 13px; font-weight: 760; text-align: right;
  }
  .people-compare-period-head em {
    color: var(--muted); font-size: 9.5px; font-style: normal; font-weight: 500; text-align: right;
  }
  .people-compare-period-head.is-primary {
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--acc-hi) 4.5%, transparent));
  }
  .people-compare-period-head.is-primary b { color: color-mix(in srgb, var(--acc-hi) 74%, var(--ink)); }

  .people-compare-metric-row {
    min-height: 74px; padding: 0 15px; border-bottom: 1px solid var(--line);
    transition: background .15s ease;
  }
  .people-compare-metric-row:last-child { border-bottom: 0; }
  .people-compare-metric-row:hover { background: color-mix(in srgb, var(--acc-hi) 2.2%, transparent); }
  .people-compare-metric-name {
    display: flex; align-items: center; padding-right: 14px;
    color: var(--muted); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .085em;
  }
  .people-compare-metric-name span { max-width: 135px; }
  .people-compare-metric-value,
  .people-compare-metric-change {
    min-width: 0; display: flex; align-items: center; justify-content: flex-end;
    padding: 10px 18px; border-left: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
  }
  .people-compare-metric-change { padding-right: 0; }
  .people-compare-money-list { width: min(100%, 250px); display: grid; gap: 5px; }
  .people-compare-money-line {
    display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: baseline; gap: 8px;
  }
  .people-compare-money-line strong {
    color: var(--ink); font-size: 15px; font-weight: 760; line-height: 1.25; text-align: right; white-space: nowrap;
  }
  .people-compare-currency {
    color: var(--muted); font-size: 8.5px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase;
  }
  .people-compare-single-value { width: min(100%,250px); text-align: right; }
  .people-compare-number { color: var(--ink); font-size: 17px; font-weight: 760; font-variant-numeric: tabular-nums; }
  .people-compare-deltas { width: min(100%, 165px); display: grid; gap: 5px; }
  .people-compare-deltas-single { display: flex; justify-content: flex-end; }
  .people-compare-delta-line {
    display: grid; grid-template-columns: 31px minmax(82px,auto); align-items: center; justify-content: end; gap: 7px;
  }
  .people-compare-delta-line .people-compare-currency { text-align: right; }
  .people-compare-delta {
    display: inline-flex; align-items: center; justify-content: center; min-width: 82px; min-height: 25px; padding: 4px 8px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--panel2);
    color: var(--muted); font-size: 10px; font-weight: 780; font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .people-compare-delta.is-up { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 26%, var(--line)); background: color-mix(in srgb, var(--ok) 7%, var(--panel2)); }
  .people-compare-delta.is-down { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 24%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--panel2)); }
  .people-compare-delta.is-new { color: var(--acc-hi); border-color: color-mix(in srgb, var(--acc-hi) 28%, var(--line)); background: color-mix(in srgb, var(--acc-hi) 7%, var(--panel2)); }
  .people-compare-delta.is-flat { color: var(--muted); }

  .people-compare-evolution { padding: 13px 15px 11px; }
  .people-compare-evolution-head {
    display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 8px;
  }
  .people-compare-evolution-head h3 { margin: 0; font-size: 14px; }
  .people-compare-evolution-head .seg { min-width: 210px; }
  .people-compare-chart-wrap { display: grid; gap: 8px; }
  .people-compare-chart {
    height: 142px; display: flex; align-items: end; justify-content: center; gap: clamp(18px,4vw,52px);
    padding: 8px 12px 0; border-bottom: 1px solid var(--line);
    background-image: linear-gradient(to top, transparent 24%, color-mix(in srgb, var(--line) 55%, transparent) 25%, transparent 26%, transparent 49%, color-mix(in srgb, var(--line) 55%, transparent) 50%, transparent 51%, transparent 74%, color-mix(in srgb, var(--line) 55%, transparent) 75%, transparent 76%);
  }
  .people-compare-chart.is-short { height: 118px; }
  .people-compare-chart-group { height: 100%; min-width: 50px; display: grid; grid-template-rows: minmax(0,1fr) 18px; align-items: end; justify-items: center; }
  .people-compare-bars { height: 100%; display: flex; align-items: end; gap: 6px; }
  .people-compare-bar {
    width: 14px; min-height: 2px; border-radius: 5px 5px 2px 2px;
    transition: height .2s ease, opacity .15s ease;
  }
  .people-compare-bar.is-a { background: linear-gradient(180deg, #b28cff, #7448e8); box-shadow: 0 5px 15px rgba(125,82,235,.13); }
  .people-compare-bar.is-b { background: color-mix(in srgb, var(--muted) 56%, var(--panel2)); opacity: .66; }
  .people-compare-chart-group > small { color: var(--muted); font-size: 9px; font-weight: 650; }
  .people-compare-chart-legend { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
  .people-compare-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .people-compare-chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
  .people-compare-chart-legend i.is-a { background: #9466f5; }
  .people-compare-chart-legend i.is-b { background: color-mix(in srgb, var(--muted) 58%, var(--panel2)); }
  .people-compare-empty { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }

@media (max-width: 1120px) and (min-width: 761px) {
  .people-compare-table-head,
  .people-compare-metric-row { grid-template-columns: minmax(125px,.55fr) minmax(190px,1fr) minmax(190px,1fr) minmax(145px,.72fr); }
  .people-compare-period-head,
  .people-compare-metric-value { padding-left: 12px; padding-right: 12px; }
  .people-compare-money-line strong { font-size: 14px; }
  .people-list-toolbar { grid-template-columns: 1fr; align-items: stretch; gap: 10px; }
  .people-list-controls { grid-template-columns: minmax(0,1fr) minmax(210px,280px); }
}

  /* ---- perfil de modelo: información operativa sin duplicar administración ---- */
  .model-access-summary { overflow: hidden; }
  .model-access-head { align-items: center; margin-bottom: 12px; }
  .model-access-head > div:first-child { min-width: 0; }
  .model-access-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .model-access-chip {
    display: inline-grid; gap: 2px; min-width: 150px; padding: 8px 11px;
    border: 1px solid var(--line); border-radius: 11px; background: var(--panel2);
  }
  .model-access-chip b { font-size: 12.5px; color: var(--ink); }
  .model-access-chip small { font-size: 10.5px; color: var(--muted); }
  .model-access-empty {
    padding: 12px; border: 1px dashed var(--line); border-radius: 10px;
    color: var(--muted); font-size: 12px; text-align: center;
  }

  /* Estructura plegable reutilizada por Equipos. */
  .people-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .people-stack { display: grid; gap: 10px; }
  .people-section { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; overflow: clip; }
  .people-section > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center;
    justify-content: space-between; gap: 12px; padding: 12px 14px;
  }
  .people-section > summary::-webkit-details-marker { display: none; }
  .people-section > summary > span:first-child { display: grid; gap: 2px; min-width: 0; }
  .people-section > summary b { font-size: 15px; }
  .people-section > summary small { color: var(--muted); font-size: 11.5px; font-weight: 400; }
  .people-section > summary::after {
    content: "+"; flex: 0 0 auto; color: var(--muted); font-size: 18px;
    line-height: 1; margin-left: 2px;
  }
  .people-section[open] > summary::after { content: "−"; }
  .people-section[open] > summary { border-bottom: 1px solid var(--line); }
  .people-section-body { padding: 12px; }
  .team-actions { margin-bottom: 10px; }

  /* ---- equipos: estructura primero, administración después ---- */
  .teams-overview {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end;
    padding: 16px 18px; margin-bottom: 10px; border: 1px solid var(--line);
    border-radius: 14px; background: var(--panel);
  }
  .teams-overview h2 { margin: 0 0 5px; font-size: 17px; }
  .teams-overview p { margin: 0; max-width: 760px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .teams-summary { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
  .teams-summary > span {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 99px; background: var(--panel2);
    color: var(--muted); font-size: 11.5px; white-space: nowrap;
  }
  .teams-summary > span.warn { border-color: rgba(245, 158, 11, .38); }
  .teams-summary b { color: var(--ink); font-size: 13px; }
  .teams-context-note { margin-bottom: 10px; }
  .team-create { margin-bottom: 10px; }
  .team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 10px; margin-bottom: 10px; align-items: start; }
  .team-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: clip; min-width: 0; align-self: start; }
  .team-card > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 14px 15px; min-height: 76px;
  }
  .team-card > summary::-webkit-details-marker { display: none; }
  .team-card[open] > summary { border-bottom: 1px solid var(--line); }
  .team-card-heading { display: grid; gap: 6px; min-width: 0; }
  .team-card-heading > small { color: var(--muted); font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; }
  .team-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
  .team-card-title > b { font-size: 15px; }
  .team-count {
    display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--panel2); color: var(--muted); font-size: 10.5px;
  }
  .team-card-open { color: var(--accent); font-size: 11.5px; white-space: nowrap; }
  .team-card[open] .team-card-open { color: var(--muted); }
  .team-card[open] .team-card-open::before { content: "Ocultar "; }
  .team-card[open] .team-card-open { font-size: 0; }
  .team-card[open] .team-card-open::after { content: "Ocultar"; font-size: 11.5px; }
  .team-card-unassigned { border-color: rgba(245, 158, 11, .34); }
  .team-card-body { padding: 12px; }
  .team-members-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .team-member-panel { border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); overflow: hidden; min-width: 0; }
  .team-member-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
  .team-member-head b { font-size: 12.5px; }
  .team-member-head span { color: var(--muted); font-size: 11px; }
  .team-member-list { display: grid; }
  .team-member-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px;
    border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
  }
  .team-member-row:last-child { border-bottom: 0; }
  .team-member-row:hover { background: rgba(255,255,255,.02); }
  .team-member-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
  .team-member-row b { font-size: 12.5px; }
  .team-member-row small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
  .team-empty { padding: 16px 10px; color: var(--muted); font-size: 11.5px; text-align: center; }
  .teams-secondary { margin-top: 10px; }
  .team-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .team-move-card { display: grid; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); }
  .team-move-copy { display: grid; gap: 3px; }
  .team-move-copy h3 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.01em; color: var(--text); }
  .team-move-copy small { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
  .team-move-form { display: grid; gap: 9px; align-content: start; }
  .team-move-form .field { min-width: 0; }
  .team-move-form .btn { justify-self: start; }
  .team-history, .team-maintenance { margin-top: 0; }

  /* ---- asignaciones centralizadas de chatters y modelos ---- */
  .assignment-shell { padding: 14px; display: grid; gap: 14px; }
  .assignment-selector {
    display: flex; align-items: end; justify-content: space-between; gap: 18px;
    padding-bottom: 12px; border-bottom: 1px solid var(--line);
  }
  .assignment-selector > div:first-child { display: grid; gap: 3px; }
  .assignment-selector > div:first-child > b { font-size: 15px; }
  .assignment-selector > div:first-child > small { color: var(--muted); font-size: 11.5px; }
  .assignment-selector .field { min-width: min(360px, 42vw); }
  .assignment-note { margin: 0; }
  .assignment-summary-card {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
  .assignment-summary-card > div {
    display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: 11px; background: var(--panel2);
  }
  .assignment-summary-card > div > b { font-size: 16px; }
  .assignment-summary-card > div > small { color: var(--muted); font-size: 11.5px; }
  .assignment-manager {
    display: grid; gap: 13px; padding: 14px; border: 1px solid var(--line2);
    border-radius: 12px; background: var(--panel2);
  }
  .assignment-manager-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
  .assignment-manager-head h2 { margin: 0 0 4px; font-size: 16px; }
  .assignment-manager-head p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
  .assignment-quick-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
  .assignment-model-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px 12px; padding: 10px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--panel);
  }
  .assignment-model-check { align-items: flex-start; min-height: 40px; }
  .assignment-model-check > span { display: grid; gap: 1px; }
  .assignment-model-check small { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
  .assignment-manager-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .assignment-manager-footer .muted { font-size: 11.5px; }
  .chatter-access-summary .people-actions { align-items: center; }

  /* ---- gestión central de servicios ---- */
  .service-bulk-form {
    display: grid; gap: 12px; padding: 14px; margin-bottom: 18px;
    background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px;
  }
  .service-bulk-form > .field { max-width: 420px; }
  .service-models-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap;
  }
  .service-model-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 14px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  }
  .service-subsection { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin: 20px 0 9px; }
  .service-subsection .muted { font-size: 12px; }
  .service-chip-list { display: flex; gap: 6px; flex-wrap: wrap; min-width: 260px; }
  .service-manage-list { display: grid; gap: 8px; }
  .service-manage-item { border: 1px solid var(--line); border-radius: 11px; background: var(--panel2); }
  .service-manage-item > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 10px 12px;
  }
  .service-manage-item > summary::-webkit-details-marker { display: none; }
  .service-manage-item > summary span:first-child { display: grid; }
  .service-manage-item > summary small { color: var(--muted); font-size: 11.5px; font-weight: 400; }
  .service-manage-item form { display: grid; gap: 11px; padding: 0 12px 13px; }

  /* ---- servicios: catálogo separado de rendimiento ---- */
  .services-overview {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end;
    padding: 16px 18px; margin-bottom: 10px; border: 1px solid var(--line);
    border-radius: 14px; background: var(--panel);
  }
  .services-overview h2 { margin: 0 0 5px; font-size: 17px; }
  .services-overview p { margin: 0; max-width: 760px; color: var(--muted); font-size: 12px; line-height: 1.5; }
  .services-summary { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
  .services-summary > span {
    display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 99px; background: var(--panel2);
    color: var(--muted); font-size: 11.5px; white-space: nowrap;
  }
  .services-summary b { color: var(--ink); font-size: 13px; }
  .service-tabs { display: flex; justify-content: flex-start; margin: 0 0 10px; }
  .services-catalog-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 4px 0 10px; }
  .services-catalog-head h3 { margin: 0 0 2px; font-size: 14px; }
  .services-catalog-head .muted { font-size: 11.5px; }
  .service-create { margin-bottom: 10px; }
  .service-create-form { display: grid; gap: 12px; }
  .service-name-field { max-width: 420px; }
  .service-catalog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; align-items: start; margin-bottom: 10px; }
  .service-catalog-card { border: 1px solid var(--line); border-radius: 13px; background: var(--panel); overflow: clip; min-width: 0; align-self: start; }
  .service-catalog-card > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 13px 14px; min-height: 72px;
  }
  .service-catalog-card > summary::-webkit-details-marker { display: none; }
  .service-catalog-card[open] > summary { border-bottom: 1px solid var(--line); }
  .service-card-heading { display: grid; gap: 5px; min-width: 0; }
  .service-card-heading > small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
  .service-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
  .service-card-title b { font-size: 14px; }
  .service-card-open { color: var(--accent); font-size: 11.5px; white-space: nowrap; }
  .service-catalog-card[open] .service-card-open { font-size: 0; color: var(--muted); }
  .service-catalog-card[open] .service-card-open::after { content: "Ocultar"; font-size: 11.5px; }
  .service-card-form { display: grid; gap: 11px; padding: 12px 13px 13px; }
.service-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.service-card-actions .management-delete { margin-left: auto; }
  .service-model-summary { margin-top: 10px; }
  .service-performance-card { margin-bottom: 10px; }
  .service-ranking-card { margin-bottom: 0; }
  .service-filter-summary { font-size: 12px; margin-top: 10px; }

  @media (max-width: 760px) {
    .dashboard-filtros, .dashboard-filtros .filtros { align-items: stretch; }
    .dashboard-filtros .seg { width: 100%; overflow-x: auto; }
    .dashboard-filtros .seg a { white-space: nowrap; flex: 1; text-align: center; }
    .dashboard-filtros .filtros { width: 100%; margin-left: 0; }
    .dashboard-filtros .field { flex: 1 1 140px; }
    .dashboard-chart-head .seg { width: 100%; overflow-x: auto; }
    .dashboard-chart-head .seg a { flex: 1; text-align: center; }
    .liq-page-head, .liq-section-toolbar { align-items: stretch; }
    .liq-page-head .seg { width: 100%; overflow-x: auto; }
    .liq-page-head .seg a { flex: 1; text-align: center; }
    .liq-section-toolbar .field { width: 100%; min-width: 0 !important; }
    .liq-section > summary { align-items: flex-start; flex-wrap: wrap; }
    .liq-model-row { grid-template-columns: 1fr; }
    .liq-model-actions, .liq-action-group { justify-content: flex-start; }
    .liq-inline-summary { gap: 6px; }
    .people-overview { grid-template-columns: 1fr; align-items: stretch; }
    .people-summary { justify-content: flex-start; }
    .people-tabs .seg { width: 100%; min-width: 0; }
    .people-tabs .seg a { flex: 1; text-align: center; }
    .people-navigation { align-items: stretch; flex-direction: column; gap: 7px; }
    .people-mode-tabs .seg { width: 100%; min-width: 0; }
    .people-mode-tabs .seg a { flex: 1; text-align: center; }
    .people-compare-top { grid-template-columns: 1fr; align-items: stretch; gap: 10px; padding: 13px; }
    .people-compare-period { align-items: stretch; flex-direction: column; }
    .people-compare-period-tabs .seg { width: 100%; min-width: 0; overflow-x: auto; }
    .people-compare-period-tabs .seg a { flex: 1; text-align: center; white-space: nowrap; }
    .people-compare-month-form { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
    .people-compare-month-form .field { min-width: 0; }
    .people-compare-month-form .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
    .people-compare-custom-form { grid-template-columns: 1fr; gap: 8px; }
    .people-compare-range-inputs { grid-template-columns: 1fr 1fr; }
    .people-compare-vs-custom { display: none; }
    .people-compare-custom-form > .btn { width: 100%; justify-content: center; }
    .people-compare-metrics-title { padding: 10px 12px; }
    .people-compare-metrics-note { display: none; }
    .people-compare-table-head {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; padding: 9px 10px;
      background: color-mix(in srgb, var(--panel2) 50%, transparent);
    }
    .people-compare-table-head .people-compare-head-label { display: none; }
    .people-compare-period-head {
      min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2);
      justify-items: start;
    }
    .people-compare-period-head b,
    .people-compare-period-head em { text-align: left; }
    .people-compare-metric-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 11px 10px; }
    .people-compare-metric-name { grid-column: 1 / -1; padding: 0 0 1px; }
    .people-compare-metric-name span { max-width: none; }
    .people-compare-metric-value {
      padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); justify-content: stretch;
    }
    .people-compare-money-list,
    .people-compare-single-value { width: 100%; }
    .people-compare-money-line strong { font-size: 13.5px; }
    .people-compare-metric-change {
      grid-column: 1 / -1; padding: 8px 0 0; border-left: 0; justify-content: flex-start;
    }
    .people-compare-deltas { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
    .people-compare-delta-line { display: inline-flex; align-items: center; gap: 5px; }
    .people-compare-delta-line .people-compare-currency { text-align: left; }
    .people-compare-evolution-head { align-items: stretch; flex-direction: column; }
    .people-compare-evolution-head .seg { width: 100%; min-width: 0; }
    .people-compare-evolution-head .seg a { flex: 1; text-align: center; }
    .people-compare-chart { height: 126px; gap: clamp(9px,5vw,24px); }
    .people-compare-chart.is-short { height: 108px; }
    .people-list-toolbar { grid-template-columns: 1fr; align-items: stretch; gap: 11px; }
    .people-list-controls { grid-template-columns: 1fr; align-items: stretch; gap: 9px; }
    .people-team-filter { padding-bottom: 5px; }
    .people-search { width: 100%; }
    .people-model-row-admin, .people-model-row-basic, .people-model-row-chatter-view, .people-chatter-row { grid-template-columns: minmax(0,1fr) auto; }
    .people-model-row-admin .people-cell, .people-model-row-basic .people-cell, .people-chatter-row .people-cell { grid-column: 1 / 2; }
    .people-row-action { grid-column: 2; grid-row: 1; align-self: start; }
    .people-create-form { align-items: stretch; }
    .people-create-form .field, .people-create-form .people-percent-field { flex: 1 1 100%; min-width: 0; }
    .people-head { grid-template-columns: 1fr; }
    .people-actions { justify-content: flex-start; }
    .people-section > summary { align-items: flex-start; flex-wrap: wrap; }
    .teams-overview { grid-template-columns: 1fr; align-items: stretch; }
    .teams-summary { justify-content: flex-start; }
    .team-grid { grid-template-columns: 1fr; }
    .services-overview { grid-template-columns: 1fr; align-items: stretch; }
    .services-summary { justify-content: flex-start; }
    .service-catalog-grid { grid-template-columns: 1fr; }
    .team-card > summary { align-items: flex-start; }
    .team-members-grid, .team-admin-grid { grid-template-columns: 1fr; }
  }

  /* ---- ranking ---- */
  .rk { display: grid; gap: 7px; }
  .rk-row {
    display: grid;
    grid-template-columns: 22px minmax(80px, 1fr) minmax(34px, 90px) minmax(175px, 48%);
    align-items: center;
    gap: 10px;
    font-size: 13px;
  }
  .rk-pos {
    width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
    background: var(--panel2); border: 1px solid var(--line2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--muted);
  }
  .rk-row:first-child .rk-pos { background: var(--acc-soft); border-color: rgba(77,125,254,.4); color: var(--acc-hi); }
  .rk-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rk-nm a { text-decoration: none; }
  .rk-nm a:hover { text-decoration: underline; }
  .rk-bar { height: 5px; border-radius: 99px; background: linear-gradient(90deg, #5d89ff, #3d63d8); min-width: 3px; }
  .rk-row .currency-values { width: 100%; }
  .rk-row-simple { grid-template-columns: minmax(100px, 1fr) auto minmax(175px, 48%); }

  @media (max-width: 620px) {
    .rk-row { grid-template-columns: 22px minmax(80px, 1fr) minmax(30px, 70px); }
    .rk-row .currency-values { grid-column: 2 / -1; justify-content: flex-start; width: auto; }
    .rk-row-simple { grid-template-columns: minmax(100px, 1fr) auto; }
    .rk-row-simple .currency-values { grid-column: 1 / -1; }
  }

  /* ---- cortina de introducción ---- */
  .intro { position: fixed; inset: 0; z-index: 60; overflow: hidden; }
  .intro .half {
    position: absolute; top: 0; bottom: 0; width: 50.35%;
    background: linear-gradient(160deg, #0d1119 0%, #0a0d13 70%);
    transition: transform 0.68s cubic-bezier(0.72, 0, 0.3, 1);
  }
  .intro .half.l { left: 0; border-right: 1px solid rgba(77, 125, 254, 0.28); box-shadow: 18px 0 48px rgba(77, 125, 254, 0.1); }
  .intro .half.r { right: 0; }
  .intro.open .half.l { transform: translateX(-102%); }
  .intro.open .half.r { transform: translateX(102%); }
  .intro-content {
    position: relative; z-index: 1; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 13px; text-align: center; padding: 24px;
    transition: opacity 0.22s ease-out;
  }
  .intro.open .intro-content { opacity: 0; pointer-events: none; }
  .logo.xl { width: 62px; height: 62px; border-radius: 17px; font-size: 22px; animation: glowpulse 3.2s ease-in-out infinite alternate; }
  @keyframes glowpulse {
    from { box-shadow: 0 6px 22px rgba(77, 125, 254, 0.3); }
    to { box-shadow: 0 6px 42px rgba(77, 125, 254, 0.55); }
  }
  .intro-content .sub { color: var(--acc-hi); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
  .intro-content h1 { font-size: 30px; }
  .intro-content p { color: var(--muted); font-size: 14px; max-width: 44ch; margin: 0; }
  .btn.grande { padding: 12px 26px; font-size: 14.5px; border-radius: 12px; margin-top: 8px; }
  .intro-nota { font-size: 11.5px; color: var(--faint); margin-top: 10px; }

  /* ---- acceso por rol ---- */
  .acceso-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 18px; }
  .acceso-box { width: 100%; max-width: 760px; }
  .acceso-head { text-align: center; margin-bottom: 26px; }
  .acceso-head .sub { color: var(--acc-hi); font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
  .rol-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
  .rol-card {
    appearance: none; cursor: pointer; font: inherit; text-align: left; color: var(--ink);
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
    transition: border-color 0.12s, transform 0.1s, background 0.12s;
  }
  .rol-card:hover { border-color: var(--acc); background: var(--panel2); transform: translateY(-1px); }
  .rol-card:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
  .rol-ic {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--acc-soft); color: var(--acc-hi);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .rol-card b { font-size: 14.5px; }
  .rol-card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
  .rol-n { font-size: 10.5px; color: var(--faint); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
  .volver { margin-bottom: 14px; }
  .paso-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
  .cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
  .persona-card {
    display: flex; align-items: center; gap: 10px; text-align: left;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    padding: 11px 13px; cursor: pointer; color: var(--ink); font: inherit; width: 100%;
  }
  .persona-card:hover { border-color: var(--acc); background: var(--panel2); }
  .persona-card b { display: block; font-size: 13.5px; }
  .persona-card span { font-size: 11.5px; color: var(--faint); }
  .acceso-nota { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; }

  /* ---- login real (email + contraseña) ---- */
  body:has(.login) {
    background: #06080e;
    overflow-x: hidden;
  }
  body:has(.login) .banner-demo { display: none; }
  .login {
    --login-accent: #8b5cf6;
    --login-accent-hi: #c7afff;
    --login-accent-deep: #6032d7;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(30px, 5vh, 64px) 20px;
    background:
      radial-gradient(820px 500px at 50% 42%, rgba(126, 71, 237, .18), transparent 67%),
      radial-gradient(700px 360px at 50% 76%, rgba(69, 52, 161, .09), transparent 74%),
      linear-gradient(180deg, #090c13 0%, #06090f 62%, #070a10 100%);
  }
  .login::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: .12;
    background-image:
      linear-gradient(rgba(170, 140, 255, .045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(170, 140, 255, .045) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(circle at center, #000 0%, rgba(0,0,0,.65) 34%, transparent 74%);
    mask-image: radial-gradient(circle at center, #000 0%, rgba(0,0,0,.65) 34%, transparent 74%);
  }
  .login::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: min(760px, 72vw);
    height: 310px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -58%);
    border-radius: 50%;
    background: rgba(119, 65, 231, .13);
    filter: blur(78px);
    pointer-events: none;
  }
  .login-card {
    width: min(470px, calc(100vw - 36px));
    position: relative;
    padding: 42px 38px 30px;
    border: 1px solid rgba(175, 145, 255, .18);
    border-radius: 26px;
    background:
      linear-gradient(180deg, rgba(20, 22, 34, .88), rgba(11, 14, 23, .84));
    box-shadow:
      0 34px 110px rgba(0, 0, 0, .52),
      0 0 90px rgba(115, 67, 225, .10),
      inset 0 1px 0 rgba(255, 255, 255, .045);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
      linear-gradient(135deg, rgba(196, 174, 255, .06), transparent 31%, transparent 73%, rgba(111, 77, 219, .035));
  }
  .login-card::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 17%;
    right: 17%;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(183, 144, 255, .72), transparent);
    box-shadow: 0 0 18px rgba(139, 92, 246, .42);
  }
  .login-head {
    position: relative;
    text-align: center;
    margin-bottom: 32px;
  }
  .login-head .login-mark {
    display: block;
    width: min(340px, 94%);
    height: auto;
    margin: 0 auto 23px;
    filter:
      drop-shadow(0 10px 28px rgba(111, 53, 232, .38))
      drop-shadow(0 0 25px rgba(166, 111, 255, .22));
  }
  .login-head .sub {
    display: inline-block;
    color: var(--login-accent-hi);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .22em;
    line-height: 1;
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .login-head h1 {
    color: #f6f3fc;
    font-size: clamp(25px, 2vw, 29px);
    line-height: 1.16;
    letter-spacing: -.03em;
    margin: 0;
  }
  .login-head p {
    color: #9ea6ba;
    font-size: 13.5px;
    line-height: 1.6;
    margin: 11px 0 0;
  }
  .login-form {
    position: relative;
    display: grid;
    gap: 17px;
  }
  .login-field { gap: 8px; }
  .login-field .lbl {
    color: #7d8599;
    font-size: 10.25px;
    font-weight: 750;
    letter-spacing: .12em;
  }
  .login-field .input {
    min-height: 50px;
    border: 1px solid rgba(132, 121, 166, .35);
    border-radius: 12px;
    background: rgba(17, 21, 33, .92);
    color: #f0f2f8;
    padding: 11px 14px;
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
  }
  .login-field .input::placeholder { color: #60697c; }
  .login-field .input:hover { border-color: rgba(164, 132, 244, .50); }
  .login-field .input:focus {
    outline: none;
    border-color: #9b6bff;
    background: rgba(20, 23, 37, .98);
    box-shadow:
      0 0 0 3px rgba(139, 92, 246, .13),
      0 0 28px rgba(111, 66, 211, .10);
  }
  .login-error {
    margin: -2px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(240, 101, 90, .30);
    border-radius: 11px;
    background: rgba(240, 101, 90, .08);
    color: #ff948c;
    font-size: 12px;
    line-height: 1.45;
  }
  .login-submit {
    min-height: 50px;
    justify-content: center;
    border: 1px solid rgba(220, 205, 255, .16);
    border-radius: 12px;
    background: linear-gradient(135deg, #9a63f7 0%, #7d4be8 48%, #6235d3 100%);
    color: #fff;
    font-weight: 800;
    letter-spacing: .01em;
    box-shadow:
      0 14px 32px rgba(92, 51, 205, .30),
      inset 0 1px 0 rgba(255, 255, 255, .15);
    transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
  }
  .login-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow:
      0 18px 38px rgba(92, 51, 205, .36),
      0 0 30px rgba(139, 92, 246, .14),
      inset 0 1px 0 rgba(255, 255, 255, .16);
  }
  .login-submit:focus-visible {
    outline: 2px solid rgba(199, 175, 255, .88);
    outline-offset: 3px;
  }
  .login-submit:active { transform: translateY(0); }
  .login-security {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 23px;
    padding-top: 19px;
    border-top: 1px solid rgba(146, 126, 195, .14);
    color: #727b8f;
    font-size: 10.75px;
    text-align: center;
  }
  .login-security-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #a16cff;
    box-shadow: 0 0 13px rgba(139, 92, 246, .78);
  }
  .login-foot { text-align: center; margin-top: 16px; }
  .login-cuentas { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
  .login-cuentas .grp { margin-bottom: 12px; }
  .login-cuentas .grp:last-child { margin-bottom: 0; }
  .login-cuentas .lbl { display: block; margin-bottom: 7px; }
  .login-chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .chip-user {
    appearance: none; cursor: pointer; font: inherit; color: var(--ink);
    background: var(--panel2); border: 1px solid var(--line2); border-radius: 99px;
    padding: 5px 12px; font-size: 12.5px; transition: border-color 0.12s, background 0.12s;
  }
  .chip-user:hover { border-color: var(--acc); background: var(--acc-soft); }

  @media (max-width: 720px) {
    .login {
      align-items: center;
      padding: 28px 16px;
      background:
        radial-gradient(520px 360px at 50% 39%, rgba(126, 71, 237, .17), transparent 70%),
        linear-gradient(180deg, #090c13 0%, #06090f 100%);
    }
    .login::before { opacity: .08; background-size: 40px 40px; }
    .login::after { width: 92vw; height: 250px; filter: blur(64px); }
    .login-card {
      width: min(470px, calc(100vw - 28px));
      padding: 36px 28px 27px;
      border-radius: 23px;
    }
    .login-head { margin-bottom: 28px; }
    .login-head .login-mark { width: min(320px, 94%); margin-bottom: 21px; }
  }

  @media (max-width: 520px) {
    .login { padding: 18px 12px; }
    .login-card {
      width: 100%;
      padding: 30px 20px 22px;
      border-radius: 20px;
    }
    .login-head { margin-bottom: 25px; }
    .login-head .login-mark { width: min(285px, 92%); margin-bottom: 18px; }
    .login-head h1 { font-size: 24px; }
    .login-head p { font-size: 13px; }
    .login-field .input, .login-submit { min-height: 49px; }
    .login-security { font-size: 10.25px; margin-top: 20px; padding-top: 16px; }
  }

  @media (max-height: 680px) and (min-width: 521px) {
    .login { padding-top: 22px; padding-bottom: 22px; }
    .login-card { padding-top: 30px; padding-bottom: 24px; }
    .login-head { margin-bottom: 22px; }
    .login-head .login-mark { width: min(285px, 88%); margin-bottom: 16px; }
    .login-form { gap: 13px; }
    .login-security { margin-top: 17px; padding-top: 14px; }
  }

  /* ---- carga rápida por modelo (Ventas, vista chatter) ---- */
  .qm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 22px; }
  .qm-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; display: flex; flex-direction: column; gap: 9px; }
  .qm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .qm-head b { font-size: 13.5px; }
  .qm-form { display: grid; grid-template-columns: 1fr 78px; gap: 7px; }
  .qm-form select, .qm-form input { font-size: 12.5px; padding: 7px 8px; }
  .qm-form button { padding: 7px; font-size: 12.5px; }

  /* ---- pestañas por modelo (historial de Ventas, vista chatter) ---- */

  /* ---- administración de usuarios ---- */
  .admin-users-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
  }
  .admin-create-card { margin-bottom: 18px; }
  .admin-create-grid {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(230px, 1.4fr) minmax(170px, 1fr) minmax(140px, .8fr) auto;
    gap: 10px;
    align-items: end;
  }
  .admin-create-submit { justify-content: center; min-height: 38px; }
  .admin-directory-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: var(--panel2);
    border: 1px solid var(--line2);
    border-radius: 12px;
  }
  .admin-role-tabs { overflow-x: auto; padding-bottom: 1px; }
  .admin-role-tabs .seg { min-width: max-content; }
  .admin-search-field { flex: 1 1 280px; min-width: 240px; }
  .admin-user-name { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
  .admin-user-email { font-size: 11.5px; margin-top: 3px; white-space: nowrap; }
  .admin-users-table td { vertical-align: middle; }
  .admin-row-actions { min-width: 108px; }
  .admin-row-actions summary { list-style: none; display: inline-flex; cursor: pointer; }
  .admin-row-actions summary::-webkit-details-marker { display: none; }
  .admin-row-actions[open] summary { border-color: var(--acc); color: var(--acc-hi); }
  .admin-row-actions-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 320px;
    margin-top: 8px;
    padding: 8px;
    background: var(--panel2);
    border: 1px solid var(--line2);
    border-radius: 9px;
  }

  /* ---- checklist de cierre ---- */
  .chk-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; padding: 3px 0; }
  .chk-row input { accent-color: var(--acc); width: 15px; height: 15px; }

  /* ---- modales ---- */
  .mback {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(5, 7, 11, 0.74);
    display: flex; align-items: center; justify-content: center; padding: 20px;
  }
  .modal {
    background: var(--panel); border: 1px solid var(--line2); border-radius: 16px;
    width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
    padding: 20px 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
  .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .modal-head h2 { font-size: 16px; }
  .modal-head .x { appearance: none; border: none; background: none; color: var(--faint); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 6px; }
  .modal-head .x:hover { color: var(--ink); }

  /* ---- toast ---- */
  .toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    background: #1c2436; color: var(--ink); border: 1px solid var(--line2);
    font-weight: 600; font-size: 13px;
    padding: 9px 16px; border-radius: 99px; z-index: 90;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .toast.bad { background: var(--bad); border-color: var(--bad); color: #fff; }

  .banner-demo {
    background: var(--warn-soft); border-bottom: 1px solid rgba(232,181,77,.35);
    color: var(--warn); font-size: 12px; font-weight: 600;
    text-align: center; padding: 6px 10px;
  }

  @media (prefers-reduced-motion: reduce) {
    .intro .half, .intro-content, .toast { transition: none; }
    .logo.xl { animation: none; }
  }

  @media (max-width: 880px) {
    .shell { flex-direction: column; }
    .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 12px; }
    .brand { padding: 0 8px 0 0; }
    .nav-group-label { display: none; }
    .navlink { width: auto; padding: 6px 9px; }
    .navlink span.txt { display: none; }
    .side-foot { margin: 0 0 0 auto; padding: 0; }
    main.page, .top { padding-left: 14px; padding-right: 14px; }
    .grid2 { grid-template-columns: 1fr; }
    .dashboard-gastos-head { align-items: stretch; }
    .dashboard-gastos-mes { width: 100%; }
    .dashboard-gastos-mes .field { flex: 1; min-width: 0; }
    .dashboard-gasto-form { grid-template-columns: 1fr 1fr; }
    .dashboard-gasto-form .dashboard-gasto-obs { grid-column: 1 / -1; }
    .dashboard-gasto-form .btn { justify-content: center; }
    .admin-users-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-create-submit { width: 100%; }
  }

  @media (max-width: 560px) {
    .admin-users-summary, .admin-create-grid { grid-template-columns: 1fr; }
    .admin-search-field { min-width: 100%; }
    .admin-directory-filters .filtros { align-items: stretch; }
    .admin-directory-filters .field, .admin-directory-filters .btn { width: 100%; }
  }

@media (max-width: 720px) {
  .assignment-selector, .assignment-manager-head, .assignment-manager-footer { align-items: stretch; flex-direction: column; }
  .assignment-selector .field { min-width: 0; width: 100%; }
  .assignment-summary-card { grid-template-columns: 1fr; }
  .assignment-model-grid { grid-template-columns: 1fr; }
  .assignment-quick-actions { justify-content: flex-start; }
  .assignment-manager-footer .btn { width: 100%; justify-content: center; }
}

/* ---- Dashboard chatter: seguimiento de validaciones ---- */
.chatter-validations-head { gap: 14px; }
.chatter-validation-filter {
  margin: 12px 0 2px;
  align-items: end;
}
.chatter-validation-filter .field { min-width: 230px; }
.chatter-validation-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.chatter-validation-stat {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  min-width: 0;
}
.chatter-validation-stat > span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.chatter-validation-stat > strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.chatter-validation-stat > small {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-size: 11px;
}
.chatter-validation-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.chatter-validation-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.35fr) minmax(100px, .6fr) minmax(105px, .6fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.chatter-validation-row:last-child { border-bottom: 0; }
.chatter-validation-row:hover { background: rgba(77,125,254,.035); }
.chatter-validation-sale { min-width: 0; }
.chatter-validation-sale b { display: block; }
.chatter-validation-sale small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chatter-validation-amount { font-weight: 650; }
.chatter-validation-note {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chatter-validation-action { text-align: right; }
.chatter-validation-empty { padding: 22px 14px; text-align: center; color: var(--faint); }

@media (max-width: 900px) {
  .chatter-validation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chatter-validation-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .chatter-validation-amount { grid-column: 1 / 2; }
  .chatter-validation-state { grid-column: 2 / 3; grid-row: 1 / 2; }
  .chatter-validation-note { grid-column: 1 / 3; white-space: normal; }
  .chatter-validation-action { grid-column: 3 / 4; grid-row: 1 / 3; }
}

@media (max-width: 560px) {
  .chatter-validation-filter { align-items: stretch; }
  .chatter-validation-filter .field, .chatter-validation-filter .btn { width: 100%; min-width: 0; }
  .chatter-validation-stats { grid-template-columns: 1fr 1fr; }
  .chatter-validation-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; }
  .chatter-validation-sale { grid-column: 1 / -1; }
  .chatter-validation-amount { grid-column: 1 / 2; }
  .chatter-validation-state { grid-column: 2 / 3; grid-row: 2 / 3; }
  .chatter-validation-note { grid-column: 1 / -1; }
  .chatter-validation-action { grid-column: 1 / -1; grid-row: auto; text-align: left; }
}


/* ---- liquidaciones: selector completo de chatters + histórico por período ---- */
.liq-chatter-empty {
  margin-top: 9px;
  padding: 12px;
  background: var(--panel2);
}
.liq-chatter-empty-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.liq-chatter-empty-head > div {
  display: grid;
  gap: 3px;
}
.liq-chatter-empty-head b { font-size: 13.5px; }
.liq-chatter-empty-head small { color: var(--muted); font-size: 11.5px; }

.liq-history-filter-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel2);
}
.liq-history-filter-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.liq-history-filter-copy b { font-size: 13px; }
.liq-history-filter-copy span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.liq-history-filter {
  margin: 0;
  justify-content: flex-end;
  align-items: end;
}
.liq-history-filter .field { min-width: 145px; }
.liq-history-filter-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  padding-bottom: 1px;
}
.liq-history-placeholder {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 18px 14px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  text-align: center;
  background: rgba(255,255,255,.012);
}
.liq-history-placeholder b { font-size: 13px; }
.liq-history-placeholder span { color: var(--muted); font-size: 11.5px; }
.liq-history-result-head {
  margin: 11px 2px 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.liq-history-periods { display: grid; gap: 9px; }
.liq-history-period {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel2);
}
.liq-history-period > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.liq-history-period > header > div { display: grid; gap: 2px; }
.liq-history-period > header b { font-size: 13px; }
.liq-history-period > header small { color: var(--muted); font-size: 11px; }
.liq-history-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.liq-history-model {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.liq-history-model:hover { background: rgba(77,125,254,.045); }
.liq-history-model > span:first-child { display: grid; gap: 2px; min-width: 0; }
.liq-history-model b { font-size: 12.5px; }
.liq-history-model small { color: var(--muted); font-size: 10.5px; }
.liq-history-model-action {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .liq-history-filter-wrap { grid-template-columns: 1fr; gap: 10px; align-items: stretch; }
  .liq-history-filter { width: 100%; align-items: stretch; }
  .liq-history-filter .field { flex: 1 1 140px; min-width: 0; }
  .liq-history-filter-actions { width: 100%; padding: 0; }
  .liq-history-filter-actions .btn { flex: 1; }
  .liq-history-model-grid { grid-template-columns: 1fr; }
  .liq-chatter-empty-head { align-items: flex-start; }
}

/* Histórico de liquidaciones: consulta explícita por rango, sin lista automática. */
.liq-history-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.liq-history-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}
.liq-history-section-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.liq-history-section-head b { font-size: 14px; }
.liq-history-section-head small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
@media (max-width: 760px) {
  .liq-history-section-head { align-items: flex-start; }
  .liq-history-section-head .chip { display: none; }
}

/* ---- Top compradores ---- */
.navlink.nav-feature {
  margin: 5px 0 7px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding-top: 10px;
  padding-bottom: 10px;
}
.navlink.nav-feature.on {
  border-color: rgba(77, 125, 254, .32);
  border-radius: 9px;
}
.buyers-filter-card { margin-bottom: 14px; }
.buyers-filter-head { margin-bottom: 13px; }
.buyers-filter {
  display: grid;
  grid-template-columns: minmax(165px, .7fr) minmax(220px, 1.25fr) minmax(170px, .7fr) auto;
  gap: 10px;
  align-items: end;
}
.buyers-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.buyers-results { min-width: 0; }
.buyers-results-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: clip;
}
.buyers-results-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
}
.buyers-results-section > summary::-webkit-details-marker,
.buyers-account-card > summary::-webkit-details-marker { display: none; }
.buyers-results-section > summary > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.buyers-results-section > summary b { font-size: 14px; }
.buyers-results-section > summary small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
}
.buyers-results-section > summary::after,
.buyers-account-card > summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  margin-left: 2px;
}
.buyers-results-section[open] > summary::after,
.buyers-account-card[open] > summary::after { content: "−"; }
.buyers-results-section[open] > summary { border-bottom: 1px solid var(--line); }
.buyers-results-body { padding: 10px 12px 12px; }
.buyers-account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.buyers-account-card {
  min-width: 0;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: clip;
}
.buyers-account-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}
.buyers-account-summary-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(120px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 12px;
  flex: 1 1 auto;
}
.buyers-account-summary-main .lbl { grid-row: 1; }
.buyers-account-summary-main h3 {
  margin: 0;
  font-size: 14px;
  grid-row: 1;
}
.buyers-account-summary-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
  grid-row: 1;
}
.buyers-account-summary > .chip { margin-left: auto; }
.buyers-account-card[open] > summary { border-bottom: 1px solid var(--line); }
.buyers-account-body { padding: 2px 12px 11px; }
.buyers-mini-ranking { display: grid; }
.buyers-mini-row {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1fr) minmax(140px, auto);
  gap: 9px;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid var(--line);
}
.buyers-mini-row:first-child { border-top: 0; }
.buyers-rank {
  width: 24px;
  height: 24px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--acc-soft);
  color: var(--acc-hi);
  border: 1px solid rgba(77, 125, 254, .28);
  font-weight: 800;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.buyers-rank.large { width: 28px; height: 28px; font-size: 12px; }
.buyers-mini-name { min-width: 0; display: grid; }
.buyers-mini-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buyers-mini-name span { color: var(--muted); font-size: 11px; }
.buyers-mini-money { min-width: 0; text-align: right; }
.buyers-account-link { margin-top: 8px; }
.buyers-position { width: 56px; }
.buyers-table .currency-values { justify-content: flex-end; }
.buyers-empty { padding: 8px; }

@media (max-width: 900px) {
  .buyers-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buyers-filter .btn { align-self: end; justify-content: center; }
  .buyers-kpis { grid-template-columns: 1fr; }
  .buyers-account-summary-main { grid-template-columns: auto minmax(0, 1fr); }
  .buyers-account-summary-main small { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 620px) {
  .buyers-filter { grid-template-columns: 1fr; }
  .buyers-results-section > summary,
  .buyers-account-summary { align-items: flex-start; }
  .buyers-results-section > summary .chip,
  .buyers-account-summary > .chip { display: none; }
  .buyers-account-summary-main { grid-template-columns: 1fr; gap: 2px; }
  .buyers-account-summary-main .lbl,
  .buyers-account-summary-main h3,
  .buyers-account-summary-main small { grid-column: 1; grid-row: auto; }
  .buyers-mini-row { grid-template-columns: 28px minmax(0, 1fr); padding: 7px 0; }
  .buyers-mini-money { grid-column: 2; text-align: left; }
}


/* Clock-in obligatorio de chatters */
.clockin-gate{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:24px;background:rgba(5,8,14,.70);backdrop-filter:blur(10px) saturate(.78);-webkit-backdrop-filter:blur(10px) saturate(.78)}
.clockin-card{width:min(460px,100%);padding:30px;border:1px solid rgba(111,129,174,.32);border-radius:22px;background:linear-gradient(180deg,rgba(18,24,38,.98),rgba(12,17,28,.99));box-shadow:0 28px 80px rgba(0,0,0,.52),0 0 0 1px rgba(91,117,255,.08) inset;text-align:center}
.clockin-icon{width:58px;height:58px;margin:0 auto 16px;display:grid;place-items:center;border-radius:18px;color:#8ca8ff;background:rgba(80,112,255,.12);border:1px solid rgba(92,124,255,.25)}
.clockin-card .lbl{display:block;margin-bottom:8px;letter-spacing:.12em}
.clockin-card h2{font-size:25px;margin:0 0 8px}
.clockin-card>p{margin:0 auto 20px;max-width:340px;color:var(--muted);font-size:13px;line-height:1.55}
.clockin-time{display:grid;gap:4px;margin:0 0 20px;padding:16px;border-radius:14px;background:rgba(255,255,255,.035);border:1px solid var(--line)}
.clockin-time b{font-size:15px}.clockin-time span{font-size:12px;color:var(--muted)}
.clockin-submit{width:100%;min-height:44px;font-weight:700}
.clockin-logout{margin-top:10px}
.clockin-card>small{display:block;margin-top:14px;color:var(--muted);font-size:11px;line-height:1.5}

/* Actividad de chatters */
.attendance-filter-card{margin-bottom:14px}.attendance-filter{display:grid;grid-template-columns:160px 160px minmax(220px,1fr) auto;gap:10px;align-items:end;margin-top:14px}
.attendance-kpis{margin-bottom:14px}.attendance-section{margin-bottom:12px;overflow:hidden}.attendance-section>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 17px}.attendance-section>summary::-webkit-details-marker{display:none}.attendance-section>summary span:first-child{display:grid;gap:3px}.attendance-section>summary small{font-size:11.5px;color:var(--muted);font-weight:400}.attendance-section>summary:after{content:'−';color:var(--muted);font-size:18px;margin-left:4px}.attendance-section:not([open])>summary:after{content:'+'}.attendance-section-body{border-top:1px solid var(--line);padding:0}.attendance-section .twrap{border:0;border-radius:0}
@media(max-width:900px){.attendance-filter{grid-template-columns:1fr 1fr}.attendance-filter .field:nth-child(3),.attendance-filter .btn{grid-column:1/-1}}
@media(max-width:560px){.clockin-gate{padding:14px}.clockin-card{padding:24px 18px;border-radius:18px}.attendance-filter{grid-template-columns:1fr}.attendance-filter .field,.attendance-filter .btn{grid-column:1!important}.attendance-section>summary{align-items:flex-start}}

/* Actividad de chatters — historial integrado en cada chatter */
.attendance-roster{display:grid;gap:8px;padding:10px;background:rgba(255,255,255,.012)}
.attendance-person{overflow:hidden;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.018);transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}
.attendance-person[open]{border-color:rgba(92,124,255,.28);background:rgba(255,255,255,.026);box-shadow:0 10px 28px rgba(0,0,0,.10)}
.attendance-person>summary{list-style:none;cursor:pointer;padding:0;position:relative}
.attendance-person>summary::-webkit-details-marker{display:none}
.attendance-person>summary:after{content:'›';position:absolute;right:16px;top:50%;transform:translateY(-50%) rotate(90deg);color:var(--muted);font-size:20px;line-height:1;transition:transform .18s ease,color .18s ease}
.attendance-person[open]>summary:after{transform:translateY(-50%) rotate(-90deg);color:var(--ink)}
.attendance-person-grid{display:grid;grid-template-columns:minmax(190px,1.35fr) minmax(190px,1.05fr) minmax(120px,.55fr) minmax(150px,.75fr);align-items:center;gap:18px;padding:14px 46px 14px 15px}
.attendance-person-id{min-width:0;display:grid;gap:3px}.attendance-person-id>b{font-size:13px}.attendance-person-id>span{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attendance-person-metric{display:grid;gap:4px}.attendance-person-metric>span{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.attendance-person-metric .muted{margin-top:1px!important}.attendance-person-metric div>b{font-size:12.5px}.attendance-person-days>b{font-size:16px}
.attendance-person-status{justify-self:start}.attendance-person-history{border-top:1px solid var(--line);padding:12px 15px 14px;background:rgba(5,9,17,.20)}
.attendance-history-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:9px}.attendance-history-head>div{display:grid;gap:2px}.attendance-history-head b{font-size:12px}.attendance-history-head div>span{font-size:10.8px;color:var(--muted)}
.attendance-history-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:9px 11px;border-top:1px solid rgba(120,137,175,.11)}.attendance-history-row:first-of-type{border-top:0}.attendance-history-row>div{display:grid;gap:2px}.attendance-history-row b{font-size:11.8px}.attendance-history-row span{font-size:10.5px;color:var(--muted)}.attendance-history-row>strong{font-size:12px;white-space:nowrap}
.attendance-history-empty{padding:14px 10px;color:var(--muted);font-size:11.5px;text-align:center;border:1px dashed rgba(120,137,175,.18);border-radius:10px}
@media(max-width:900px){.attendance-person-grid{grid-template-columns:1fr 1fr}.attendance-person-status{justify-self:start}.attendance-person-days{justify-self:start}}
@media(max-width:560px){.attendance-roster{padding:7px}.attendance-person-grid{grid-template-columns:1fr;gap:11px;padding:14px 42px 14px 14px}.attendance-person-metric{grid-template-columns:110px 1fr;align-items:center}.attendance-person-metric>span{font-size:9.5px}.attendance-history-head{align-items:flex-start}.attendance-history-row{padding-left:4px;padding-right:4px}}


/* === Theme refresh · identidad violeta corporativa === */
:root {
  --bg: #06080f;
  --panel: rgba(12, 16, 28, 0.90);
  --panel2: rgba(18, 22, 36, 0.96);
  --line: rgba(161, 136, 226, 0.11);
  --line2: rgba(179, 155, 243, 0.22);
  --ink: #f5f2ff;
  --muted: #aaa5c3;
  --faint: #76708f;
  --acc: #8b5cf6;
  --acc-hi: #ceb7ff;
  --acc-soft: rgba(139, 92, 246, 0.16);
}

body {
  background:
    radial-gradient(960px 560px at 78% -10%, rgba(139, 92, 246, 0.16), transparent 62%),
    radial-gradient(760px 420px at 10% 18%, rgba(104, 66, 193, 0.10), transparent 70%),
    linear-gradient(180deg, #090b12 0%, #06080f 100%);
}
body:has(.shell) {
  background: linear-gradient(180deg, #090b12 0%, #06080f 100%);
  overflow-x: hidden;
}
body:has(.shell)::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(188, 160, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(188, 160, 255, 0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.48) 46%, transparent 82%);
  -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.48) 46%, transparent 82%);
  opacity: 0.55;
}
body:has(.shell)::after {
  content: "";
  position: fixed;
  right: max(-120px, -8vw);
  top: 88px;
  width: min(760px, 52vw);
  height: min(760px, 52vw);
  background: url("img/exclusive-agency-mark.png") center / contain no-repeat;
  opacity: 0.055;
  filter: drop-shadow(0 0 42px rgba(139, 92, 246, 0.24)) blur(0.2px);
  transform: rotate(-7deg);
  transform-origin: center;
  pointer-events: none;
  z-index: 0;
  animation: shellBrandFloat 28s ease-in-out infinite;
}

@keyframes shellBrandFloat {
  0%, 100% { transform: rotate(-7deg) translate3d(0, 0, 0) scale(1); }
  50% { transform: rotate(-3deg) translate3d(-2%, 2%, 0) scale(1.025); }
}

@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.shell { position: relative; z-index: 1; }
.side {
  width: var(--sidebar-w);
  position: sticky;
  background: linear-gradient(180deg, rgba(11, 13, 22, 0.94), rgba(8, 10, 18, 0.88));
  border-right: 1px solid rgba(187, 164, 246, 0.16);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03), 18px 0 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.side::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199, 175, 255, 0.34), transparent);
  pointer-events: none;
}
.brand {
  padding-bottom: 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.brand-mark {
  filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.55));
}
.brand-t b { font-size: 13.5px; }
.brand-t span { color: #b1abc9; }
.logo {
  background: linear-gradient(135deg, #9c73ff 0%, #7b49e8 56%, #592ac4 100%);
  box-shadow: 0 8px 24px rgba(111, 53, 232, 0.30);
}
.nav-group-label {
  color: rgba(205, 188, 255, 0.72);
  border-top-color: rgba(255, 255, 255, 0.05);
}
.navlink {
  position: relative;
  color: #a7a0c0;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.navlink:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(173, 147, 237, 0.14);
  transform: translateX(1px);
}
.navlink.on {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(86, 54, 180, 0.14));
  border-color: rgba(184, 162, 247, 0.26);
  box-shadow: 0 10px 24px rgba(77, 31, 145, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.navlink.on::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d8c4ff, #8b5cf6);
}
.navlink.on svg {
  color: var(--acc-hi);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.32));
}
.side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.content {
  position: relative;
  isolation: isolate;
}
.content::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 300px at 76% 0%, rgba(117, 74, 226, 0.08), transparent 72%),
    radial-gradient(420px 240px at 18% 18%, rgba(110, 76, 196, 0.05), transparent 76%);
  pointer-events: none;
  z-index: -1;
}
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: 16px;
  padding-bottom: 16px;
  background: rgba(8, 10, 18, 0.72);
  border-bottom: 1px solid rgba(179, 155, 243, 0.10);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
h1 { font-size: 22px; }
.av {
  background: rgba(139, 92, 246, 0.12);
  color: var(--acc-hi);
  border-color: rgba(172, 146, 241, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 0 20px rgba(139, 92, 246, 0.16);
}
.page {
  position: relative;
  padding-top: 26px;
}
.page > * { animation: pageFadeUp 0.24s ease both; }
.page > *:nth-child(2) { animation-delay: 0.03s; }
.page > *:nth-child(3) { animation-delay: 0.06s; }
.page > *:nth-child(4) { animation-delay: 0.09s; }

.card,
.kpi,
.twrap,
.note,
.rol-card,
.people-create,
.people-section,
.team-card,
.service-catalog-card,
.buyers-results-section,
.buyers-account-card,
.liq-section,
.liq-subsection,
.dashboard-gastos-gestion,
.attendance-section {
  background: linear-gradient(180deg, rgba(17, 20, 34, 0.92), rgba(12, 15, 27, 0.88));
  border-color: rgba(176, 149, 243, 0.14);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card,
.kpi { position: relative; overflow: hidden; }
.card::before,
.kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204, 184, 255, 0.52), transparent);
  pointer-events: none;
}
.kpi::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -30px;
  top: -34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.13), transparent 72%);
  pointer-events: none;
}

.btn {
  border-color: rgba(179, 155, 243, 0.16);
  background: linear-gradient(180deg, rgba(23, 27, 43, 0.96), rgba(17, 20, 33, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover {
  border-color: rgba(195, 173, 255, 0.36);
  background: linear-gradient(180deg, rgba(30, 35, 54, 0.98), rgba(21, 24, 39, 0.98));
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7146e8 58%, #5a33c9 100%);
  border-color: rgba(197, 173, 255, 0.26);
  color: #fff;
  box-shadow: 0 8px 24px rgba(111, 70, 233, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #9c72ff 0%, #7e57ef 58%, #633bd6 100%);
  border-color: rgba(205, 186, 255, 0.34);
}
.btn.link { color: #bdb1e0; }
.btn.link:hover { color: #fff; }
.btn:focus-visible,
.navlink:focus-visible,
.input:focus-visible {
  outline: 2px solid rgba(170, 136, 255, 0.96);
  outline-offset: 2px;
}

.input,
select.input,
textarea.input {
  background: rgba(20, 24, 39, 0.92);
  border-color: rgba(173, 147, 237, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.input:hover,
select.input:hover,
textarea.input:hover {
  border-color: rgba(184, 162, 247, 0.28);
}
.input:focus,
select.input:focus,
textarea.input:focus {
  outline: 2px solid rgba(139, 92, 246, 0.78);
  border-color: rgba(139, 92, 246, 0.88);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.10);
}

.t th { color: #8d86a9; }
.t tbody tr:hover td { background: rgba(139, 92, 246, 0.06); }
.note {
  border-left-color: var(--acc);
  color: #b7b1ce;
}
.banner-demo {
  background: rgba(232, 181, 77, 0.08);
  border-bottom: 1px solid rgba(232, 181, 77, 0.18);
  color: #eac373;
}
.rk-row:first-child .rk-pos { border-color: rgba(175, 145, 255, 0.40); }
.rk-bar {
  background: linear-gradient(90deg, #b28cff, #7a49e4);
  box-shadow: 0 0 14px rgba(122, 73, 228, 0.22);
}
.intro .half {
  background: linear-gradient(160deg, #0f1220 0%, #090c13 72%);
}
.intro .half.l {
  border-right-color: rgba(139, 92, 246, 0.30);
  box-shadow: 18px 0 48px rgba(139, 92, 246, 0.10);
}
@keyframes glowpulse {
  from { box-shadow: 0 6px 22px rgba(139, 92, 246, 0.30); }
  to { box-shadow: 0 6px 42px rgba(139, 92, 246, 0.55); }
}

@media (max-width: 880px) {
  body:has(.shell)::after {
    width: 58vw;
    height: 58vw;
    right: -14vw;
    top: 72px;
    opacity: 0.045;
  }
  .side {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(187, 164, 246, 0.14);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  }
  .side::before { display: none; }
  .brand { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.shell)::after,
  .page > * { animation: none; }
}


/* === Motion pass · aparición escalonada de bloques === */
@keyframes blockRevealSmooth {
  from {
    opacity: 0;
    transform: translateY(9px) scale(.994);
    filter: blur(1.4px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Los contenedores principales ya entran suavemente al cambiar de solapa.
   Este segundo nivel escalona tarjetas/secciones internas sin animar filas de
   tablas, para que la interfaz se sienta fluida sin volverse distractiva. */
.page :is(
  .kpis,
  .grid2,
  .dashboard-gastos-body,
  .liquidaciones-stack,
  .liq-model-list,
  .people-view,
  .people-stack,
  .people-roster-list,
  .team-grid,
  .team-members-grid,
  .team-admin-grid,
  .service-catalog-grid,
  .service-manage-list,
  .rol-grid,
  .cta-grid,
  .qm-grid,
  .liq-history-periods,
  .buyers-account-grid
) > * {
  animation: blockRevealSmooth .30s cubic-bezier(.22,.72,.28,1) both;
}

.page :is(
  .kpis,
  .grid2,
  .dashboard-gastos-body,
  .liquidaciones-stack,
  .liq-model-list,
  .people-view,
  .people-stack,
  .people-roster-list,
  .team-grid,
  .team-members-grid,
  .team-admin-grid,
  .service-catalog-grid,
  .service-manage-list,
  .rol-grid,
  .cta-grid,
  .qm-grid,
  .liq-history-periods,
  .buyers-account-grid
) > *:nth-child(1) { animation-delay: .035s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(2) { animation-delay: .065s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(3) { animation-delay: .095s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(4) { animation-delay: .125s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(5) { animation-delay: .155s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(6) { animation-delay: .185s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(7) { animation-delay: .215s; }
.page :is(.kpis,.grid2,.dashboard-gastos-body,.liquidaciones-stack,.liq-model-list,.people-view,.people-stack,.people-roster-list,.team-grid,.team-members-grid,.team-admin-grid,.service-catalog-grid,.service-manage-list,.rol-grid,.cta-grid,.qm-grid,.liq-history-periods,.buyers-account-grid) > *:nth-child(n+8) { animation-delay: .235s; }

/* Aperturas/cierres y estados interactivos conservan una respuesta rápida. */
.card,
.kpi,
.people-section,
.team-card,
.service-catalog-card,
.buyers-account-card,
.liq-section,
.liq-subsection,
.attendance-section {
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

@media (prefers-reduced-motion: reduce) {
  .page :is(
    .kpis,
    .grid2,
    .dashboard-gastos-body,
    .liquidaciones-stack,
    .liq-model-list,
    .people-view,
    .people-stack,
    .people-roster-list,
    .team-grid,
    .team-members-grid,
    .team-admin-grid,
    .service-catalog-grid,
    .service-manage-list,
    .rol-grid,
    .cta-grid,
    .qm-grid,
    .liq-history-periods,
    .buyers-account-grid
  ) > * {
    animation: none !important;
  }
}


/* === Motion pass · apertura/cierre suave de bloques interactivos ===
   Chrome moderno expone ::details-content, lo que permite animar el contenido
   real de <details> sin cambiar la estructura ni la lógica de los acordeones. */
:root { interpolate-size: allow-keywords; }

@supports selector(details::details-content) {
  .page details:not(.admin-row-actions)::details-content {
    block-size: 0;
    opacity: 0;
    overflow: clip;
    transform: translateY(-7px) scale(.996);
    filter: blur(.7px);
    transform-origin: top center;
    transition:
      block-size .34s cubic-bezier(.22,.72,.28,1),
      opacity .22s ease,
      transform .30s cubic-bezier(.22,.72,.28,1),
      filter .20s ease,
      content-visibility .34s allow-discrete;
  }

  .page details:not(.admin-row-actions)[open]::details-content {
    block-size: auto;
    opacity: 1;
    transform: none;
    filter: none;
  }

  @starting-style {
    .page details:not(.admin-row-actions)[open]::details-content {
      block-size: 0;
      opacity: 0;
      transform: translateY(-7px) scale(.996);
      filter: blur(.7px);
    }
  }
}

/* El encabezado acompaña la expansión para que no parezca un salto seco. */
.page details:not(.admin-row-actions) > summary {
  transition:
    background-color .20s ease,
    border-color .24s ease,
    color .20s ease,
    box-shadow .24s ease;
}
.page details:not(.admin-row-actions)[open] > summary {
  background-color: rgba(139, 92, 246, .025);
}

/* Los controles + / − / flechas ya existentes también cambian con una curva
   un poco más lenta y consistente con la expansión del contenido. */
.page :is(
  .liq-section,
  .liq-subsection,
  .people-create,
  .people-section,
  .buyers-results-section,
  .buyers-account-card,
  .attendance-section,
  .attendance-person
) > summary::after {
  transition: transform .28s cubic-bezier(.22,.72,.28,1), color .20s ease, opacity .20s ease;
}

@media (prefers-reduced-motion: reduce) {
  @supports selector(details::details-content) {
    .page details:not(.admin-row-actions)::details-content {
      transition: none !important;
      transform: none !important;
      filter: none !important;
    }
  }
  .page details:not(.admin-row-actions) > summary,
  .page details:not(.admin-row-actions) > summary::after {
    transition: none !important;
  }
}


/* === Layout balance · escritorio ancho ===
   En monitores grandes la sidebar desplaza el centro geométrico de la zona
   de contenido hacia la derecha. A partir de 1760px reservamos a la derecha
   el mismo ancho de la sidebar: el workspace queda centrado respecto de la
   pantalla completa, mientras notebooks y resoluciones menores conservan
   todo el ancho útil. */
@media (min-width: 1760px) {
  .content {
    padding-right: var(--sidebar-w);
  }
  .top {
    width: calc(100% + var(--sidebar-w));
  }
  main.page {
    max-width: 1500px;
    margin-inline: auto;
  }
}

@media (max-width: 880px) {
  .content { padding-right: 0; }
  .top { width: auto; }
}


/* === Equipos · identidad cromática configurable === */
.team-card-colored {
  position: relative;
  border-left: 3px solid color-mix(in srgb, var(--team-color) 82%, transparent);
}
.team-card-colored::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 110px;
  pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--team-color) 9%, transparent), transparent);
  opacity: .85;
}
.team-card-colored > summary,
.team-card-colored > .team-card-body { position: relative; z-index: 1; }
.team-card-colored[open] {
  border-color: color-mix(in srgb, var(--team-color) 35%, var(--line));
  box-shadow: 0 18px 42px rgba(0,0,0,.16), 0 0 28px color-mix(in srgb, var(--team-color) 8%, transparent), inset 0 1px 0 rgba(255,255,255,.03);
}
.team-color-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--team-color) 12%, transparent), 0 0 13px color-mix(in srgb, var(--team-color) 30%, transparent);
}
.team-card-colored .team-card-open { color: color-mix(in srgb, var(--team-color) 72%, white); }
.team-card-colored[open] .team-card-open { color: var(--muted); }
.team-color-admin {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 1.7fr);
  gap: 14px;
  align-items: center;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--team-color) 18%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--team-color) 3.5%, var(--panel2));
}
.team-color-admin > div:first-child { display: grid; gap: 3px; }
.team-color-admin small { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.team-color-form { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.team-admin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; flex-wrap: wrap; }
.team-admin-actions .team-color-form { flex: 1 1 360px; }
.team-admin-actions > .management-delete { flex: 0 0 auto; }
.team-color-field { flex: 2 1 440px !important; min-width: 280px !important; }
.team-color-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.team-color-option { position: relative; cursor: pointer; display: inline-flex; align-items: center; }
.team-color-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.team-color-swatch {
  width: 24px;
  height: 24px;
  display: inline-block;
  border-radius: 8px;
  background: var(--swatch);
  border: 2px solid rgba(255,255,255,.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 10px rgba(0,0,0,.16);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.team-color-option:hover .team-color-swatch { transform: translateY(-1px) scale(1.04); }
.team-color-option input:checked + .team-color-swatch {
  border-color: rgba(255,255,255,.88);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--swatch) 28%, transparent), 0 5px 14px rgba(0,0,0,.22);
  transform: scale(1.06);
}
.team-color-option input:focus-visible + .team-color-swatch { outline: 2px solid var(--acc-hi); outline-offset: 3px; }
.team-color-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.team-create-form .team-color-picker { padding: 4px 0 2px; }
.team-card-unassigned { border-left-width: 1px; }

@media (max-width: 760px) {
  .team-color-admin { grid-template-columns: 1fr; align-items: stretch; }
  .team-color-form { justify-content: flex-start; flex-wrap: wrap; }
  .team-color-field { min-width: 0 !important; flex-basis: 100% !important; }
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .team-card-colored { border-left-color: var(--team-color); }
  .team-card-colored[open] { border-color: var(--team-color); }
  .team-card-colored::before { background: linear-gradient(90deg, rgba(139,92,246,.08), transparent); }
  .team-card-colored .team-card-open { color: var(--team-color); }
}

/* ========================================================================== 
 * Mobile-first pass · uso real desde teléfono / tablet
 * No es un simple "shrink": navegación en drawer, controles táctiles y
 * vistas de tarjetas para Ventas, Validaciones y Liquidaciones.
 * ========================================================================== */
.mobile-only { display: none !important; }
.desktop-only { display: block; }
.mobile-menu-btn,
.mobile-nav-close,
.mobile-nav-backdrop { display: none; }
.top-titlebar,
.top-right,
.top-actions { display: flex; align-items: center; }
.top-titlebar { min-width: 0; }
.top-right { gap: 12px; min-width: 0; }
.top-actions { gap: 8px; flex-wrap: wrap; }

/* Tarjetas compactas usadas sólo en la experiencia móvil. */
.mobile-card-list { display: grid; gap: 10px; }
.mobile-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(176, 149, 243, .15);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(19, 22, 37, .96), rgba(12, 15, 27, .93));
  box-shadow: 0 14px 32px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.025);
}
.mobile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.mobile-card-head > div:first-child { min-width: 0; }
.mobile-card-head h3 {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.mobile-eyebrow {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.mobile-card-amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 13px 0 11px;
  padding: 12px;
  border: 1px solid rgba(176,149,243,.10);
  border-radius: 12px;
  background: rgba(139, 92, 246, .045);
}
.mobile-card-amount b { font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; }
.mobile-card-amount span { color: var(--muted); font-size: 11px; text-align: right; }
.mobile-card-grid,
.mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.mobile-card-grid > div,
.mobile-metrics > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.mobile-card-grid span,
.mobile-metrics span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.mobile-card-grid b,
.mobile-metrics b {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.mobile-card-grid small { color: var(--faint); font-size: 10.5px; }
.mobile-metrics {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(176,149,243,.10);
}
.mobile-metric-emphasis b { color: var(--acc-hi); }
.mobile-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.mobile-card-note {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  padding: 10px 11px;
  border: 1px solid rgba(176,149,243,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.018);
}
.mobile-card-note > span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.mobile-card-note b { font-size: 12px; overflow-wrap: anywhere; }
.mobile-card-note small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.mobile-card-text { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mobile-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}
.mobile-card-actions > :only-child { grid-column: 1 / -1; }
.validation-mobile-actions { grid-template-columns: 1fr; }
.mobile-btn { width: 100%; min-height: 44px; justify-content: center; text-align: center; }
.mobile-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.012);
}
.mobile-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 11px 12px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line);
}
.mobile-list-row:first-child { border-top: 0; }
.mobile-list-row > span:first-child { display: grid; gap: 2px; min-width: 0; }
.mobile-list-row b { font-size: 12.5px; }
.mobile-list-row small { color: var(--muted); font-size: 10.5px; }
.mobile-list-row > span:last-child { flex: 0 0 auto; color: var(--acc-hi); font-size: 11px; font-weight: 700; }

@media (max-width: 900px) {
  html { scroll-padding-top: 72px; }
  body { overflow-x: hidden; }
  body.mobile-menu-open { overflow: hidden; }
  body:has(.shell)::after {
    width: 72vw;
    height: 72vw;
    right: -30vw;
    top: 96px;
    opacity: .035;
  }
  .banner-demo { display: none; }
  .shell { display: block; min-height: 100dvh; }
  .content { width: 100%; min-height: 100dvh; padding-right: 0 !important; }

  /* Drawer móvil. Conserva todas las rutas y grupos de la sidebar de escritorio. */
  .side {
    position: fixed !important;
    z-index: 1200;
    inset: 0 auto 0 0;
    width: min(86vw, 320px) !important;
    height: 100dvh !important;
    padding: max(14px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 1px !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.22,.72,.28,1), box-shadow .28s ease;
    border-right: 1px solid rgba(187,164,246,.18) !important;
    border-bottom: 0 !important;
    background: linear-gradient(180deg, rgba(10,12,21,.995), rgba(7,9,16,.99));
    box-shadow: 26px 0 70px rgba(0,0,0,.42);
  }
  body.mobile-menu-open .side { transform: translateX(0); }
  .side .brand {
    width: 100%;
    padding: 3px 7px 15px !important;
    margin: 0 0 5px !important;
    border-bottom: 1px solid rgba(255,255,255,.05) !important;
  }
  .side .brand-mark { width: 38px; height: 38px; }
  .side .nav-group-label {
    display: block !important;
    width: 100%;
    margin-top: 7px;
    padding: 12px 10px 5px;
  }
  .side .navlink {
    width: 100% !important;
    min-height: 44px;
    padding: 9px 11px !important;
    border-radius: 10px;
  }
  .side .navlink span.txt { display: inline !important; }
  .side .side-foot {
    width: 100%;
    margin: auto 0 0 !important;
    padding: 12px 0 0 !important;
  }
  .mobile-nav-close {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(176,149,243,.15);
    border-radius: 10px;
    background: rgba(255,255,255,.025);
    color: var(--muted);
    font: inherit;
    font-size: 24px;
    cursor: pointer;
  }
  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    z-index: 1150;
    inset: 0;
    background: rgba(2,4,9,.67);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
  }
  body.mobile-menu-open .mobile-nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Topbar compacta y táctil. */
  .top {
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    min-height: 62px;
    padding: max(9px, env(safe-area-inset-top)) 12px 9px !important;
    background: rgba(8,10,18,.90);
  }
  .top-titlebar { min-width: 0; gap: 9px; }
  .top-titlebar h1 {
    min-width: 0;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(176,149,243,.18);
    border-radius: 11px;
    background: rgba(139,92,246,.07);
    color: var(--acc-hi);
    cursor: pointer;
  }
  .mobile-menu-btn svg { width: 20px; height: 20px; }
  .top-right { display: contents; }
  .who { grid-column: 2; grid-row: 1; gap: 8px; }
  .who .av { width: 36px; height: 36px; }
  .top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1px 0 2px;
  }
  .top-actions:empty { display: none; }
  .top-actions::-webkit-scrollbar { display: none; }
  .top-actions .btn { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }

  main.page {
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    padding: 15px 12px calc(34px + env(safe-area-inset-bottom)) !important;
  }
  .page > * { max-width: 100%; }
  .section-head {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }
  .section-head > div:first-child { min-width: 0; }
  .section-head > :last-child:not(:first-child) { max-width: 100%; }

  /* Controles: objetivo táctil de ~44 px y font-size que evita zoom en iOS. */
  .input,
  select.input,
  textarea.input {
    min-height: 46px;
    padding: 10px 11px;
    font-size: 16px;
    border-radius: 11px;
  }
  textarea.input { min-height: 96px; }
  .btn { min-height: 44px; padding: 9px 13px; border-radius: 10px; }
  .btn.small { min-height: 40px; padding: 7px 10px; font-size: 12px; }
  .chip { min-height: 24px; }
  .field { min-width: 0 !important; }
  .field > .muted { line-height: 1.4; }

  /* Formularios y filtros pasan de barras horizontales a rejillas legibles. */
  .filtros {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end !important;
    gap: 10px !important;
    width: 100%;
  }
  .filtros .field { width: 100%; min-width: 0 !important; }
  .filtros .btn { justify-content: center; }
  .dashboard-filtros,
  .dashboard-filtros .filtros,
  .dashboard-filtros-servicios .filtros,
  .dashboard-filtros-reportes .filtros { width: 100%; margin-left: 0; }
  .grid2 { grid-template-columns: 1fr !important; gap: 11px; }
  .card-p { padding: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { padding: 12px 13px; border-radius: 13px; }
  .kpi .v { font-size: 18px; }
  .currency-values { justify-content: flex-start; text-align: left; }

  /* Las tablas secundarias siguen disponibles por swipe; las críticas se
     reemplazan abajo por tarjetas y se ocultan con .desktop-only. */
  .twrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  table.t { min-width: max-content; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  /* Venta / carga rápida */
  .qm-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .qm-card { padding: 13px; }
  .qm-form { grid-template-columns: minmax(0, 1fr) 96px; gap: 9px; }
  .qm-form select,
  .qm-form input { min-height: 44px; font-size: 16px; padding: 9px 10px; }
  .qm-form button { min-height: 44px; font-size: 13px; }
  form[data-form="nueva-venta"] {
    width: 100% !important;
    max-width: none !important;
    gap: 14px !important;
  }
  form[data-form="nueva-venta"] > .btn[type="submit"] {
    min-height: 50px;
    font-size: 14px;
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 4;
    box-shadow: 0 12px 30px rgba(58,30,130,.34);
  }
  .sales-mobile-list,
  .validation-mobile-list,
  .correction-mobile-list,
  .inconsistency-mobile-list,
  .liq-mobile-currency-list,
  .liq-chatter-mobile-list { display: grid !important; }

  /* Validaciones de modelos: botones grandes, sin tabla horizontal. */
  .validation-mobile-card .mobile-card-amount { border-color: rgba(232,181,77,.16); }
  .validation-mobile-card .mobile-card-amount b { font-size: 22px; }
  .validation-mobile-actions .btn { min-height: 48px; }

  /* Liquidaciones */
  .liq-page-head,
  .liq-section-toolbar,
  .liq-document-actions { align-items: stretch !important; }
  .liq-action-group { width: 100%; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
  .liq-action-group .btn { justify-content: center; text-align: center; }
  .liq-action-group > :only-child { grid-column: 1 / -1; }
  .liq-model-row { padding: 12px; gap: 11px; }
  .liq-model-actions,
  .liq-model-actions > .liq-action-group { width: 100%; }
  .liq-section > summary,
  .liq-subsection > summary { padding: 13px 14px; }
  .liq-section-body,
  .liq-subsection-body { padding: 12px; }
  .liq-section-toolbar > div:last-child { width: 100%; }
  .liq-section-toolbar .field { flex: 1 1 100%; width: 100%; min-width: 0 !important; }
  .liq-mobile-currency-card .mobile-card-amount b { color: var(--acc-hi); }
  .liq-chatter-mobile-card .mobile-card-amount b { color: var(--acc-hi); }

  /* Dashboard chatter / actividad / equipos */
  .chatter-validation-row { padding: 12px; }
  .chatter-validation-action .btn { min-height: 40px; }
  .attendance-filter { grid-template-columns: 1fr 1fr !important; }
  .attendance-person-grid { gap: 12px; }
  .team-color-admin { grid-template-columns: 1fr !important; }
  .team-color-form { justify-content: flex-start !important; flex-wrap: wrap; }
  .team-color-field { min-width: 0 !important; flex-basis: 100% !important; }
  .team-color-swatch { width: 30px; height: 30px; border-radius: 9px; }

  /* Modales / confirmaciones */
  .mback { padding: 12px; align-items: flex-end; }
  .modal { width: 100%; max-width: none; max-height: min(88dvh, 760px); border-radius: 20px 20px 12px 12px; overflow-y: auto; }
}

@media (max-width: 620px) {
  .who-copy { display: none; }
  .top { grid-template-columns: minmax(0, 1fr) auto; }
  .filtros { grid-template-columns: 1fr; }
  .filtros > .btn { width: 100%; }
  .kpis { grid-template-columns: 1fr; }
  .chatter-validation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-card-grid,
  .mobile-metrics { grid-template-columns: 1fr 1fr; }
  .mobile-card-actions { grid-template-columns: 1fr; }
  .mobile-card-actions > * { grid-column: 1 !important; }
  .attendance-filter { grid-template-columns: 1fr !important; }
  .attendance-filter .field,
  .attendance-filter .btn { grid-column: 1 !important; }
  .buyers-filter { grid-template-columns: 1fr !important; }
  .buyers-kpis { grid-template-columns: 1fr !important; }
  .dashboard-gasto-form { grid-template-columns: 1fr !important; }
  .dashboard-gasto-form > * { grid-column: 1 !important; }
  .admin-users-summary,
  .admin-create-grid { grid-template-columns: 1fr !important; }
  .people-model-row-admin,
  .people-model-row-basic,
  .people-model-row-chatter-view,
  .people-chatter-row { grid-template-columns: minmax(0,1fr) !important; }
  .people-row-action { grid-column: 1 !important; grid-row: auto !important; }
  .people-row-action .btn { width: 100%; justify-content: center; }
}

@media (max-width: 430px) {
  main.page { padding-left: 10px !important; padding-right: 10px !important; }
  .top { padding-left: 10px !important; padding-right: 10px !important; }
  .mobile-card { padding: 13px 12px; }
  .mobile-card-grid,
  .mobile-metrics { grid-template-columns: 1fr; gap: 8px; }
  .mobile-card-amount { align-items: flex-start; flex-direction: column; gap: 5px; }
  .mobile-card-amount span { text-align: left; }
  .chatter-validation-stats { grid-template-columns: 1fr 1fr; gap: 7px; }
  .chatter-validation-stat { padding: 10px; }
  form[data-form="nueva-venta"] > div[style*="grid-template-columns"],
  form[data-form="editar-venta"] > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .qm-form { grid-template-columns: 1fr 92px; }
  .liq-action-group { grid-template-columns: 1fr !important; }
  .clockin-card { padding: 22px 16px; }
}

@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .navlink:hover { transform: none; }
  .btn:active,
  .mobile-menu-btn:active,
  .mobile-nav-close:active { transform: scale(.985); }
}

@media (prefers-reduced-motion: reduce) {
  .side,
  .mobile-nav-backdrop { transition: none !important; }
}

/* Ajustes finales del pase móvil */
.liq-document-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .liq-document-buttons { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .liq-document-buttons .btn { width: 100%; justify-content: center; text-align: center; }
  .chk-row { min-height: 44px; padding: 8px 2px; gap: 11px; }
  .chk-row input { width: 20px; height: 20px; flex: 0 0 auto; }
  .page .card[style*="max-width:520px"],
  .page .note[style*="max-width:460px"] { max-width: none !important; }
  .sales-pagination { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
  .sales-pagination .btn { justify-content: center; }
}
@media (max-width: 620px) {
  .section-head { flex-direction: column; align-items: stretch !important; }
  .section-head > .chip { align-self: flex-start; }
  .liq-document-buttons { grid-template-columns: 1fr; }
  [data-paypal-fields] { grid-template-columns: 1fr !important; }
  .sales-pagination { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .mback { z-index: 5000; }
  .toast { z-index: 6000; max-width: calc(100vw - 24px); text-align: center; }
}


/* ========================================================================== 
 * Centro de alertas operativo · header de sesión
 * Alertas dinámicas calculadas con el estado real ya cargado desde MySQL.
 * ========================================================================== */
.top-session {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.session-profile {
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: 5px 10px 5px 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(176,149,243,.10);
  border-radius: 13px;
  background: rgba(255,255,255,.018);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
}
.session-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  font-size: 13px;
  line-height: 1.22;
  color: var(--ink);
}
.session-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}
.session-profile {
  appearance: none;
  -webkit-appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.session-profile:hover,
.top-session.profile-open .session-profile {
  border-color: rgba(190,164,255,.28);
  background: rgba(139,92,246,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.028), 0 8px 22px rgba(0,0,0,.12);
}
.session-profile:focus-visible {
  outline: 2px solid rgba(170,136,255,.96);
  outline-offset: 2px;
}
.who-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 1px;
}
.session-menu {
  position: absolute;
  z-index: 1310;
  top: calc(100% + 11px);
  right: 0;
  width: 238px;
  overflow: hidden;
  border: 1px solid rgba(182,155,247,.18);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(17,20,34,.99), rgba(10,13,23,.99));
  box-shadow: 0 22px 60px rgba(0,0,0,.42), 0 0 38px rgba(91,49,176,.09), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px) scale(.985);
  transform-origin: top right;
  transition: opacity .16s ease, visibility .16s ease, transform .2s cubic-bezier(.22,.72,.28,1);
}
.top-session.profile-open .session-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.session-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-bottom: 1px solid rgba(176,149,243,.09);
  background: linear-gradient(135deg, rgba(139,92,246,.075), transparent 65%);
}
.session-menu-head .av { width: 34px; height: 34px; }
.session-menu-head > div { min-width: 0; display: grid; gap: 2px; }
.session-menu-head b {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-menu-head small { color: var(--muted); font-size: 10.5px; }
.session-menu-logout {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #f2eaff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.session-menu-logout svg { color: #c7b4ef; }
.session-menu-logout:hover,
.session-menu-logout:focus-visible {
  outline: none;
  background: rgba(139,92,246,.095);
  color: #fff;
}
.notification-trigger {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(176,149,243,.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(25,28,44,.93), rgba(16,19,31,.94));
  color: #c7b4ef;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 22px rgba(0,0,0,.13);
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.notification-trigger:hover,
.top-session.alerts-open .notification-trigger {
  color: #f2eaff;
  border-color: rgba(190,164,255,.34);
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(71,43,133,.15));
  box-shadow: 0 10px 28px rgba(70,35,135,.22), inset 0 1px 0 rgba(255,255,255,.045);
  transform: translateY(-1px);
}
.notification-trigger:focus-visible {
  outline: 2px solid rgba(170,136,255,.96);
  outline-offset: 2px;
}
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #090b13;
  border-radius: 999px;
  background: linear-gradient(135deg, #a86fff, #7650ec);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(139,92,246,.36);
}
.notification-panel {
  position: absolute;
  z-index: 1300;
  top: calc(100% + 11px);
  right: 0;
  width: min(390px, calc(100vw - 28px));
  max-height: min(560px, calc(100vh - 92px));
  overflow: hidden;
  border: 1px solid rgba(182,155,247,.18);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(17,20,34,.985), rgba(10,13,23,.985));
  box-shadow: 0 24px 70px rgba(0,0,0,.44), 0 0 46px rgba(91,49,176,.10), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px) scale(.985);
  transform-origin: top right;
  transition: opacity .18s ease, visibility .18s ease, transform .22s cubic-bezier(.22,.72,.28,1);
}
.top-session.alerts-open .notification-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.notification-panel-head {
  min-height: 66px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(176,149,243,.10);
  background: linear-gradient(135deg, rgba(139,92,246,.08), transparent 58%);
}
.notification-panel-head > div { display: grid; gap: 2px; }
.notification-panel-head b { font-size: 15px; }
.notification-count {
  min-width: 27px;
  height: 27px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(176,149,243,.18);
  border-radius: 999px;
  color: var(--acc-hi);
  background: rgba(139,92,246,.09);
  font-size: 11px;
  font-weight: 800;
}
.notification-list {
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(139,92,246,.28) transparent;
}
.notification-item {
  min-height: 74px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 36px minmax(0,1fr) 16px;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(176,149,243,.08);
  transition: background .15s ease, transform .15s ease;
}
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover {
  background: rgba(139,92,246,.065);
}
.notification-item-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(176,149,243,.15);
  border-radius: 11px;
  background: rgba(139,92,246,.08);
  color: var(--acc-hi);
}
.notification-high .notification-item-icon {
  border-color: rgba(232,181,77,.25);
  background: rgba(232,181,77,.08);
  color: #eac373;
}
.notification-warn .notification-item-icon {
  border-color: rgba(193,139,255,.22);
  background: rgba(139,92,246,.09);
  color: #c9adff;
}
.notification-item-copy { min-width: 0; display: grid; gap: 3px; }
.notification-item-copy b {
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.3;
}
.notification-item-copy small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.notification-item-arrow {
  color: var(--faint);
  font-size: 19px;
  line-height: 1;
  transition: transform .15s ease, color .15s ease;
}
.notification-item:hover .notification-item-arrow { color: var(--acc-hi); transform: translateX(2px); }
.notification-empty {
  min-height: 154px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}
.notification-empty > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 13px;
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid rgba(52,199,123,.24);
}
.notification-empty b { font-size: 13px; }
.notification-empty small { color: var(--muted); font-size: 11px; }
.notification-panel-foot {
  padding: 10px 13px;
  border-top: 1px solid rgba(176,149,243,.09);
  color: var(--faint);
  font-size: 9.75px;
  line-height: 1.35;
  text-align: center;
  background: rgba(255,255,255,.012);
}

@media (max-width: 900px) {
  .top-session {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    gap: 6px;
  }
  .session-profile {
    min-height: 40px;
    min-width: 0;
    max-width: min(230px, calc(100vw - 112px));
    padding: 2px 7px 2px 2px;
    border-color: rgba(176,149,243,.12);
    background: rgba(255,255,255,.014);
    box-shadow: none;
  }
  .session-role { display: none; }
  .notification-trigger { width: 40px; height: 40px; border-radius: 11px; }
  .notification-panel {
    position: fixed;
    top: max(70px, calc(env(safe-area-inset-top) + 60px));
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - max(84px, calc(env(safe-area-inset-top) + 74px)) - env(safe-area-inset-bottom));
    transform-origin: top right;
  }
  .notification-list { max-height: calc(100dvh - 190px - env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  .session-profile {
    width: auto;
    min-width: 0;
    max-width: min(216px, calc(100vw - 76px));
    height: auto;
    min-height: 38px;
    padding: 2px 8px 2px 2px;
    justify-content: flex-start;
    gap: 8px;
    border-color: rgba(176,149,243,.16);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(25,28,44,.93), rgba(16,19,31,.94));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 22px rgba(0,0,0,.13);
  }
  .top-session.profile-open .session-profile { background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(71,43,133,.15)); }
  .top-session .who .av { width: 34px; height: 34px; }
  .who-copy { display: grid; }
  .session-name { font-size: 12.5px; }
  .session-role { display: none; }
  .session-menu {
    position: fixed;
    top: max(70px, calc(env(safe-area-inset-top) + 60px));
    right: 10px;
    width: min(280px, calc(100vw - 20px));
  }
  .notification-trigger { width: 38px; height: 38px; }
  .notification-panel-head { min-height: 60px; padding: 11px 13px; }
  .notification-item { min-height: 70px; padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-trigger,
  .notification-panel,
  .notification-item,
  .notification-item-arrow,
  .session-profile,
  .session-menu,
  .session-menu-logout { transition: none !important; }
}

/* ============================================================================
 * Administración · respaldo privado de base de datos
 * ========================================================================== */
.admin-config-grid {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}
.admin-config-card,
.backup-card { min-width: 0; }
.backup-card {
  position: relative;
  overflow: hidden;
}
.backup-card::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.16), rgba(139,92,246,0) 70%);
  pointer-events: none;
}
.backup-head { position: relative; z-index: 1; }
.backup-intro {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  max-width: 720px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.backup-latest,
.backup-empty {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 70px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(166,137,255,.19);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(139,92,246,.09), rgba(255,255,255,.018));
}
.backup-latest > div,
.backup-empty > div { min-width: 0; display: grid; gap: 2px; }
.backup-latest b,
.backup-empty b { font-size: 13.5px; }
.backup-latest small,
.backup-empty small { color: var(--muted); font-size: 11.5px; }
.backup-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(75,199,139,.09), 0 0 18px rgba(75,199,139,.24);
}
.backup-empty > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 11px;
  color: var(--acc-hi);
  background: rgba(139,92,246,.1);
  border: 1px solid rgba(166,137,255,.18);
}
.backup-empty svg,
.backup-file-icon svg,
.backup-create svg { width: 17px; height: 17px; }
.backup-create {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 42px;
  justify-content: center;
  gap: 8px;
}
.backup-create:disabled { cursor: wait; opacity: .78; }
.backup-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: backupSpin .75s linear infinite;
}
@keyframes backupSpin { to { transform: rotate(360deg); } }
.backup-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}
.backup-list {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  overflow: hidden;
  background: rgba(0,0,0,.08);
}
.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.backup-row:last-child { border-bottom: 0; }
.backup-row-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.backup-row-main > div { min-width: 0; display: grid; gap: 2px; }
.backup-row-main b { font-size: 12.5px; }
.backup-row-main small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.backup-file-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--acc-hi);
  background: rgba(139,92,246,.09);
  border: 1px solid rgba(166,137,255,.15);
}
.backup-download { flex: 0 0 auto; text-decoration: none; }
.backup-row-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.backup-error {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border-left-color: var(--bad) !important;
}
.backup-error span { color: var(--muted); font-size: 11.5px; }

@media (max-width: 1040px) {
  .admin-config-grid { grid-template-columns: 1fr; }
  .admin-config-card { max-width: none; }
}
@media (max-width: 620px) {
  .admin-config-grid { gap: 12px; }
  .backup-head { align-items: flex-start; }
  .backup-row { align-items: stretch; flex-direction: column; }
  .backup-row-actions { width: 100%; }
  .backup-row-actions .btn { flex: 1; justify-content: center; min-height: 40px; }
  .backup-download { width: auto; }
  .backup-row-main small { white-space: normal; }
  .service-card-actions .btn { flex: 1 1 140px; justify-content: center; }
  .team-admin-actions { align-items: stretch; }
  .team-admin-actions > .management-delete { width: 100%; justify-content: center; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .backup-spinner { animation: none; }
}

/* ========================================================================== 
 * Experiencia móvil enfocada para MODELO · iPhone
 * En teléfono se priorizan únicamente Pagos y Liquidaciones; escritorio
 * conserva la navegación y densidad habituales.
 * ========================================================================== */
.model-mobile-nav { display: none; }
.model-mobile-focus { display: none !important; }
.model-payment-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 2px;
}
.model-payment-main > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(176,149,243,.09);
  border-radius: 11px;
  background: rgba(255,255,255,.014);
}
.model-payment-main span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.model-payment-main b { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.model-payment-secondary {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.model-problem-form { display: grid; gap: 14px; }
.model-problem-sale {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
  padding: 12px 13px;
  border: 1px solid rgba(176,149,243,.12);
  border-radius: 12px;
  background: rgba(139,92,246,.04);
}
.model-problem-sale span,
.model-problem-sale small { color: var(--muted); font-size: 11px; }
.model-problem-sale b { font-size: 20px; font-variant-numeric: tabular-nums; }
.model-problem-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (max-width: 900px) {
  /* Una modelo no necesita abrir la sidebar para su trabajo cotidiano. */
  .shell-model .side,
  .shell-model .mobile-nav-backdrop,
  .shell-model .mobile-menu-btn { display: none !important; }
  .shell-model .top-titlebar { gap: 0; }
  .shell-model .top { min-height: 60px; }
  .shell-model main.page {
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }

  /* En iPhone primero aparecen las ventas que requieren acción. */
  .shell-model .model-validation-desktop-context,
  .shell-model .model-desktop-pending-head { display: none !important; }
  .shell-model .model-corrections-block {
    margin-top: 4px;
  }
  .shell-model .model-corrections-block > .section-head {
    margin: 14px 0 9px;
  }
  .shell-model .model-corrections-block > .section-head h2 {
    font-size: 14px;
  }
  .shell-model .model-mobile-focus {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
    padding: 15px 15px;
    border: 1px solid rgba(176,149,243,.16);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139,92,246,.11), rgba(17,20,34,.90));
    box-shadow: 0 14px 32px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.025);
  }
  .model-mobile-focus > div:first-child { min-width: 0; }
  .model-mobile-kicker {
    display: block;
    margin-bottom: 3px;
    color: var(--acc-hi);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
  }
  .model-mobile-focus h2 { margin: 0; font-size: 20px; line-height: 1.15; }
  .model-mobile-focus p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
  .model-mobile-count {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
    background: linear-gradient(145deg, #9868ff, #6335d7);
    box-shadow: 0 8px 22px rgba(109,68,221,.28);
  }

  .shell-model .validation-mobile-list { gap: 12px; }
  .shell-model .model-payment-card {
    padding: 15px 14px;
    border-color: rgba(176,149,243,.20);
    border-radius: 17px;
    background: linear-gradient(180deg, rgba(20,23,39,.985), rgba(11,14,25,.97));
  }
  .shell-model .model-payment-card .mobile-card-head h3 { font-size: 16px; }
  .shell-model .model-payment-amount {
    margin: 12px 0 10px;
    padding: 14px;
    border-color: rgba(139,92,246,.20);
    background: rgba(139,92,246,.07);
  }
  .shell-model .model-payment-amount b { font-size: 26px; letter-spacing: -.02em; }
  .shell-model .model-payment-amount span { font-size: 11px; font-weight: 700; }
  .shell-model .model-paypal-note { border-color: rgba(77,170,232,.18); background: rgba(77,170,232,.035); }
  .shell-model .model-payment-actions { gap: 8px; margin-top: 14px; }
  .shell-model .model-confirm-btn {
    min-height: 54px !important;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 13px;
    box-shadow: 0 10px 25px rgba(109,68,221,.24);
  }
  .shell-model .model-problem-btn {
    min-height: 46px !important;
    color: var(--muted);
    background: rgba(255,255,255,.018);
    border-color: rgba(255,255,255,.09);
  }

  /* Dos destinos grandes y siempre visibles: Pagos / Liquidaciones. */
  .model-mobile-nav {
    position: fixed;
    z-index: 1080;
    left: 10px;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    display: flex;
    align-items: stretch;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(187,164,246,.18);
    border-radius: 18px;
    background: rgba(9,11,20,.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 45px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.035);
  }
  .model-mobile-nav-item {
    min-width: 0;
    min-height: 54px;
    flex: 1 1 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 6px 8px;
    border-radius: 13px;
    color: var(--muted);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1.1;
    transition: color .18s ease, background .18s ease, transform .14s ease;
  }
  .model-mobile-nav-icon { display: grid; place-items: center; }
  .model-mobile-nav-item.on {
    color: #f3edff;
    background: linear-gradient(145deg, rgba(152,104,255,.25), rgba(99,53,215,.18));
    box-shadow: inset 0 0 0 1px rgba(176,149,243,.16);
  }
  .model-mobile-nav-item:active { transform: scale(.98); }

  .paypal-confirm-form input[name="netoRecibidoPaypal"] {
    min-height: 54px;
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .paypal-confirm-form > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr 1.4fr;
    gap: 8px !important;
  }
  .paypal-confirm-form > div:last-child .btn { min-height: 50px; justify-content: center; }
  .model-problem-modal .model-problem-actions .btn { min-height: 50px; justify-content: center; }
}

@media (max-width: 430px) {
  .shell-model .top-titlebar h1 { font-size: 16px; }
  .shell-model .model-payment-main { grid-template-columns: 1fr; gap: 7px; }
  .shell-model .model-payment-main > div { padding: 9px 10px; }
  .shell-model .model-payment-card { padding: 14px 12px; }
  .model-mobile-nav { left: 8px; right: 8px; }
  .model-mobile-nav-item { min-height: 52px; font-size: 10px; }
  .model-problem-actions,
  .paypal-confirm-form > div:last-child { grid-template-columns: 1fr !important; }
}


/* Reingreso de chatters — justificación posterior al inicio de jornada */
.reentry-card{width:min(520px,100%)}
.reentry-icon{color:var(--acc-hi);background:rgba(139,92,246,.13);border-color:rgba(139,92,246,.30)}
.reentry-options{display:grid;gap:10px;margin:2px 0 18px;text-align:left}
.reentry-option{width:100%;display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:12px;padding:14px;border:1px solid rgba(154,132,220,.22);border-radius:15px;background:rgba(255,255,255,.025);color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:border-color .18s ease,background .18s ease,transform .18s ease,box-shadow .18s ease}
.reentry-option:hover{border-color:rgba(139,92,246,.52);background:rgba(139,92,246,.08);transform:translateY(-1px);box-shadow:0 10px 26px rgba(0,0,0,.16)}
.reentry-option:active{transform:translateY(0)}
.reentry-option:disabled{opacity:.58;cursor:wait;transform:none}
.reentry-option-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:rgba(139,92,246,.12);border:1px solid rgba(139,92,246,.22);color:var(--acc-hi);font-size:18px;font-weight:800}
.reentry-option>span:last-child{display:grid;gap:4px;min-width:0}.reentry-option b{font-size:13px}.reentry-option small{font-size:11px;line-height:1.4;color:var(--muted)}
.attendance-event-label{display:inline-flex!important;width:max-content;align-items:center;margin-top:2px;padding:3px 7px;border-radius:999px;border:1px solid rgba(120,137,175,.18);font-size:9.5px!important;line-height:1.2!important;letter-spacing:.02em}
.attendance-event-label.is-start{color:#b9c5db;background:rgba(255,255,255,.025)}
.attendance-event-label.is-reentry{color:var(--acc-hi);background:rgba(139,92,246,.09);border-color:rgba(139,92,246,.25)}
@media(max-width:560px){.reentry-card{padding:22px 15px}.reentry-options{gap:9px}.reentry-option{grid-template-columns:40px minmax(0,1fr);padding:13px 12px}.reentry-option-icon{width:38px;height:38px;border-radius:12px}.reentry-option b{font-size:12.5px}.reentry-option small{font-size:10.5px}}

/* Selector operativo de quincena: permite gestionar períodos anteriores abiertos
 * sin mezclar el tablero de cierre con el histórico de liquidaciones cerradas. */
.liq-period-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
  gap: 14px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.liq-period-picker-copy { display: grid; gap: 3px; min-width: 0; }
.liq-period-picker-copy b { font-size: 13px; }
.liq-period-picker-copy span { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.liq-period-picker-field { min-width: 0 !important; }
.liq-period-picker-field .input { width: 100%; }

@media (max-width: 760px) {
  .liq-period-picker { grid-template-columns: 1fr; align-items: stretch; }
  .liq-period-picker-field { width: 100%; }
}


.coverage-row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Clasificación de servicios históricos ----------------------------------- */
.historical-classifier,
.historical-bulk {
  border: 1px solid rgba(139, 92, 246, .28);
  background: linear-gradient(180deg, rgba(124, 58, 237, .07), rgba(15, 18, 32, .34));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.historical-classifier {
  margin-top: 18px;
  padding-top: 16px;
  border-width: 1px 0 0;
  border-radius: 0;
}
.historical-classifier-head,
.historical-bulk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.historical-classifier-head h2,
.historical-bulk-head h2 {
  margin: 8px 0 4px;
}
.historical-classifier > p,
.historical-bulk-head p {
  margin: 4px 0 12px;
  max-width: 880px;
  line-height: 1.55;
  font-size: 12.5px;
}
.historical-or-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.historical-or-line::before,
.historical-or-line::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.historical-bulk {
  margin: 0 0 14px;
}
.historical-bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.historical-bulk-form {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr) minmax(240px, 1.3fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}
.historical-or {
  align-self: center;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.historical-bulk-foot {
  margin-top: 10px;
  font-size: 11.5px;
}
.venta-historica-select {
  width: 48px;
  text-align: center !important;
}
.venta-historica-select input,
.historical-sale-select input {
  width: 16px;
  height: 16px;
  accent-color: #8b5cf6;
  cursor: pointer;
}
.historical-sale-select-mobile {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11.5px;
}
@media (max-width: 1100px) {
  .historical-bulk-form {
    grid-template-columns: 1fr 1fr;
  }
  .historical-or { display: none; }
  .historical-bulk-motive { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .historical-bulk-form { grid-template-columns: 1fr; }
  .historical-bulk-motive { grid-column: auto; }
  .historical-bulk-form .btn { width: 100%; justify-content: center; }
}

/* Producción · perfil móvil: avatar de cuenta circular sin contenedor extra.
 * El botón conserva el área táctil y el menú de cuenta/cierre de sesión. */
@media (max-width: 620px) {
  .top-session {
    min-width: 0;
  }

  .top-session .session-profile,
  .top-session.profile-open .session-profile,
  .top-session .session-profile:hover,
  .top-session .session-profile:active {
    -webkit-appearance: none !important;
    appearance: none !important;
    -webkit-tap-highlight-color: transparent;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 50% !important;
    outline: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }

  .top-session .session-profile::before,
  .top-session .session-profile::after {
    content: none !important;
    display: none !important;
  }

  .top-session .session-profile .who-copy {
    display: none !important;
  }

  .top-session .session-profile .av {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 40px !important;
    border-radius: 50% !important;
    background: rgba(139, 92, 246, 0.12) !important;
    border: 1px solid rgba(172, 146, 241, 0.36) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 7px 20px rgba(0,0,0,.16) !important;
  }

  /* Indicador de teclado circular: evita que vuelva a aparecer un foco cuadrado. */
  .top-session .session-profile:focus-visible .av {
    box-shadow:
      0 0 0 2px rgba(170,136,255,.96),
      inset 0 1px 0 rgba(255,255,255,.035),
      0 7px 20px rgba(0,0,0,.16) !important;
  }
}


/* ==========================================================================
 * Actualización de datos · header
 * ========================================================================== */
.refresh-trigger {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(176,149,243,.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(25,28,44,.93), rgba(16,19,31,.94));
  color: #c7b4ef;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 22px rgba(0,0,0,.13);
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.refresh-trigger:hover,
.refresh-trigger:focus-visible {
  color: #f2eaff;
  border-color: rgba(190,164,255,.34);
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(71,43,133,.15));
  box-shadow: 0 10px 28px rgba(70,35,135,.22), inset 0 1px 0 rgba(255,255,255,.045);
  outline: none;
}
.refresh-trigger:active { transform: scale(.96); }
.refresh-trigger:disabled { cursor: wait; opacity: .86; }
.refresh-trigger.is-refreshing svg { animation: ea-refresh-spin .8s linear infinite; }
@keyframes ea-refresh-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .refresh-trigger { width: 40px; height: 40px; border-radius: 11px; }
}
@media (max-width: 620px) {
  .refresh-trigger { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .refresh-trigger { transition: none !important; }
  .refresh-trigger.is-refreshing svg { animation: none; }
}

/* ========================================================================== 
 * Ventas · período rápido y persistencia visual de filtros (v87)
 * ========================================================================== */
.sales-date-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 21, 31, .62);
}
.sales-date-tools-copy {
  display: grid;
  gap: 2px;
  min-width: 210px;
  flex: 1 1 260px;
}
.sales-date-tools-copy .muted { font-size: 11.5px; line-height: 1.35; }
.sales-date-presets {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.sales-date-preset { white-space: nowrap; }
.sales-month-picker {
  display: flex;
  align-items: end;
  gap: 7px;
  flex: 0 1 auto;
}
.sales-month-picker .field { min-width: 150px; }
.sales-month-picker input[type="month"] { min-width: 150px; }
@media (max-width: 900px) {
  .sales-date-tools { align-items: stretch; }
  .sales-date-tools-copy { flex-basis: 100%; }
  .sales-date-presets { width: 100%; }
  .sales-date-presets .btn { flex: 1 1 auto; justify-content: center; }
  .sales-month-picker { width: 100%; }
  .sales-month-picker .field { flex: 1 1 auto; }
}
@media (max-width: 620px) {
  .sales-date-tools { padding: 10px; }
  .sales-date-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-date-presets .btn:last-child { grid-column: 1 / -1; }
  .sales-month-picker { display: grid; grid-template-columns: 1fr; }
  .sales-month-picker .btn { width: 100%; justify-content: center; }
}

/* === Dashboard admin · jerarquía visual compacta (v121) ===
   Solo presentación: no modifica cálculos, filtros ni datos. */
.dashboard-clean {
  display: grid;
  gap: 14px;
}
.dashboard-clean > *,
.dashboard-secondary-stack > * { margin-bottom: 0 !important; }
.dashboard-clean .card,
.dashboard-clean .kpi,
.dashboard-clean .dashboard-gastos-gestion {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.10), inset 0 1px 0 rgba(255,255,255,.018);
}
.dashboard-clean .card::before,
.dashboard-clean .kpi::before { opacity: .22; }
.dashboard-clean .kpi::after { display: none; }
.dashboard-clean .dashboard-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.dashboard-clean h2 { letter-spacing: -.01em; }

/* Resultado principal: sigue visible, pero con menos capas y aire vertical. */
.dashboard-primary { padding: 16px 17px; }
.dashboard-primary-head { margin-bottom: 9px; }
.dashboard-primary .dashboard-filtros {
  margin: 0 0 11px;
  padding: 8px 9px;
  border-color: rgba(176,149,243,.10);
  background: rgba(10,13,24,.54);
}
.dashboard-primary-kpis {
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}
.dashboard-primary-kpis .kpi {
  border-color: rgba(176,149,243,.09);
  background: rgba(13,16,29,.54);
  padding: 11px 12px;
  border-radius: 11px;
}
.dashboard-primary-kpis .kpi .v { font-size: 18px; }
.dashboard-method {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}
.dashboard-method > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-weight: 600;
}
.dashboard-method > summary::-webkit-details-marker { display: none; }
.dashboard-method > summary::after { content: " +"; color: var(--acc-hi); }
.dashboard-method[open] > summary::after { content: " −"; }
.dashboard-method > div { max-width: 1060px; padding-top: 7px; line-height: 1.5; }

/* Resumen diario: integrado dentro del bloque principal para reducir ruido visual. */
.dashboard-today {
  border-top: 1px solid rgba(176,149,243,.12);
  border-bottom: 1px solid rgba(176,149,243,.12);
  padding: 12px 2px 11px;
}
.dashboard-today-inline {
  margin-top: 11px;
  border-top: 1px solid rgba(176,149,243,.10);
  border-bottom: 0;
  padding: 11px 0 0;
}
.dashboard-inline-note {
  margin: 0 0 8px;
  font-size: 11px;
}
.dashboard-today-main {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr 1fr;
  border: 1px solid rgba(176,149,243,.11);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(12,15,27,.50);
}
.dashboard-mini {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid rgba(176,149,243,.09);
}
.dashboard-mini:last-child { border-right: 0; }
.dashboard-mini .lbl {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dashboard-mini-value {
  min-width: 0;
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dashboard-mini-value .currency-values {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 9px;
}
.dashboard-mini-value .money { white-space: nowrap; }
.dashboard-mini-value .cur { font-size: 9px; margin-right: 4px; }
.dashboard-mini-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}
.dashboard-today-alerts {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px;
  margin-top: 7px;
}
.dashboard-today-alerts .dashboard-mini {
  border: 1px solid rgba(176,149,243,.09);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(12,15,27,.34);
}
.dashboard-today-alerts .dashboard-mini-value { font-size: 15px; }
.dashboard-mini-link { color: inherit; text-decoration: none; transition: border-color .15s ease, background .15s ease; }
.dashboard-mini-link:hover { border-color: rgba(195,173,255,.26); background: rgba(139,92,246,.055); }
.dashboard-mini.is-attention { border-color: rgba(232,181,77,.18); }
.dashboard-mini.is-ok { border-color: rgba(72,199,142,.14); }

/* El gráfico queda como el bloque visual principal, pero ocupa menos altura. */
.dashboard-chart { padding: 14px 16px 10px; }
.dashboard-chart .section-head { margin-bottom: 2px; }

/* Análisis secundarios: misma información, cerrada hasta que haga falta. */
.dashboard-secondary-stack { display: grid; gap: 8px; }
.dashboard-insight {
  overflow: clip;
  border: 1px solid rgba(176,149,243,.11);
  background: rgba(13,16,29,.66);
}
.dashboard-insight > summary {
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(190px,.85fr) minmax(340px,1.6fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
}
.dashboard-insight > summary::-webkit-details-marker { display: none; }
.dashboard-insight[open] > summary { border-bottom: 1px solid rgba(176,149,243,.10); }
.dashboard-insight-title { min-width: 0; }
.dashboard-insight-title h2 { margin: 0; font-size: 14px; }
.dashboard-insight-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 400; }
.dashboard-insight-glance {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}
.dashboard-insight-glance > span:not(.chip) { min-width: 0; display: grid; gap: 2px; }
.dashboard-insight-glance small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.dashboard-insight-glance b { font-size: 11.5px; font-weight: 650; min-width: 0; }
.dashboard-insight-glance .currency-values { display: flex; flex-wrap: wrap; gap: 2px 7px; }
.dashboard-insight-glance .money { white-space: nowrap; }
.dashboard-insight-glance .cur { font-size: 8.5px; margin-right: 3px; }
.dashboard-insight-action {
  color: var(--acc-hi);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dashboard-insight-action::after { content: "  +"; }
.dashboard-insight[open] .dashboard-insight-action::after { content: "  −"; }
.dashboard-insight[open] .dashboard-insight-action { font-size: 0; }
.dashboard-insight[open] .dashboard-insight-action::before { content: "Ocultar"; font-size: 11px; }
.dashboard-insight-body { padding: 12px 14px 14px; }
.dashboard-insight-copy { color: var(--muted); font-size: 11px; line-height: 1.45; }
.dashboard-insight-body .dashboard-filtros {
  margin: 9px 0 11px;
  padding: 9px;
  background: rgba(9,12,22,.42);
  border-color: rgba(176,149,243,.09);
}
.dashboard-insight-body .kpi {
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(12,15,27,.46);
  border-color: rgba(176,149,243,.08);
}
.dashboard-insight-body .kpi .v { font-size: 17px; }
.dashboard-gastos-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* Rankings: datos siempre visibles; filtros avanzados solo cuando se solicitan. */
.dashboard-rankings { display: grid; gap: 9px; }
.dashboard-rankings-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 1px 2px;
}
.dashboard-rankings-top .muted { font-size: 11px; }
.dashboard-rankings-actions { display: flex; align-items: center; gap: 7px; }
.dashboard-ranking-filter { position: relative; }
.dashboard-ranking-filter > summary {
  cursor: pointer;
  list-style: none;
  padding: 5px 9px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  background: var(--panel2);
}
.dashboard-ranking-filter > summary::-webkit-details-marker { display: none; }
.dashboard-ranking-filter[open] > summary { color: var(--ink); border-color: rgba(195,173,255,.30); }
.dashboard-ranking-filter-body {
  position: absolute;
  z-index: 8;
  right: 0;
  top: calc(100% + 7px);
  width: min(760px, calc(100vw - 44px));
  padding: 9px;
  border: 1px solid rgba(176,149,243,.18);
  border-radius: 12px;
  background: rgba(13,16,29,.98);
  box-shadow: 0 20px 44px rgba(0,0,0,.42);
}
.dashboard-ranking-filter-body .dashboard-filtros { margin: 0; padding: 8px; }
.dashboard-ranking-grid { gap: 9px; }
.dashboard-ranking-card { padding: 12px 14px; }
.dashboard-ranking-card .section-head { margin-bottom: 7px; }
.dashboard-ranking-card .section-head h2 { font-size: 13px; }

@media (max-width: 1080px) {
  .dashboard-primary-kpis { grid-template-columns: 1fr; }
  .dashboard-today-main { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-today-main .dashboard-mini { border-bottom: 1px solid rgba(176,149,243,.09); }
  .dashboard-today-main .dashboard-mini:nth-child(2n) { border-right: 0; }
  .dashboard-today-main .dashboard-mini:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .dashboard-insight > summary { grid-template-columns: minmax(170px,.8fr) minmax(280px,1.5fr) auto; }
}

@media (max-width: 760px) {
  .dashboard-clean { gap: 11px; }
  .dashboard-primary { padding: 13px; }
  .dashboard-today-inline { margin-top: 9px; padding-top: 9px; }
  .dashboard-primary-kpis { gap: 7px; }
  .dashboard-today { padding-top: 9px; }
  .dashboard-today-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .dashboard-today-main { grid-template-columns: 1fr; }
  .dashboard-today-main .dashboard-mini,
  .dashboard-today-main .dashboard-mini:nth-child(2n),
  .dashboard-today-main .dashboard-mini:last-child {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(176,149,243,.09);
  }
  .dashboard-today-main .dashboard-mini:last-child { border-bottom: 0; }
  .dashboard-today-alerts { grid-template-columns: 1fr; }
  .dashboard-insight > summary {
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
    align-items: start;
  }
  .dashboard-insight-glance { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; gap: 10px 16px; }
  .dashboard-insight-action { grid-column: 2; grid-row: 1; }
  .dashboard-insight-body { padding: 10px 11px 12px; }
  .dashboard-gastos-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-gastos-mes { width: 100%; }
  .dashboard-rankings-top { align-items: flex-start; flex-direction: column; }
  .dashboard-rankings-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .dashboard-ranking-filter { width: 100%; }
  .dashboard-ranking-filter > summary { width: fit-content; margin-left: auto; }
  .dashboard-ranking-filter-body { position: static; width: 100%; margin-top: 7px; }
}

/* ========================================================================== 
 * Modo día / noche (v124)
 * El modo oscuro actual sigue siendo el predeterminado. La preferencia se
 * guarda por navegador y sólo modifica presentación, nunca datos ni lógica.
 * ========================================================================== */
.theme-toggle {
  appearance: none;
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(176,149,243,.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(25,28,44,.93), rgba(16,19,31,.94));
  color: #c7b4ef;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 22px rgba(0,0,0,.13);
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: #f2eaff;
  border-color: rgba(190,164,255,.34);
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(71,43,133,.15));
  box-shadow: 0 10px 28px rgba(70,35,135,.18), inset 0 1px 0 rgba(255,255,255,.045);
  outline: none;
}
.theme-toggle:active { transform: scale(.97); }
.theme-toggle-label { line-height: 1; }
.login-theme-toggle,
.intro-theme-toggle {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: 18px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1fa;
  --panel: rgba(255, 255, 255, .94);
  --panel2: #f8f5fd;
  --line: rgba(80, 58, 113, .13);
  --line2: rgba(91, 66, 132, .22);
  --ink: #211a2f;
  --muted: #6f687c;
  --faint: #91899f;
  --acc: #7747df;
  --acc-hi: #6333c8;
  --acc-soft: rgba(119, 71, 223, .10);
  --ok: #168257;
  --ok-soft: rgba(22, 130, 87, .09);
  --warn: #9a6818;
  --warn-soft: rgba(180, 120, 25, .09);
  --bad: #c7443c;
  --bad-soft: rgba(199, 68, 60, .08);
}

html[data-theme="light"] body {
  background:
    radial-gradient(980px 520px at 78% -10%, rgba(139, 92, 246, .11), transparent 62%),
    radial-gradient(720px 420px at 8% 20%, rgba(116, 78, 194, .07), transparent 70%),
    linear-gradient(180deg, #faf8fd 0%, #f3f0f8 100%);
  color: var(--ink);
}
html[data-theme="light"] body:has(.shell) {
  background: linear-gradient(180deg, #faf8fd 0%, #f3f0f8 100%);
}
html[data-theme="light"] body:has(.shell)::before {
  background-image:
    linear-gradient(rgba(92, 66, 145, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 66, 145, .035) 1px, transparent 1px);
  opacity: .62;
}
html[data-theme="light"] body:has(.shell)::after {
  opacity: .028;
  filter: grayscale(.1) drop-shadow(0 0 35px rgba(111, 70, 210, .12));
}

html[data-theme="light"] .side {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,244,252,.94));
  border-right-color: rgba(89,65,126,.14);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.7), 14px 0 36px rgba(73,49,111,.06);
}
html[data-theme="light"] .side::before {
  background: linear-gradient(90deg, transparent, rgba(119,71,223,.26), transparent);
}
html[data-theme="light"] .brand { border-bottom-color: rgba(74,54,101,.07); }
html[data-theme="light"] .brand-t span { color: var(--muted); }
html[data-theme="light"] .nav-group-label { border-top-color: rgba(74,54,101,.06); }
html[data-theme="light"] .navlink:hover {
  color: var(--ink);
  background: rgba(119,71,223,.055);
}
html[data-theme="light"] .navlink.on {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(119,71,223,.13), rgba(119,71,223,.07));
}

html[data-theme="light"] .top {
  background: rgba(250,248,253,.82);
  border-bottom-color: rgba(83,61,119,.11);
  box-shadow: 0 10px 28px rgba(74,53,105,.05);
}
html[data-theme="light"] .av {
  background: rgba(119,71,223,.09);
  color: var(--acc-hi);
  border-color: rgba(119,71,223,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 0 16px rgba(119,71,223,.08);
}

html[data-theme="light"] .card,
html[data-theme="light"] .kpi,
html[data-theme="light"] .twrap,
html[data-theme="light"] .note,
html[data-theme="light"] .rol-card,
html[data-theme="light"] .people-create,
html[data-theme="light"] .people-section,
html[data-theme="light"] .team-card,
html[data-theme="light"] .service-catalog-card,
html[data-theme="light"] .buyers-results-section,
html[data-theme="light"] .buyers-account-card,
html[data-theme="light"] .liq-section,
html[data-theme="light"] .liq-subsection,
html[data-theme="light"] .dashboard-gastos-gestion,
html[data-theme="light"] .attendance-section,
html[data-theme="light"] .mobile-card {
  background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(250,248,253,.96));
  border-color: rgba(89,65,126,.13);
  box-shadow: 0 14px 34px rgba(72,51,102,.055), inset 0 1px 0 rgba(255,255,255,.9);
}
html[data-theme="light"] .card::before,
html[data-theme="light"] .kpi::before {
  background: linear-gradient(90deg, transparent, rgba(119,71,223,.22), transparent);
}
html[data-theme="light"] .kpi::after {
  background: radial-gradient(circle, rgba(119,71,223,.075), transparent 72%);
}

html[data-theme="light"] .btn,
html[data-theme="light"] .refresh-trigger,
html[data-theme="light"] .notification-trigger,
html[data-theme="light"] .theme-toggle {
  color: #5f497b;
  border-color: rgba(91,66,132,.17);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,242,251,.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 6px 18px rgba(75,54,105,.055);
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] .refresh-trigger:hover,
html[data-theme="light"] .refresh-trigger:focus-visible,
html[data-theme="light"] .notification-trigger:hover,
html[data-theme="light"] .top-session.alerts-open .notification-trigger,
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .theme-toggle:focus-visible {
  color: var(--acc-hi);
  border-color: rgba(119,71,223,.31);
  background: linear-gradient(180deg, #fff, #f3edfb);
  box-shadow: 0 8px 22px rgba(83,52,137,.08), inset 0 1px 0 #fff;
}
html[data-theme="light"] .btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #7146e8 58%, #5a33c9 100%);
  border-color: rgba(105,67,189,.22);
  box-shadow: 0 8px 22px rgba(103,65,194,.20), inset 0 1px 0 rgba(255,255,255,.20);
}
html[data-theme="light"] .btn.primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #9466f7 0%, #794be9 58%, #6337d2 100%);
}
html[data-theme="light"] .btn.link { color: #6d5d82; background: transparent; box-shadow: none; }
html[data-theme="light"] .btn.link:hover { color: var(--acc-hi); background: transparent; }

html[data-theme="light"] .input,
html[data-theme="light"] select.input,
html[data-theme="light"] textarea.input {
  color: var(--ink);
  background: rgba(255,255,255,.88);
  border-color: rgba(91,66,132,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95);
}
html[data-theme="light"] .input:hover,
html[data-theme="light"] select.input:hover,
html[data-theme="light"] textarea.input:hover { border-color: rgba(119,71,223,.30); }
html[data-theme="light"] .input::placeholder,
html[data-theme="light"] textarea.input::placeholder { color: #a09aab; }
html[data-theme="light"] .t th { color: #7b718b; }
html[data-theme="light"] .t tbody tr:hover td { background: rgba(119,71,223,.045); }
html[data-theme="light"] .note { color: #675f72; }

html[data-theme="light"] .session-menu,
html[data-theme="light"] .notification-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(248,245,252,.99));
  border-color: rgba(91,66,132,.17);
  box-shadow: 0 20px 55px rgba(63,43,89,.13), 0 0 34px rgba(119,71,223,.05), inset 0 1px 0 #fff;
}
html[data-theme="light"] .session-menu-head {
  border-bottom-color: rgba(91,66,132,.09);
  background: linear-gradient(135deg, rgba(119,71,223,.065), transparent 65%);
}
html[data-theme="light"] .session-menu-logout { color: var(--ink); }
html[data-theme="light"] .session-menu-logout svg { color: #775d9c; }
html[data-theme="light"] .session-menu-logout:hover,
html[data-theme="light"] .session-menu-logout:focus-visible {
  color: var(--acc-hi);
  background: rgba(119,71,223,.07);
}
html[data-theme="light"] .notification-badge { border-color: #faf8fd; }
html[data-theme="light"] .notification-item:hover { background: rgba(119,71,223,.05); }

html[data-theme="light"] .mback,
html[data-theme="light"] .clockin-gate { background: rgba(49,37,65,.35); }
html[data-theme="light"] .modal,
html[data-theme="light"] .clockin-card {
  background: linear-gradient(180deg, #fff, #faf7fd);
  border-color: rgba(91,66,132,.18);
  box-shadow: 0 26px 70px rgba(57,38,82,.18), inset 0 1px 0 #fff;
}
html[data-theme="light"] .toast:not(.bad) {
  background: #fff;
  color: var(--ink);
  border-color: rgba(91,66,132,.18);
  box-shadow: 0 8px 28px rgba(59,40,84,.14);
}
html[data-theme="light"] .reentry-option {
  background: rgba(255,255,255,.72);
  border-color: rgba(91,66,132,.18);
}
html[data-theme="light"] .reentry-option:hover {
  background: rgba(119,71,223,.06);
  border-color: rgba(119,71,223,.34);
  box-shadow: 0 9px 22px rgba(72,49,102,.08);
}

html[data-theme="light"] .attendance-roster { background: rgba(93,69,125,.025); }
html[data-theme="light"] .attendance-person { background: rgba(255,255,255,.72); }
html[data-theme="light"] .attendance-person[open] { background: rgba(255,255,255,.94); }
html[data-theme="light"] .attendance-person-history { background: rgba(95,72,128,.025); }
html[data-theme="light"] .attendance-event-label.is-start { background: rgba(83,65,108,.045); color: #655c72; }

html[data-theme="light"] .sales-date-tools,
html[data-theme="light"] .historical-bulk {
  background: rgba(255,255,255,.64);
}
html[data-theme="light"] .mobile-card-amount { background: rgba(119,71,223,.04); }
html[data-theme="light"] .model-mobile-nav {
  background: rgba(252,250,254,.96);
  border-color: rgba(91,66,132,.17);
  box-shadow: 0 16px 38px rgba(64,45,91,.14), inset 0 1px 0 #fff;
}

html[data-theme="light"] .dashboard-primary .dashboard-filtros,
html[data-theme="light"] .dashboard-primary-kpis .kpi,
html[data-theme="light"] .dashboard-today-main,
html[data-theme="light"] .dashboard-today-alerts .dashboard-mini,
html[data-theme="light"] .dashboard-insight,
html[data-theme="light"] .dashboard-insight-body .dashboard-filtros,
html[data-theme="light"] .dashboard-insight-body .kpi {
  background: rgba(255,255,255,.62);
  border-color: rgba(91,66,132,.11);
}
html[data-theme="light"] .dashboard-ranking-filter-body {
  background: rgba(255,255,255,.985);
  border-color: rgba(91,66,132,.17);
  box-shadow: 0 18px 42px rgba(61,42,88,.15);
}
html[data-theme="light"] .dashboard-mini-link:hover {
  border-color: rgba(119,71,223,.20);
  background: rgba(119,71,223,.045);
}

html[data-theme="light"] body:has(.login) { background: #f4f1fa; }
html[data-theme="light"] .login {
  --login-accent: #7747df;
  --login-accent-hi: #6333c8;
  --login-accent-deep: #5930b9;
  background:
    radial-gradient(820px 500px at 50% 42%, rgba(126,71,237,.11), transparent 67%),
    radial-gradient(700px 360px at 50% 76%, rgba(91,67,160,.055), transparent 74%),
    linear-gradient(180deg, #fbf9fd 0%, #f3f0f8 62%, #f7f4fb 100%);
}
html[data-theme="light"] .login::before {
  opacity: .24;
  background-image:
    linear-gradient(rgba(103,75,157,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103,75,157,.06) 1px, transparent 1px);
}
html[data-theme="light"] .login::after { background: rgba(119,65,231,.075); }
html[data-theme="light"] .login-card {
  border-color: rgba(103,75,157,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,245,252,.92));
  box-shadow: 0 28px 90px rgba(65,45,91,.12), 0 0 70px rgba(115,67,225,.055), inset 0 1px 0 #fff;
}
html[data-theme="light"] .login-card::before {
  background: linear-gradient(135deg, rgba(119,71,223,.04), transparent 31%, transparent 73%, rgba(111,77,219,.025));
}
html[data-theme="light"] .login-head h1 { color: var(--ink); }
html[data-theme="light"] .login-head p { color: var(--muted); }
html[data-theme="light"] .login-field .lbl { color: #776e84; }
html[data-theme="light"] .login-field .input {
  background: rgba(255,255,255,.92);
  color: var(--ink);
  border-color: rgba(103,75,157,.22);
}
html[data-theme="light"] .login-field .input::placeholder { color: #aaa3b1; }
html[data-theme="light"] .login-field .input:focus { background: #fff; }
html[data-theme="light"] .login-error { color: #a93630; }
html[data-theme="light"] .login-security { color: #81798c; }

html[data-theme="light"] .intro .half {
  background: linear-gradient(160deg, #fbf9fd 0%, #f2eff8 72%);
}
html[data-theme="light"] .intro .half.l {
  border-right-color: rgba(119,71,223,.16);
  box-shadow: 16px 0 42px rgba(119,71,223,.055);
}

@media (max-width: 880px) {
  html[data-theme="light"] .side {
    background: linear-gradient(180deg, rgba(255,255,255,.995), rgba(247,244,252,.99)) !important;
    border-right-color: rgba(91,66,132,.17) !important;
    box-shadow: 24px 0 60px rgba(57,38,82,.16) !important;
  }
}
@media (max-width: 720px) {
  html[data-theme="light"] .login {
    background:
      radial-gradient(520px 360px at 50% 39%, rgba(126,71,237,.10), transparent 70%),
      linear-gradient(180deg, #fbf9fd 0%, #f3f0f8 100%);
  }
}
@media (max-width: 620px) {
  .theme-toggle { width: 38px; min-width: 38px; height: 38px; padding: 0; }
  .top-theme-toggle .theme-toggle-label { display: none; }
  .login-theme-toggle,
  .intro-theme-toggle { top: 12px; right: 12px; }
  .login-theme-toggle .theme-toggle-label,
  .intro-theme-toggle .theme-toggle-label { display: none; }
}

html[data-theme="light"] .session-profile {
  background: rgba(255,255,255,.56);
  border-color: rgba(91,66,132,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
html[data-theme="light"] .session-profile:hover,
html[data-theme="light"] .top-session.profile-open .session-profile {
  background: rgba(119,71,223,.055);
  border-color: rgba(119,71,223,.24);
  box-shadow: 0 7px 18px rgba(72,49,102,.06), inset 0 1px 0 #fff;
}
html[data-theme="light"] .shell-model .model-mobile-focus {
  background: linear-gradient(135deg, rgba(119,71,223,.075), rgba(255,255,255,.90));
  border-color: rgba(91,66,132,.15);
  box-shadow: 0 12px 28px rgba(72,49,102,.06), inset 0 1px 0 #fff;
}
html[data-theme="light"] .shell-model .model-payment-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,245,252,.97));
  border-color: rgba(91,66,132,.16);
}
html[data-theme="light"] .shell-model .model-payment-amount {
  background: rgba(119,71,223,.055);
  border-color: rgba(119,71,223,.14);
}
html[data-theme="light"] .shell-model .model-problem-btn {
  background: rgba(255,255,255,.70);
  border-color: rgba(91,66,132,.13);
}

@media (max-width: 620px) {
  html[data-theme="light"] .session-profile {
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,242,251,.98));
    border-color: rgba(91,66,132,.17);
    box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(75,54,105,.055);
  }
  html[data-theme="light"] .top-session.profile-open .session-profile {
    background: linear-gradient(180deg, #fff, #f3edfb);
  }
}
