/* ==========================================================================
   Closer CRM · estética de la academia (Trading Sintéticos)
   Fondo oscuro, tarjetas degradadas, naranja/rojo de acento, Manrope + Space Grotesk.
   ========================================================================== */
:root {
  --bg: #05060c;
  --panel: #0c0f1c;
  --panel-2: #11152a;
  --line: #ffffff1c;
  --text: #f4f6ff;
  --muted: #9aa5c5;
  --accent: #ff3d2e;
  --accent-2: #ff7a18;
  --accent-3: #ffb800;
  --up: #2bffa0;
  --down: #ff5d6c;
  --blue: #4da3ff;
  --font-display: "Manrope", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --radius: 16px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 85% -10%, #ff7a180f, transparent 60%),
    radial-gradient(700px 400px at -10% 20%, #ff3d2e0c, transparent 55%),
    var(--bg);
  min-height: 100vh;
}
::selection { background: #ff7a1844; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #ffffff1a; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #ffffff2a; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.01em; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0; }

/* ---------- Marca ---------- */
.brand-block { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 auto; filter: drop-shadow(0 6px 18px #ff471f55); }
.brand-mark.small { width: 36px; height: 36px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: .05em; font-family: var(--font-display); }
.brand-name b { color: var(--accent-2); }
.brand-sub { color: var(--muted); font-size: .74rem; letter-spacing: .04em; }

/* ---------- Login ---------- */
.login { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; overflow: hidden; }
.orb { position: fixed; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.orb-1 { width: 420px; height: 420px; background: #ff3d2e2e; top: -120px; right: -80px; }
.orb-2 { width: 360px; height: 360px; background: #ff7a1822; bottom: -140px; left: -60px; }
.login-card {
  position: relative; width: min(430px, 100%); padding: 30px 28px 22px;
  border-radius: 22px; border: 1px solid #ffffff24;
  background: linear-gradient(165deg, #0d1120 0%, #090b15 70%, #0a0c16 100%);
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 .2rem; font-size: 1.55rem; }
.login-card > p { margin: 0 0 1.1rem; font-size: .9rem; line-height: 1.45; }
.login-card label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin: .7rem 0 .3rem; letter-spacing: .03em; }
.login-card .btn-block { margin-top: 1rem; }
.login-foot { margin: 1.1rem 0 0; text-align: center; color: #6b7694; font-size: .72rem; }
.setup-title { font-size: 1.05rem; margin: 0 0 .3rem; }

/* ---------- Controles ---------- */
input, select, textarea {
  width: 100%; border-radius: .72rem; border: 1px solid #ffffff26;
  background: #07080fdd; color: #f0f4ff; padding: .72rem .8rem;
  font-family: inherit; font-size: .92rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 4px #ff7a1826;
}
textarea { resize: vertical; min-height: 5rem; }
select { cursor: pointer; }
.btn {
  border: 1px solid transparent; border-radius: .75rem; padding: .6rem 1.1rem;
  font-family: var(--font-body); font-weight: 700; font-size: .9rem; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 30px #ff471f55; }
.btn-primary:hover { box-shadow: 0 10px 36px #ff471f77; }
.btn-danger { background: transparent; border: 1px solid #ff5d6c66; color: var(--down); }
.btn-danger:hover { background: #ff5d6c14; }
.btn-ghost { border-color: #ffffff28; background: transparent; color: #dfe5f5; }
.btn-ghost:hover { background: #ffffff0d; }
.btn-sm { padding: .42rem .8rem; font-size: .8rem; border-radius: .6rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.msg { min-height: 1.1rem; margin: .55rem 0 0; font-size: .82rem; color: var(--down); }
.msg.ok { color: var(--up); }

/* ---------- Estructura de la app ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  gap: 1rem; padding: 18px 14px; border-right: 1px solid var(--line);
  background: #090b14c2; backdrop-filter: blur(18px); z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; padding: 0 .35rem; }
.nav { display: flex; flex-direction: column; gap: .25rem; margin-top: .4rem; }
.nav-item {
  display: flex; align-items: center; gap: .65rem; width: 100%; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-family: var(--font-body); font-weight: 700;
  font-size: .9rem; padding: .62rem .75rem; border-radius: .72rem; cursor: pointer; text-align: left;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-item:hover { color: #fff; background: #ffffff0a; }
.nav-item.active {
  color: #fff; border-color: #ff7a1840;
  background: linear-gradient(120deg, #ff3d2e1f, #ff7a1810 60%, transparent);
  box-shadow: inset 2px 0 0 var(--accent-2);
}
.nav-ico { font-size: 1rem; width: 1.25rem; text-align: center; }
.sidebar-foot { margin-top: auto; display: grid; gap: .6rem; }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .4rem .35rem; }
.user-chip-txt { min-width: 0; }
.user-chip-txt #userName { font-weight: 700; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: .86rem; color: #1a0d05;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2));
}
.main-wrap { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .95rem 1.6rem; border-bottom: 1px solid var(--line);
  background: #070912d4; backdrop-filter: blur(18px);
}
.topbar-title h1 { margin: 0; font-size: 1.22rem; }
.topbar-title p { margin: .15rem 0 0; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.community-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px;
  border: 1px solid #ff7a1840; background: #ff7a1812; color: #ffd9b8; font-size: .76rem; font-weight: 700;
  max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vista { padding: 1.35rem 1.6rem 3rem; width: 100%; max-width: 1580px; }

/* ---------- Tarjetas y KPI ---------- */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(165deg, var(--panel) 0%, var(--panel-2) 100%);
  padding: 1.05rem 1.15rem; box-shadow: 0 12px 40px #0000004d;
}
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1rem; }
.panel-head .muted { font-size: .78rem; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem .85rem; background: linear-gradient(165deg, #0d1122, #0a0d19);
}
.kpi::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  opacity: .8;
}
.kpi-label { color: var(--muted); font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1.15; margin-top: .25rem; }
.kpi-hint { color: #6f7a99; font-size: .74rem; margin-top: .2rem; }
.kpi.ok .kpi-value { color: var(--up); }
.kpi.warn .kpi-value { color: var(--accent-3); }
.kpi.bad .kpi-value { color: var(--down); }
.kpi.blue .kpi-value { color: var(--blue); }
.kpi-link { cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.kpi-link:hover { transform: translateY(-2px); border-color: #ff7a1850; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 1rem; }

/* ---------- Gráfico de altas/bajas ---------- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: .4rem; }
.chart-col { flex: 1; min-width: 5px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chart-bar { border-radius: 3px 3px 1px 1px; min-height: 2px; }
.chart-bar.altas { background: linear-gradient(180deg, #2bffa0, #14b06a); }
.chart-bar.bajas { background: linear-gradient(180deg, #ff5d6c, #b0273a); }
.chart-col:hover .chart-bar { filter: brightness(1.25); }
.chart-legend { display: flex; gap: 1rem; margin-top: .6rem; color: var(--muted); font-size: .76rem; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: .35rem; }
.dot.altas { background: var(--up); }
.dot.bajas { background: var(--down); }

/* ---------- Pagos ---------- */
.pagos-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #ffffff0d; }
.pagos-bar span { height: 100%; }
.pagos-leyenda { display: grid; gap: .4rem; margin-top: .75rem; }
.pagos-fila { display: flex; align-items: center; justify-content: space-between; font-size: .84rem; color: #cdd6ee; }
.pagos-fila b { font-family: var(--font-display); }
.swatch { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: .45rem; }

/* ---------- Movimientos ---------- */
.mov { display: flex; align-items: center; gap: .6rem; padding: .48rem 0; border-bottom: 1px solid #ffffff0b; font-size: .86rem; }
.mov:last-child { border-bottom: 0; }
.mov-ico { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; flex: 0 0 auto; }
.mov-ico.join { background: #2bffa01c; color: var(--up); }
.mov-ico.leave { background: #ffb8001c; color: var(--accent-3); }
.mov-ico.kick { background: #ff5d6c1c; color: var(--down); }
.mov-ico.unban { background: #4da3ff1c; color: var(--blue); }
.mov-txt { min-width: 0; flex: 1; }
.mov-txt b { font-weight: 700; }
.mov-txt span { color: var(--muted); }
.mov-fecha { color: #6f7a99; font-size: .74rem; white-space: nowrap; }

/* ---------- Tabla ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: auto; background: #0a0d19; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
thead th {
  position: sticky; top: 0; z-index: 2; background: #0d1120; color: var(--muted);
  font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; text-align: left;
  padding: .68rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: .62rem .8rem; border-bottom: 1px solid #ffffff0b; font-size: .86rem; vertical-align: middle; }
tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover { background: #ffffff06; }
tbody tr:last-child td { border-bottom: 0; }
.celda-miembro { display: flex; align-items: center; gap: .6rem; min-width: 210px; }
.celda-miembro .nombre { font-weight: 700; line-height: 1.2; }
.celda-miembro .sub { color: var(--muted); font-size: .74rem; margin-top: .1rem; }
.avatar-sm {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: .74rem; color: #ffd9b8;
  background: linear-gradient(135deg, #ff3d2e33, #ffb80022); border: 1px solid #ff7a1840;
}
.pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: 999px;
  font-size: .71rem; font-weight: 700; border: 1px solid; white-space: nowrap;
}
.pill.activo { color: var(--up); border-color: #2bffa045; background: #2bffa00f; }
.pill.salio { color: var(--accent-3); border-color: #ffb80045; background: #ffb8000f; }
.pill.expulsado { color: var(--down); border-color: #ff5d6c45; background: #ff5d6c0f; }
.pill.historico { color: var(--muted); border-color: #ffffff24; background: #ffffff08; }
.pill.pagando { color: var(--up); border-color: #2bffa045; background: #2bffa00f; }
.pill.pendiente { color: var(--accent-3); border-color: #ffb80045; background: #ffb8000f; }
.pill.no_paga { color: var(--down); border-color: #ff5d6c45; background: #ff5d6c0f; }
.pill.ex_cliente { color: var(--muted); border-color: #ffffff24; background: #ffffff08; }
.pill.lead { color: var(--blue); border-color: #4da3ff45; background: #4da3ff0f; }
.pill.etapa { color: #cdd6ee; border-color: #ffffff24; background: #ffffff08; }
.fecha { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* ---------- Barra de herramientas ---------- */
.toolbar { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; }
.toolbar input[type="search"] { flex: 1 1 220px; min-width: 180px; }
.toolbar select { min-width: 130px; }
.toolbar .btn { flex: 0 0 auto; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  border: 1px solid #ffffff22; background: transparent; color: var(--muted); padding: .36rem .8rem;
  border-radius: 999px; font-family: var(--font-body); font-weight: 700; font-size: .78rem; cursor: pointer;
}
.chip.active { color: #fff; border-color: #ff7a1855; background: #ff7a1818; }
.contador { color: var(--muted); font-size: .8rem; margin: 0 0 .7rem; }

/* ---------- Pipeline ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; }
.kcol { background: #090c16; border: 1px solid var(--line); border-radius: 14px; padding: .65rem; display: flex; flex-direction: column; gap: .5rem; min-height: 220px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: .1rem .2rem .35rem; border-bottom: 1px solid #ffffff0d; }
.kcol-head b { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.kcol-head span { color: var(--muted); font-size: .74rem; }
.kcard { border: 1px solid #ffffff16; border-radius: 10px; background: #0f1326; padding: .55rem .6rem; cursor: pointer; transition: border-color .12s ease, transform .12s ease; }
.kcard:hover { border-color: #ff7a1850; transform: translateY(-1px); }
.kcard-name { font-weight: 700; font-size: .84rem; line-height: 1.2; }
.kcard-sub { color: var(--muted); font-size: .72rem; margin-top: .18rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.kmas { color: var(--muted); font-size: .74rem; text-align: center; padding: .2rem; }

/* ---------- Modal / ficha ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 4, 10, .74); display: none;
  align-items: flex-start; justify-content: center; z-index: 190; padding: 24px 16px; overflow: auto;
}
.modal-backdrop.show { display: flex; }
.modal-card {
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid #2a3458; border-radius: 18px; padding: 26px; max-width: 560px; width: 100%;
  margin: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal-card h3 { font-size: 18px; margin: 0 0 4px; }
.confirm-icon { font-size: 34px; text-align: center; margin: 4px 0 6px; }
.confirm-text { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 4px; white-space: pre-line; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.drawer-card { max-width: 800px; padding: 0; display: flex; flex-direction: column; max-height: 92vh; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 22px 24px; overflow-y: auto; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 9px; border-radius: 8px; }
.modal-x:hover { color: #fff; background: #ffffff12; }
.dw-cab { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.dw-cab .avatar { width: 52px; height: 52px; font-size: 1rem; }
.dw-cab h3 { margin: 0; font-size: 1.2rem; }
.dw-cab .sub { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.dw-badges { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .35rem; }
.dw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin: 1rem 0; }
.dw-dato { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .65rem; background: #0a0d19; }
.dw-dato label { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .15rem; }
.dw-dato b { font-size: .86rem; font-weight: 700; }
.dw-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.dw-seccion { margin-top: 1.2rem; }
.dw-seccion h4 { margin: 0 0 .55rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: #b8c2df; }
.dw-form { display: grid; gap: .5rem; }
.dw-form .fila { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.dw-form label { font-size: .74rem; color: var(--muted); font-weight: 700; margin-bottom: .15rem; display: block; }
.dw-form textarea { min-height: 78px; }
.hist { display: grid; gap: .4rem; }
.hist-item { border: 1px solid #ffffff12; border-radius: 10px; padding: .5rem .65rem; background: #0a0d19; font-size: .82rem; }
.hist-item .meta { color: var(--muted); font-size: .72rem; margin-top: .18rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.tag-list { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }

.totp-secret {
  font-family: Consolas, monospace; background: #07080f; border: 1px dashed #ff7a184d;
  padding: .6rem .7rem; border-radius: .6rem; letter-spacing: .12em; word-break: break-all;
  user-select: all; color: #ffe2a3; font-size: .9rem;
}

/* ---------- Estados vacíos / avisos ---------- */
.empty { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }
.empty .ico { font-size: 2.4rem; display: block; margin-bottom: .5rem; }
.empty h3 { color: #e8ecfa; margin: 0 0 .35rem; font-size: 1.05rem; }
.empty p { margin: 0 auto .9rem; max-width: 520px; font-size: .88rem; line-height: 1.5; }
.banner { border-radius: 12px; padding: .7rem .9rem; font-size: .84rem; line-height: 1.45; border: 1px solid; margin-bottom: .9rem; }
.banner.warn { border-color: #ffb80045; background: #ffb8000f; color: #ffe2a3; }
.banner.bad { border-color: #ff5d6c45; background: #ff5d6c0f; color: #ffc3c9; }
.banner.info { border-color: #4da3ff3d; background: #4da3ff0d; color: #c4e0ff; }
.banner.ok { border-color: #2bffa03d; background: #2bffa00d; color: #b9ffdd; }
.programa { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .45rem; font-size: .82rem; color: #cdd6ee; }
.barra { height: 10px; border-radius: 999px; background: #ffffff0d; overflow: hidden; }
.barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); transition: width .4s ease; }
.lista-cuenta { display: grid; gap: .5rem; }
.cuenta-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; background: #0a0d19; flex-wrap: wrap; }
.cuenta-item .quien { min-width: 0; }
.cuenta-item .quien b { display: block; font-size: .9rem; }
.cuenta-item .quien span { color: var(--muted); font-size: .76rem; }
.dialogo-item { display: flex; align-items: center; justify-content: space-between; gap: .6rem; border: 1px solid #ffffff12; border-radius: 10px; padding: .5rem .65rem; background: #0a0d19; }
.dialogo-item .info { min-width: 0; }
.dialogo-item .info b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialogo-item .info span { color: var(--muted); font-size: .73rem; }
.dialogo-item.activa { border-color: #2bffa045; background: #2bffa008; }
.dialogos-lista { display: grid; gap: .4rem; max-height: 420px; overflow-y: auto; padding-right: .2rem; margin-top: .7rem; }
.form-grid { display: grid; gap: .55rem; }
.form-grid .fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.form-grid label { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: .2rem; }
.acciones-fila { display: flex; gap: .5rem; flex-wrap: wrap; }
.soporte-datos { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.login-hint { margin-top: -.55rem !important; color: #8390b2; font-size: .8rem; }
.acceso-select { min-width: 158px; font-size: .82rem; padding: .45rem .6rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 260; max-width: min(380px, calc(100vw - 36px));
  background: #10142a; border: 1px solid #2a3458; border-left: 3px solid var(--accent-2);
  color: #eef1ff; padding: .8rem 1rem; border-radius: 12px; box-shadow: 0 18px 50px #00000088;
  font-size: .86rem; line-height: 1.4; opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-left-color: var(--up); }
.toast.err { border-left-color: var(--down); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1250px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; flex-direction: row; align-items: center;
    gap: .5rem; padding: .55rem .7rem; overflow-x: auto; border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-brand > div:last-child { display: none; }
  .sidebar-brand .brand-mark.small { width: 30px; height: 30px; }
  .nav { flex-direction: row; margin: 0; gap: .2rem; }
  .nav-item { white-space: nowrap; padding: .45rem .6rem; font-size: .82rem; width: auto; }
  .sidebar-foot { display: none; }
  .vista { padding: 1rem 1rem 2.6rem; }
  .topbar { padding: .8rem 1rem; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 1.5rem; }
  .toolbar select { min-width: 0; flex: 1 1 120px; }
  table { min-width: 620px; }
  .oculto-movil { display: none; }
  .modal-card { padding: 20px 16px; }
  .drawer-card { padding: 0; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .dw-form .fila { grid-template-columns: 1fr; }
  .form-grid .fila2 { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .community-chip { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
