/* Oficina Bica · estilos comunes (paleta del sitio anterior "BICA / Control de gestión"). */

:root {
  --Azul: #254b8d;
  --Marino: #183760;
  --Cian: #0089be;
  --Verde: #21895c;
  --Lima: #8dbb19;
  --Rojo: #d34d4f;
  --Naranjo: #e89411;
  --Violeta: #6b5797;
  --Tinta: #24374e;
  --Suave: #758295;
  --Linea: #e3e9ef;
  --LineaFuerte: #d6e1ef;
  --Fondo: #f4f7fa;
  --Superficie: rgba(255, 255, 255, 0.92);
  --SuperficieSolida: #ffffff;
  --SuperficieAlta: #eef4fa;
  --Positivo: #21895c;
  --Negativo: #c8444a;
  --Neutro: #947020;
  --Sombra: 0 5px 22px rgba(32, 61, 101, 0.07);
  --SombraFuerte: 0 8px 26px rgba(23, 60, 104, 0.12);
  --Radio: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--Tinta);
  background:
    radial-gradient(ellipse at 85% 0%, #e4eef8 0, transparent 48%),
    linear-gradient(135deg, #f5f8fb, #eff4f8);
  background-attachment: fixed;
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

a { color: var(--Azul); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4rem; color: var(--Tinta); }
h1 { font-size: clamp(24px, 2.1vw, 30px); font-weight: 650; letter-spacing: -0.6px; }
h2 { font-size: 1.05rem; font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--Cian); outline-offset: 2px; }

.Ceja { margin: 0 0 6px; color: var(--Azul); font-size: 10.5px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; }
.Nota { color: var(--Suave); font-size: 12.5px; margin: 8px 0 0; }
.Positivo { color: var(--Positivo); }
.Negativo { color: var(--Negativo); }
.Cargando { color: var(--Suave); padding: 28px 0; text-align: center; }

/* Botones y controles */
.Boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px;
  border: 1px solid var(--LineaFuerte); border-radius: 8px;
  background: var(--SuperficieSolida); color: var(--Tinta);
  font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.Boton:hover { border-color: var(--Azul); color: var(--Azul); }
.BotonPrimario { background: var(--Azul); border-color: var(--Azul); color: #fff; }
.BotonPrimario:hover { background: var(--Marino); color: #fff; }
select, input[type="search"], input[type="text"] {
  min-height: 34px; padding: 5px 10px;
  border: 1px solid var(--LineaFuerte); border-radius: 9px;
  background: var(--SuperficieSolida); color: var(--Tinta);
  font: inherit; font-size: 13px;
}
.Segmentado { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--LineaFuerte); border-radius: 9px; background: var(--SuperficieSolida); }
.Segmentado button {
  min-width: 38px; padding: 5px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--Suave); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer;
}
.Segmentado button[aria-pressed="true"] { background: var(--Azul); color: #fff; box-shadow: 0 3px 10px rgba(37, 75, 141, 0.25); }
.Segmentado button:not([aria-pressed="true"]):hover { color: var(--Azul); background: var(--SuperficieAlta); }

/* Superficies */
.Panel {
  background: var(--Superficie);
  border: 1px solid var(--LineaFuerte);
  border-top: 3px solid var(--Azul);
  border-radius: var(--Radio);
  box-shadow: var(--Sombra);
  padding: 16px 18px;
  min-width: 0;
  backdrop-filter: blur(14px);
}
.Aviso { padding: 10px 14px; border-radius: 10px; background: #e7f1fb; color: var(--Tinta); font-size: 13px; margin-bottom: 14px; }
.Aviso.Error { background: #fbeaea; color: #8a2d30; }

/* Encabezado simple (Oficina e ingreso) */
.Encabezado {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--Linea);
}
.Marca { display: flex; align-items: center; gap: 10px; color: var(--Tinta); text-decoration: none; min-width: 0; }
.Marca img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.Marca strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.Marca small { display: block; color: var(--Suave); font-size: 12px; }
.Usuario { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--Suave); font-size: 13px; }
.Usuario .Nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.Contenido { max-width: 1200px; margin: 0 auto; padding: 24px 20px 40px; }
.Subtitulo { color: var(--Suave); margin: 0 0 20px; }

/* Tarjetas de la Oficina */
.Tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.Tarjeta {
  display: block; padding: 18px;
  background: var(--Superficie); border: 1px solid var(--LineaFuerte); border-top: 3px solid var(--Cian);
  border-radius: var(--Radio); box-shadow: var(--Sombra);
  color: var(--Tinta); text-decoration: none;
}
.Tarjeta:hover { box-shadow: var(--SombraFuerte); transform: translateY(-1px); }
.Tarjeta small { color: var(--Azul); text-transform: uppercase; letter-spacing: 1.4px; font-size: 10.5px; font-weight: 700; }
.Tarjeta strong { display: block; font-size: 17px; margin: 4px 0 6px; }
.Tarjeta p { margin: 0; color: var(--Suave); font-size: 13px; }

/* Tablas */
.ContenedorTabla { overflow: auto; -webkit-overflow-scrolling: touch; }
.Tabla { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.Tabla th, .Tabla td { padding: 7px 10px; border-bottom: 1px solid var(--Linea); text-align: right; white-space: nowrap; }
.Tabla th:first-child, .Tabla td:first-child { text-align: left; position: sticky; left: 0; background: var(--SuperficieSolida); z-index: 1; }
.Tabla thead th { position: sticky; top: 0; z-index: 2; color: var(--Suave); font-weight: 650; background: var(--SuperficieSolida); }
.Tabla thead th:first-child { z-index: 3; }
.Tabla .Texto { text-align: left; white-space: normal; min-width: 14ch; }
.Tabla tr.Grupo td { font-weight: 700; background: var(--SuperficieAlta); cursor: pointer; }
.Tabla tr.Grupo td:first-child { background: var(--SuperficieAlta); }
.Tabla tr.Subgrupo td { font-weight: 650; }
.Tabla tr.Detalle td:first-child { padding-left: 26px; color: var(--Suave); }
.Tabla tbody tr:hover td { background: #f3f8fd; }

/* Pie */
.Pie { max-width: 1200px; margin: 0 auto; padding: 0 20px 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); color: var(--Suave); font-size: 12px; }

/* Ingreso */
body.Ingreso { display: grid; place-items: center; padding: 16px; }
.TarjetaIngreso {
  width: 100%; max-width: 390px; text-align: center;
  background: var(--Superficie); border: 1px solid var(--LineaFuerte); border-top: 3px solid var(--Azul);
  border-radius: 18px; box-shadow: var(--SombraFuerte); padding: 30px 26px;
}
.LogoIngreso { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto 18px; }
.TarjetaIngreso .Boton { width: 100%; min-height: 42px; margin-top: 8px; font-size: 14px; }
.TarjetaIngreso .Aviso { margin: 16px 0 0; text-align: left; }

@media (max-width: 560px) {
  .Usuario .Nombre { display: none; }
  .Contenido { padding: 18px 14px 32px; }
}
