/* ============================================================================
   AVANIA · ESTILO MAESTRO  (archivo único: /root/avania-brand/avania-ui.css)
   Aquí se cambian colores, tipografía, botones, campos, tarjetas y MENÚ LATERAL.
   Nunca se edita la copia de un proyecto: se edita este archivo y se ejecuta
       /root/avania-brand/sync.sh
   que lo copia a cada proyecto (ver LEEME.md). Tomado de Avania Setex (oct 2026).
   El menú usa clases propias (.av-*) para valer en cualquier proyecto.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
/* ---- 1. Colores (los del panel de Setex, con modo oscuro) ---- */
:root {
  --bg: #f3f4f6; --panel: #ffffff; --line: #e5e7eb; --ink: #111827; --muted: #6b7280;
  --accent: #0f766e; --accent-ink: #ffffff; --soft: #f0fdfa;
  --danger: #dc2626; --warn: #d97706; --ok: #059669;
  --chat: #f7f5f2; --in: #ffffff; --out: #dcf8e8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f14; --panel: #121820; --line: #243040; --ink: #e5e7eb; --muted: #94a3b8;
    --accent: #2dd4bf; --accent-ink: #042f2e; --soft: #0f2a28;
    --danger: #f87171; --warn: #fbbf24; --ok: #34d399;
    --chat: #0e141b; --in: #1b2430; --out: #12382f;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f14; --panel: #121820; --line: #243040; --ink: #e5e7eb; --muted: #94a3b8;
  --accent: #2dd4bf; --accent-ink: #042f2e; --soft: #0f2a28;
  --danger: #f87171; --warn: #fbbf24; --ok: #34d399;
  --chat: #0e141b; --in: #1b2430; --out: #12382f;
}

/* ---- 2. Tipografía, botones, campos y tarjetas (antes cabecera de ui.css de Setex) ---- */

:root {
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page: #f4f5f7;
  --bg: #f6f7f9;            /* relleno de campos y de bloques vacíos */
  --panel: #ffffff;
  --line: #e4e7ec;
  --ink: #101828;
  --muted: #667085;
  --soft: #f0fdfa;
  --radius: 16px;
  --radius-sm: 8px;
  --hero: linear-gradient(135deg, #0b3b38 0%, #0f5f59 100%);   /* tarjeta destacada, en teal */
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0b0f14; --bg: #161d27; --panel: #121820; --line: #243040; --ink: #eef2f6; --muted: #98a2b3;
    --hero: linear-gradient(135deg, #062624 0%, #0b4a45 100%);
  }
}
:root[data-theme="dark"] {
  --page: #0b0f14; --bg: #161d27; --panel: #121820; --line: #243040; --ink: #eef2f6; --muted: #98a2b3;
  --hero: linear-gradient(135deg, #062624 0%, #0b4a45 100%);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--page); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }
.muted, small { color: var(--muted); }
a { text-underline-offset: 2px; }

/* ---------- Botones: fondo blanco y borde fino; el principal, en teal ---------- */
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 500; text-decoration: none; line-height: 1.3;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { filter: brightness(.95); }
.btn:focus-visible, button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.ghost, .btn.secondary {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); font-weight: 500;
}
.btn.ghost:hover, .btn.secondary:hover { background: var(--bg); filter: none; }
.btn.danger { background: var(--panel); border: 1px solid var(--line); color: var(--danger, var(--hot, #dc2626)); }
.btn.danger:hover { background: #fef3f2; filter: none; }
.btn[disabled], button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Campos ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink);
  padding: 8px 12px; font-size: 14px; line-height: 1.4;
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
label { font-size: 13px; font-weight: 500; }

/* ---------- Tarjetas y cajas ---------- */
.card, .int-card, .box, .panel-card, .kpi, .stat, section.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none;
}

:root { --side-w: 252px; --menu-hover: color-mix(in srgb, var(--ink) 5%, transparent); --menu-on: color-mix(in srgb, var(--ink) 8%, transparent); }

/* ---- 3. Componentes: pestañas, insignias, barras, tablas, títulos, tarjeta destacada (de Setex) ---- */
/* ---------- Cabecera y pestañas: subrayado, texto pequeño y gris; la activa, en tinta ---------- */
.top, .pagebar { border-bottom: 1px solid var(--line); background: var(--panel); }
.views, .acct-tabs, .tabs, .side-tabs { gap: 4px; }
.views button, .acct-tabs button, .tabs button, .side-tabs button {
  border-radius: 0; background: none; box-shadow: none; color: var(--muted);
  font-size: 13px; font-weight: 500; padding: 10px 12px;
  border: 0; border-bottom: 2px solid transparent;
}
.views button:hover, .acct-tabs button:hover, .tabs button:hover, .side-tabs button:hover { color: var(--ink); background: none; }
.views button.on, .acct-tabs button.on, .tabs button.on, .side-tabs button.on {
  color: var(--ink); font-weight: 600; background: none; box-shadow: none; border-bottom-color: var(--ink);
}
.acct-tabs { border-bottom: 1px solid var(--line); }

/* ---------- Insignias ---------- */
.chip, .pill, .badge, .tag {
  border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.4;
}
.chip { background: var(--panel); border: 1px solid var(--line); padding: 4px 10px; }
.badge, .pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; background: #ecfdf3; color: #067647; }
.tag { padding: 2px 10px; background: var(--panel); }
.tag.add { background: transparent; color: var(--muted); }

/* ---------- Barras de progreso y gráficos ---------- */
progress, .progress { border-radius: 999px; }
.progress { height: 10px; background: var(--bg); overflow: hidden; }
.progress > i, .progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bars .col, .chart .col { border-radius: 4px; }
svg .grid line, .chart .gridline { stroke: var(--line); }

/* ---------- Tablas y listas ---------- */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: transparent; text-transform: none; letter-spacing: 0; }
td { padding: 12px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }

/* ---------- Detalle de panel: títulos de sección ---------- */
.sec > h4, #tagsPanel h4, .menu-group, .int-sub {
  font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: none; color: var(--muted);
}

/* ---------- Tarjeta destacada (para cifras o la acción principal), en teal ---------- */
.hero { background: var(--hero); color: #fff; border-radius: var(--radius); padding: 20px 24px; border: 0; }
.hero .muted, .hero small { color: #ffffffb3; }
.hero .btn { background: transparent; border: 1px solid #ffffffcc; color: #fff; }

/* Franja del administrador: mismo teal profundo en lugar de azul marino. */
.asadmin { background: #0b3b38; }

/* Móvil: tamaños táctiles cómodos. */
@media (max-width: 600px) {
  .btn { min-height: 40px; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px; }
}

/* Cifra destacada de Informes: degradado teal con el texto en blanco. */
.tile.hero { background: var(--hero); border: 0; color: #fff; }
.tile.hero .lbl, .tile.hero .det { color: #ffffffcc; }
.tile.hero .val { color: #fff; }



/* ===== MENÚ LATERAL (estilo Holded, como Avania Setex) =====
   <div class="av-app"><aside class="av-side">…</aside><div class="av-content">…</div></div>
   dentro: .brand · .av-acct (tarjeta de cuenta/persona) · .av-nav (filas) · .av-group (rótulo)
           .av-sub (submenú plano) · .av-sep · .av-grow · en móvil: .av-top + .av-scrim + body.av-open */
.av-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.av-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; scrollbar-width: thin; }
.av-side > .brand { padding: 2px 12px 10px; }
.av-content { min-width: 0; }
.av-grow { flex: 1; }
.av-sep { margin: 6px 4px; border-top: 1px solid var(--line); }
.av-acct { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 0 0 8px; text-align: left; min-width: 0; }
.av-acct .av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.av-acct .txt { display: grid; min-width: 0; flex: 1; gap: 1px; }
.av-acct b { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-acct .txt > span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-nav { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 32px; padding: 5px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--ink); background: none; border: 0; text-align: left; text-decoration: none; cursor: pointer; min-width: 0; }
.av-nav > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-nav small { font-size: 11.5px; }
.av-nav:hover { background: var(--menu-hover); }
.av-nav.on, .av-nav[aria-current="page"] { background: var(--menu-on); color: var(--ink); font-weight: 600; }
.av-nav svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: color-mix(in srgb, var(--ink) 72%, var(--panel)); }
.av-nav .chev, .av-nav > svg:last-child:not(:first-child) { margin-left: auto; width: 14px; height: 14px; color: var(--muted); opacity: .8; }
.av-group { font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 12px 12px 4px; }
.av-sub { margin: 1px 0 4px 10px; display: grid; gap: 1px; }
.av-top, .av-scrim { display: none; }
@media (max-width: 860px) {
  .av-app { display: block; }
  .av-side { position: fixed; z-index: 50; left: 0; top: 0; width: min(280px, 86vw); transform: translateX(-102%); transition: transform .22s ease; }
  body.av-open .av-side { transform: none; box-shadow: 0 0 40px #0000004d; }
  body.av-open .av-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: #0006; }
  .av-top { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
}

/* Interruptor pequeño (activado / no activado): <label class="av-switch"><input type="checkbox"><i></i>texto</label> */
.av-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.av-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.av-switch i { position: relative; flex: none; width: 32px; height: 18px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 22%, var(--panel)); transition: background .15s; }
.av-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.av-switch input:checked + i { background: var(--accent); }
.av-switch input:checked + i::after { transform: translateX(14px); }
.av-switch input:focus-visible + i { box-shadow: var(--ring); }

button.av-acct { cursor: pointer; font: inherit; color: inherit; } button.av-acct:hover { background: var(--menu-hover); }
