/* ==========================================================================
   GoFast Tech · Sistema Integral de Gestión
   ========================================================================== */
:root {
  --azul: #0b2545;
  --azul-2: #123a5c;
  --azul-3: #1b4d75;
  --teal: #0e9f9a;
  --teal-2: #0b807c;
  --teal-suave: #e6f6f5;
  --fondo: #f2f6fa;
  --blanco: #ffffff;
  --texto: #1e293b;
  --texto-2: #475569;
  --muted: #64748b;
  --linea: #dce5ee;
  --linea-suave: #eef3f8;
  --verde: #047857;
  --verde-suave: #e7f6ef;
  --rojo: #b91c1c;
  --rojo-suave: #fdecec;
  --ambar: #b45309;
  --ambar-suave: #fef3e2;
  --azul-suave: #e8f0fa;
  --sombra: 0 1px 2px rgba(15, 35, 60, .06), 0 8px 24px rgba(15, 35, 60, .06);
  --radio: 14px;
  --radio-sm: 9px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-2); text-decoration: none; }
a:hover { color: var(--teal); }
h1, h2, h3, h4 { color: var(--azul); margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .7rem; }
small { color: var(--muted); }

/* --------------------------------------------------------------------------
   Estructura general
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: linear-gradient(180deg, #0b2545 0%, #09203c 100%);
  color: #cfe0f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.marca {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  gap: 11px;
}
.marca .logo-caja {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--teal), #12c2bb);
  display: grid; place-items: center;
  font-weight: 800; color: #06213c; font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(14, 159, 154, .35);
}
.marca .nombre { font-size: 1.02rem; font-weight: 700; color: #fff; letter-spacing: .01em; }
.marca .nombre span { color: #35d6cf; }
.marca .bajada { font-size: .68rem; color: #8faecb; letter-spacing: .08em; text-transform: uppercase; }
/* Logo real de Multiservicios Go Fast CR (reemplaza la caja con la letra G) */
.marca .logo-marca {
  width: 48px; height: 48px; flex: 0 0 48px;
  object-fit: contain; padding: 3px; box-sizing: border-box;
  border-radius: 12px; background: #0a0d12;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}
.logo-hero {
  display: block; width: min(170px, 62%); height: auto;
  margin: 4px auto 10px; padding: 8px; box-sizing: border-box;
  border-radius: 18px; background: #080b10;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}

.nav { padding: 12px 12px 20px; flex: 1; }
.nav-grupo { margin-top: 14px; }
.nav-grupo:first-child { margin-top: 4px; }
.nav-titulo {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #7e9cba;
  padding: 0 10px 6px;
  font-weight: 600;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #c7d9e9;
  font-size: .865rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
  margin-bottom: 1px;
}
.nav a svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .8; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.activo { background: linear-gradient(90deg, rgba(14, 159, 154, .9), rgba(14, 159, 154, .65)); color: #fff; box-shadow: 0 4px 12px rgba(14, 159, 154, .25); }
.nav a.activo svg { opacity: 1; }
.nav-pie { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .72rem; color: #7e9cba; }
.nav-pie strong { color: #bfd6ea; display: block; font-size: .78rem; }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linea);
  padding: 13px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .titulo { flex: 1 1 220px; min-width: 180px; }
.topbar .titulo .ruta { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .titulo h1 { font-size: 1.22rem; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .acciones { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; flex: 0 1 auto; max-width: 62%; }

.usuario-caja { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--linea); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal-suave); color: var(--teal-2);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  border: 1px solid #cdeeea;
}
.usuario-caja .datos { line-height: 1.2; }
.usuario-caja .datos strong { display: block; font-size: .8rem; color: var(--azul); }
.usuario-caja .datos span { font-size: .7rem; color: var(--muted); }

.contenido { padding: 24px 26px 46px; max-width: 1360px; width: 100%; margin: 0 auto; }

.btn-menu { display: none; }

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: all .15s ease;
  white-space: nowrap;
  font-family: inherit;
  background: var(--blanco);
  color: var(--texto-2);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primario { background: linear-gradient(135deg, var(--teal), var(--teal-2)); color: #fff; box-shadow: 0 5px 14px rgba(14, 159, 154, .28); }
.btn-primario:hover { color: #fff; box-shadow: 0 8px 18px rgba(14, 159, 154, .34); }
.btn-azul { background: var(--azul); color: #fff; }
.btn-azul:hover { color: #fff; background: var(--azul-2); }
.btn-borde { background: #fff; border-color: var(--linea); color: var(--texto-2); }
.btn-borde:hover { border-color: #b9cbe0; color: var(--azul); background: #fafcff; }
.btn-peligro { background: #fff; border-color: #f3c9c9; color: var(--rojo); }
.btn-peligro:hover { background: var(--rojo-suave); }
.btn-suave { background: var(--teal-suave); color: var(--teal-2); }
.btn-suave:hover { background: #d6f2f0; }
.btn-sm { padding: 5px 10px; font-size: .75rem; border-radius: 7px; }
/* Los SVG en línea no tienen tamaño por defecto: sin esto los botones de sólo ícono
   se renderizan como cápsulas vacías. */
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; display: block; }
.btn-sm svg { width: 14px; height: 14px; flex-basis: 14px; }
.btn-icono { padding: 7px 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-bloque { width: 100%; }

/* --------------------------------------------------------------------------
   Tarjetas y paneles
   -------------------------------------------------------------------------- */
.card {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--linea-suave);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-header h2, .card-header h3 { margin: 0; }
.card-header .sub { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.card-header .der { margin-left: auto; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.sin-padding { padding: 0; }
.card-pie { padding: 12px 18px; border-top: 1px solid var(--linea-suave); background: #fbfdff; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.col-span-2 { grid-column: span 2; }

/* Estadísticas */
.stat {
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 16px 17px;
  box-shadow: var(--sombra);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -22px; top: -22px; width: 74px; height: 74px;
  border-radius: 50%; background: var(--teal-suave); opacity: .8;
}
.stat .etiqueta { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .valor { font-size: 1.62rem; font-weight: 750; color: var(--azul); letter-spacing: -.02em; margin-top: 4px; }
.stat .detalle { font-size: .74rem; color: var(--muted); margin-top: 3px; }
.stat.verde .valor { color: var(--verde); }
.stat.rojo .valor { color: var(--rojo); }
.stat.ambar .valor { color: var(--ambar); }

/* --------------------------------------------------------------------------
   Tablas
   -------------------------------------------------------------------------- */
.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.tabla th {
  text-align: left;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 14px;
  background: #f8fbfe;
  border-bottom: 1px solid var(--linea);
  white-space: nowrap;
}
table.tabla td { padding: 11px 14px; border-bottom: 1px solid var(--linea-suave); vertical-align: middle; }
table.tabla tr:last-child td { border-bottom: 0; }
table.tabla tbody tr:hover { background: #fafdff; }
table.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tabla .acciones { text-align: right; white-space: nowrap; }
table.tabla .principal-celda { font-weight: 600; color: var(--azul); }
table.tabla .secundario { font-size: .73rem; color: var(--muted); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--azul-suave);
  color: var(--azul-3);
}
.badge.ok { background: var(--verde-suave); color: var(--verde); }
.badge.warn { background: var(--ambar-suave); color: var(--ambar); }
.badge.danger { background: var(--rojo-suave); color: var(--rojo); }
.badge.muted { background: #eef2f6; color: var(--muted); }
.badge.teal { background: var(--teal-suave); color: var(--teal-2); }
.badge.punto::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.estado-RECIBIDO { background: var(--azul-suave); color: var(--azul-3); }
.estado-DIAGNOSTICO { background: #ede9fe; color: #6d28d9; }
.estado-COTIZADO { background: var(--ambar-suave); color: var(--ambar); }
.estado-AUTORIZADO { background: #e0f2fe; color: #0369a1; }
.estado-EN_REPARACION { background: #fef0e7; color: #c2410c; }
.estado-CONTROL_CALIDAD { background: #f3e8ff; color: #7e22ce; }
.estado-LISTO { background: var(--verde-suave); color: var(--verde); }
.estado-ENTREGADO { background: #e8eef5; color: #445b73; }
.estado-CANCELADO { background: var(--rojo-suave); color: var(--rojo); }

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo.ancho { grid-column: 1 / -1; }
.campo label { font-size: .76rem; font-weight: 650; color: var(--texto-2); }
.campo label .req { color: var(--rojo); }
.campo .pista { font-size: .7rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="datetime-local"], input[type="number"], input[type="file"], input[type="search"],
select, textarea {
  width: 100%;
  border: 1px solid var(--linea);
  border-radius: var(--radio-sm);
  padding: 9px 11px;
  font-size: .85rem;
  font-family: inherit;
  color: var(--texto);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 159, 154, .13);
}
textarea { min-height: 78px; resize: vertical; }
input[readonly] { background: #f6f9fc; color: var(--texto-2); }
.campo-check { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--texto-2); }
.campo-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.mensaje-wa { white-space: pre-wrap; word-wrap: break-word; background: #f8fafc; border: 1px solid var(--linea); border-radius: 8px; padding: 12px; font-size: .78rem; line-height: 1.55; color: var(--texto-2); max-height: 330px; overflow: auto; font-family: inherit; margin: 6px 0 0; }
.fila-repuesto { border: 1px solid var(--linea); border-radius: 9px; padding: 12px 12px 10px; margin-bottom: 10px; background: #fcfdff; }
.fila-repuesto .quitar-fila { margin-top: 8px; }
.form-acciones { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
fieldset { border: 1px solid var(--linea); border-radius: var(--radio-sm); padding: 14px; margin: 0 0 14px; }
legend { font-size: .76rem; font-weight: 700; color: var(--azul); padding: 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.fila-en-linea { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Filtros */
.filtros {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--linea-suave);
  background: #fbfdff;
}
.filtros .campo { min-width: 140px; }
.filtros .crecer { flex: 1; min-width: 190px; }

/* Chips de estado */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--linea); background: #fff;
  font-size: .75rem; color: var(--texto-2); font-weight: 600;
}
.chip:hover { border-color: var(--teal); color: var(--teal-2); }
.chip.activo { background: var(--azul); border-color: var(--azul); color: #fff; }
.chip .cuenta { background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 0 6px; font-size: .68rem; }
.chip.activo .cuenta { background: rgba(255, 255, 255, .2); }

/* --------------------------------------------------------------------------
   Alertas y mensajes
   -------------------------------------------------------------------------- */
.flashes { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.alerta {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 14px; border-radius: 10px; font-size: .83rem;
  border: 1px solid transparent;
}
.alerta.success { background: var(--verde-suave); color: #065f46; border-color: #c7ead9; }
.alerta.error { background: var(--rojo-suave); color: #991b1b; border-color: #f6d1d1; }
.alerta.warning { background: var(--ambar-suave); color: #92400e; border-color: #f8e0bb; }
.alerta.info { background: var(--azul-suave); color: #1e40af; border-color: #cfe0f6; }
.alerta .cerrar { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; font-size: 1rem; opacity: .6; }
.alerta .cerrar:hover { opacity: 1; }

.aviso {
  padding: 13px 15px;
  border-radius: var(--radio-sm);
  background: #f8fbfe;
  border: 1px dashed var(--linea);
  color: var(--muted);
  font-size: .82rem;
}
.vacio { padding: 36px 18px; text-align: center; color: var(--muted); }
.vacio strong { display: block; color: var(--texto-2); font-size: .92rem; margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-pantalla {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--fondo);
}
.login-lado {
  background:
    radial-gradient(circle at 15% 15%, rgba(14, 159, 154, .22), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(27, 77, 117, .5), transparent 50%),
    linear-gradient(160deg, #0b2545, #071a30);
  color: #d7e6f4;
  padding: 54px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-lado::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(14, 159, 154, .28); right: -120px; bottom: -110px;
}
.login-lado .marca { border: 0; padding: 0; }
.login-lado h2 { color: #fff; font-size: 2rem; line-height: 1.2; margin: 30px 0 12px; letter-spacing: -.02em; }
.login-lado p { color: #a9c3da; max-width: 430px; font-size: .92rem; }
.login-lista { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.login-lista li { display: flex; gap: 9px; align-items: center; font-size: .84rem; color: #c4d8e9; }
.login-lista .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(14, 159, 154, .16); }
.login-firma { font-size: .72rem; color: #6f90ae; letter-spacing: .06em; text-transform: uppercase; line-height: 1.9; }
.login-firma .credito { display: inline-block; margin-top: 4px; color: #7ce0d8; font-weight: 700; letter-spacing: .09em; text-transform: none; }

.login-caja { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 372px; }
.login-form h1 { font-size: 1.55rem; }
.login-form .sub { color: var(--muted); font-size: .86rem; margin: 5px 0 24px; }
.login-form .campo { margin-bottom: 14px; }
.login-form .btn { margin-top: 6px; padding: 11px; }
.login-pie { margin-top: 22px; text-align: center; font-size: .72rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.grafico { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding: 8px 4px 0; }
.grafico .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.grafico .barras { display: flex; gap: 5px; align-items: flex-end; width: 100%; justify-content: center; height: 100%; }
.grafico .barra { width: 15px; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .4s ease; }
.grafico .barra.ingreso { background: linear-gradient(180deg, #18c3bd, var(--teal)); }
.grafico .barra.gasto { background: linear-gradient(180deg, #f3b47a, #e08d3c); }
.grafico .mes { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.leyenda { display: flex; gap: 14px; font-size: .72rem; color: var(--muted); align-items: center; }
.leyenda i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 4px; }
.leyenda .i1 { background: var(--teal); }
.leyenda .i2 { background: #e08d3c; }

.lista-mini { list-style: none; margin: 0; padding: 0; }
.lista-mini li { display: flex; gap: 10px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--linea-suave); font-size: .82rem; }
.lista-mini li:last-child { border-bottom: 0; }
.lista-mini .crecer { flex: 1; min-width: 0; }
.lista-mini .crecer strong { display: block; color: var(--texto); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-mini .crecer small { display: block; }
.lista-mini .valor { font-weight: 700; color: var(--azul); white-space: nowrap; font-size: .8rem; }

.barra-prog { height: 7px; background: #eaf1f7; border-radius: 999px; overflow: hidden; }
.barra-prog span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #25c7c1); }

/* --------------------------------------------------------------------------
   Detalle de orden / pestañas
   -------------------------------------------------------------------------- */
.cabecera-detalle {
  background: linear-gradient(135deg, var(--azul), var(--azul-2));
  color: #dbe9f6;
  border-radius: var(--radio);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--sombra);
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cabecera-detalle h1 { color: #fff; font-size: 1.35rem; }
.cabecera-detalle .sub { color: #a8c4dc; font-size: .8rem; margin-top: 3px; }
.cabecera-detalle .der { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; }
.cabecera-detalle .total { font-size: 1.3rem; font-weight: 750; color: #35d6cf; }

.datos-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; font-size: .83rem; }
.datos-lista .dato { display: flex; flex-direction: column; }
.datos-lista .dato span { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.datos-lista .dato strong { font-weight: 600; color: var(--texto); word-break: break-word; }

.bloque { border-top: 1px solid var(--linea-suave); padding-top: 16px; margin-top: 16px; }
.bloque:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.bloque-titulo { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.bloque-titulo h3 { margin: 0; }
.bloque-titulo .der { margin-left: auto; }

.sello {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #eaf4fc; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}

.check-lista { list-style: none; padding: 0; margin: 0; }
.check-lista li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--linea-suave); align-items: flex-start; font-size: .84rem; }
.check-lista li:last-child { border-bottom: 0; }
.check-lista .marca-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--linea); display: grid; place-items: center; font-size: .66rem; color: #fff; flex: 0 0 18px; margin-top: 1px; }
.check-lista .hecho .marca-check { background: var(--teal); border-color: var(--teal); }
.check-lista .hecho .texto { text-decoration: line-through; color: var(--muted); }
.check-lista .texto { flex: 1; }
.check-lista .meta { font-size: .72rem; color: var(--muted); }

.galeria { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.galeria .foto { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--linea); background: #f6f9fc; aspect-ratio: 4 / 3; }
.galeria .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeria .foto form { position: absolute; top: 5px; right: 5px; }

.firma-caja { border: 1px dashed #c4d3e2; border-radius: 10px; background: #fbfdff; padding: 8px; }
.firma-caja canvas { width: 100%; height: 140px; display: block; border-radius: 6px; background: #fff; touch-action: none; cursor: crosshair; }
.firma-acciones { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: .72rem; color: var(--muted); }

/* Tabs / anclas */
.anclas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.anclas a { font-size: .76rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--linea); color: var(--texto-2); }
.anclas a:hover { border-color: var(--teal); color: var(--teal-2); }

/* Totales */
.totales { margin-left: auto; width: min(330px, 100%); font-size: .86rem; }
.totales .fila { display: flex; justify-content: space-between; padding: 6px 0; color: var(--texto-2); }
/* Etiqueta a la izquierda, importes a la derecha y con cifras tabulares:
   Subtotal, IVA y TOTAL quedan alineados al mismo borde derecho. */
.totales .fila > :last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 16px; }
.totales .fila.total { border-top: 2px solid var(--teal); margin-top: 5px; padding-top: 9px; font-weight: 750; color: var(--azul); font-size: 1.02rem; }
.monto { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Documentos */
.doc-acciones { display: flex; gap: 7px; flex-wrap: wrap; }

/* Empresa / logo */
.logo-preview { max-width: 190px; max-height: 80px; border: 1px solid var(--linea); border-radius: 8px; padding: 6px; background: #fff; }

/* Separadores y utilidades */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.texto-der { text-align: right; }
.texto-centro { text-align: center; }
.muted { color: var(--muted); }
.pequeno { font-size: .76rem; }
.mini { font-size: .7rem; }
.fuerte { font-weight: 700; color: var(--azul); }
.verde { color: var(--verde); }
.rojo { color: var(--rojo); }
.ambar { color: var(--ambar); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .login-pantalla { grid-template-columns: 1fr; }
  .login-lado { display: none; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 12px 0 40px rgba(3, 16, 32, .3);
  }
  .sidebar.abierta { transform: translateX(0); }
  .btn-menu { display: inline-flex; }
  .topbar { padding: 11px 16px; }
  .contenido { padding: 18px 16px 40px; }
  .usuario-caja .datos { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .galeria { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .datos-lista { grid-template-columns: 1fr; }
  .cabecera-detalle .der { text-align: left; align-items: flex-start; }
  .fondo-menu { position: fixed; inset: 0; background: rgba(4, 16, 30, .45); z-index: 35; }
  .fondo-menu[hidden] { display: none; }
}

@media (max-width: 620px) {
  .stat .valor { font-size: 1.35rem; }
  .topbar .acciones .ocultar-movil { display: none; }
  .filtros { flex-direction: column; align-items: stretch; }
  .card-header { align-items: flex-start; }
  .card-header .der { margin-left: 0; width: 100%; }
  .grafico { gap: 7px; }
  .grafico .barra { width: 9px; }
}

@media print {
  .sidebar, .topbar, .flashes, .btn, .anclas, .no-imprimir { display: none !important; }
  .app { display: block; }
  .contenido { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}
