/* =====================================================================
   TALLER - Sistema de facturación   |   Diseño responsivo (PC / tablet / celular)
   ===================================================================== */
:root {
  --c-primario: #1f4e79;
  --c-primario-osc: #163a5a;
  --c-acento: #f28c28;
  --c-acento-osc: #d9741a;
  --c-ok: #1e8e5a;
  --c-peligro: #c8372d;
  --c-aviso: #b7791f;
  --c-fondo: #f2f4f7;
  --c-panel: #ffffff;
  --c-borde: #dde2e8;
  --c-texto: #1d2733;
  --c-suave: #6b7785;
  --c-side: #14212e;
  --c-side-txt: #c6d1dc;
  --radio: 10px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --side-w: 250px;
  --top-h: 58px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px; color: var(--c-texto); background: var(--c-fondo);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--c-primario); }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
.oculto { display: none !important; }
.suave { color: var(--c-suave); }
.peq { font-size: .85rem; }
.derecha { text-align: right; }
.centro { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ------------------------------ Iconos ------------------------------ */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ------------------------------ Layout ------------------------------ */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 30;
  display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  background: var(--c-primario); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topbar .marca { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; min-width: 0; }
.topbar .marca span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .espacio { flex: 1; }
.topbar .quien { font-size: .85rem; text-align: right; line-height: 1.2; opacity: .95; }
.topbar .quien small { display: block; opacity: .75; }
.btn-menu {
  background: transparent; border: 0; color: #fff; width: 42px; height: 42px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.4rem;
}
.btn-menu:hover { background: rgba(255,255,255,.12); }

.sidebar {
  position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); z-index: 25;
  background: var(--c-side); color: var(--c-side-txt); overflow-y: auto;
  transition: transform .25s ease; padding: .75rem 0 2rem;
}
.sidebar .grupo { padding: .9rem 1.25rem .35rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #7f8fa0; }
.sidebar a {
  display: flex; align-items: center; gap: .7rem; padding: .7rem 1.25rem; color: var(--c-side-txt);
  text-decoration: none; border-left: 3px solid transparent; font-size: .95rem;
}
.sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar a.activo { background: rgba(242,140,40,.12); border-left-color: var(--c-acento); color: #fff; }
.velo { position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.45); z-index: 24; display: none; }

.contenido { margin-left: var(--side-w); padding: calc(var(--top-h) + 1.25rem) 1.5rem 3rem; min-height: 100vh; transition: margin .25s ease; }
body.menu-colapsado .sidebar { transform: translateX(-100%); }
body.menu-colapsado .contenido { margin-left: 0; }

/* Tablet y celular: menú tipo cajón (oculto por defecto) */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: 4px 0 18px rgba(0,0,0,.25); }
  body.menu-abierto .sidebar { transform: translateX(0); }
  body.menu-abierto .velo { display: block; }
  .contenido { margin-left: 0; padding: calc(var(--top-h) + 1rem) 1rem 3rem; }
}
@media (max-width: 600px) {
  .topbar .quien { display: none; }
  .contenido { padding: calc(var(--top-h) + .75rem) .6rem 5rem; }
}

/* ------------------------------ Tarjetas ------------------------------ */
.cabecera-vista { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.cabecera-vista h1 { margin: 0; flex: 1 1 auto; }
.cabecera-vista .acciones { display: flex; flex-wrap: wrap; gap: .5rem; }
.panel { background: var(--c-panel); border: 1px solid var(--c-borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.1rem; margin-bottom: 1rem; }
.panel > h2, .panel > h3 { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 600px) { .panel { padding: .85rem; border-radius: 8px; } }

/* ------------------------------ Formularios ------------------------------ */
.grid { display: grid; gap: .85rem; grid-template-columns: repeat(12, 1fr); }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; }
.c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; } .c-2 { grid-column: span 2; }
@media (max-width: 900px) { .c-3, .c-2 { grid-column: span 6; } .c-4, .c-8 { grid-column: span 12; } }
@media (max-width: 600px) { .c-6, .c-3, .c-2 { grid-column: span 12; } }

label.campo { display: block; }
label.campo > span { display: block; font-size: .82rem; font-weight: 600; color: #3f4b58; margin-bottom: .3rem; }
.req::after { content: " *"; color: var(--c-peligro); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: .62rem .75rem; font: inherit; color: inherit; background: #fff;
  border: 1px solid #c9d1da; border-radius: 8px; min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primario); box-shadow: 0 0 0 3px rgba(31,78,121,.18); }
input[readonly] { background: #f3f5f8; color: #4a5562; }
input.mayus { text-transform: uppercase; }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--c-ok); cursor: pointer; }
.input-grupo { display: flex; gap: .4rem; align-items: stretch; }
.input-grupo > input { flex: 1; min-width: 0; }

/* ------------------------------ Botones ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1rem; min-height: 42px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  background: #e8ecf1; color: var(--c-texto); transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--c-primario); color: #fff; }
.btn-primario:hover { background: var(--c-primario-osc); }
.btn-acento { background: var(--c-acento); color: #fff; }
.btn-acento:hover { background: var(--c-acento-osc); }
.btn-ok { background: var(--c-ok); color: #fff; }
.btn-peligro { background: var(--c-peligro); color: #fff; }
.btn-borde { background: #fff; border-color: #c9d1da; }
.btn-borde:hover { background: #f4f6f9; }
.btn-ico { padding: 0; width: 42px; min-width: 42px; }
.btn-sm { min-height: 34px; padding: .35rem .65rem; font-size: .85rem; }
.btn-sm.btn-ico { width: 34px; min-width: 34px; }
.btn-texto { background: transparent; border: 0; color: var(--c-primario); padding: .25rem .4rem; min-height: auto; }

/* ------------------------------ Tablas ------------------------------ */
.tabla-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-suave); background: #f6f8fa; padding: .6rem .7rem; border-bottom: 1px solid var(--c-borde); white-space: nowrap; }
.tabla td { padding: .6rem .7rem; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
.tabla tbody tr:hover { background: #fafbfd; }
.tabla .acc { white-space: nowrap; text-align: right; }
.tabla .acc .btn { margin-left: .25rem; }

/* Tabla tipo "tarjetas" en celulares */
@media (max-width: 700px) {
  table.tabla.resp thead { display: none; }
  table.tabla.resp, .tabla.resp tbody, .tabla.resp tr, .tabla.resp td { display: block; width: 100%; }
  .tabla.resp tr { border: 1px solid var(--c-borde); border-radius: 8px; margin-bottom: .6rem; padding: .35rem .2rem; background: #fff; }
  .tabla.resp td { border: 0; padding: .3rem .7rem; text-align: right; overflow: hidden; }
  .tabla.resp td::before { content: attr(data-l); float: left; margin-right: 1rem; font-weight: 600; color: var(--c-suave); font-size: .8rem; text-align: left; }
  .tabla.resp td.acc { padding-top: .5rem; }
  .tabla.resp td:empty, .tabla.resp td.vacio::before { display: none; }
  .tabla.resp tfoot tr { background: #f6f8fa; }
  .tabla.resp td.acc::before { content: none; }
}

.badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.b-ok { background: #def5ea; color: #136b43; }
.b-no { background: #fde3e1; color: #a12a21; }
.b-info { background: #e1ecf7; color: #1f4e79; }
.b-aviso { background: #fdf0d9; color: #8a5a10; }

.filtros { display: grid; gap: .6rem; grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: end; margin-bottom: 1rem; }
@media (max-width: 900px) { .filtros { grid-template-columns: 1fr 1fr !important; } .filtros > :first-child { grid-column: span 2; } }
.paginador { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; font-size: .88rem; color: var(--c-suave); }
.paginador .btns { display: flex; gap: .35rem; }
.vacio { text-align: center; color: var(--c-suave); padding: 2rem 1rem; }

/* ------------------------------ Modal ------------------------------ */
.modal-fondo { position: fixed; inset: 0; background: rgba(15,23,32,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; animation: aparecer .15s; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; box-shadow: 0 20px 50px rgba(0,0,0,.3); display: flex; flex-direction: column; max-height: 92vh; }
.modal.grande { max-width: 960px; }
.modal-cab { display: flex; align-items: center; gap: .5rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--c-borde); }
.modal-cab h3 { flex: 1; margin: 0; }
.modal-cuerpo { padding: 1.1rem; overflow-y: auto; }
.modal-pie { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; padding: .8rem 1.1rem; border-top: 1px solid var(--c-borde); }
@media (max-width: 600px) {
  .modal-fondo { padding: 0; align-items: stretch; }
  .modal, .modal.grande { max-width: none; max-height: none; min-height: 100%; border-radius: 0; }
  .modal-pie .btn { flex: 1; }
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------ Toast / carga ------------------------------ */
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .5rem; max-width: min(92vw, 380px); }
.toast { background: #1d2733; color: #fff; padding: .75rem 1rem; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: .92rem; animation: aparecer .2s; border-left: 4px solid var(--c-acento); }
.toast.ok { border-left-color: #3cc985; }
.toast.error { border-left-color: #ff6b5e; }
#cargando { position: fixed; inset: 0; z-index: 300; background: rgba(255,255,255,.55); display: none; align-items: center; justify-content: center; }
#cargando.si { display: flex; }
.spinner { width: 42px; height: 42px; border: 4px solid #cfd8e3; border-top-color: var(--c-primario); border-radius: 50%; animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ------------------------------ Autocompletar ------------------------------ */
.auto { position: relative; }
.auto-lista { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid var(--c-borde); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; }
.auto-item { padding: .6rem .8rem; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.auto-item:last-child { border-bottom: 0; }
.auto-item:hover, .auto-item.sel { background: #eef4fa; }
.auto-item b { display: block; font-weight: 600; }
.auto-item small { color: var(--c-suave); }

/* ------------------------------ Factura ------------------------------ */
.estado-chip { display: inline-flex; align-items: center; gap: .35rem; }
.cliente-ficha { margin-top: .7rem; background: #f6f9fc; border: 1px dashed #c4d3e2; border-radius: 8px; padding: .65rem .8rem; font-size: .9rem; display: grid; gap: .2rem .9rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cliente-ficha b { color: var(--c-primario); }

.seccion { border: 1px solid var(--c-borde); border-radius: var(--radio); margin-bottom: .9rem; background: #fff; overflow: hidden; }
.seccion-cab { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; background: linear-gradient(90deg, #1f4e79, #2a6496); color: #fff; cursor: pointer; user-select: none; }
.seccion-cab h3 { margin: 0; flex: 1; font-size: 1rem; letter-spacing: .03em; }
.seccion-cab .sub { font-weight: 700; background: rgba(255,255,255,.15); padding: .15rem .55rem; border-radius: 6px; font-size: .9rem; }
.seccion-cab .flecha { transition: transform .2s; }
.seccion.cerrada .flecha { transform: rotate(-90deg); }
.seccion.cerrada .seccion-cuerpo { display: none; }
.seccion-cuerpo { padding: .4rem .9rem .9rem; }

.trabajo { display: grid; grid-template-columns: minmax(170px, 1.3fr) 2fr 130px 70px; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid #f0f2f5; }
.trabajo.cab { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-suave); font-weight: 700; border-bottom: 1px solid var(--c-borde); }
.trabajo .nombre { font-weight: 600; font-size: .9rem; }
.trabajo.hecho .nombre { color: var(--c-ok); }
.trabajo input[type=text], .trabajo input[type=number] { min-height: 38px; padding: .45rem .6rem; }
.trabajo .chk { display: flex; justify-content: center; }
.trabajo .chk input { width: 24px; height: 24px; }
@media (max-width: 700px) {
  .trabajo.cab { display: none; }
  .trabajo { grid-template-columns: 1fr 110px 44px; grid-template-areas: "n v c" "t t t"; padding: .6rem 0; }
  .trabajo .nombre { grid-area: n; }
  .trabajo .nota { grid-area: t; }
  .trabajo .valor { grid-area: v; }
  .trabajo .chk { grid-area: c; }
}
.seccion-extra { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: .8rem; }
@media (max-width: 800px) { .seccion-extra { grid-template-columns: 1fr; } }

.fotos { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.foto { position: relative; width: 86px; height: 86px; border-radius: 8px; overflow: hidden; background: #e9edf2; border: 1px solid var(--c-borde); }
.foto img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.foto .quitar { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(200,55,45,.92); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
.foto .peso { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: .68rem; text-align: center; padding: 1px 0; }
.foto-btns { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

.carrito-busca { margin-bottom: .8rem; }
.carrito td input[type=number] { width: 90px; min-height: 36px; padding: .35rem .5rem; }
.nota-linea { font-size: .8rem; color: var(--c-suave); margin-top: .15rem; font-style: italic; }

.totales { display: grid; gap: .4rem; max-width: 380px; margin-left: auto; }
.totales div { display: flex; justify-content: space-between; gap: 1rem; font-size: .98rem; }
.totales .gran { font-size: 1.3rem; font-weight: 800; color: var(--c-primario); border-top: 2px solid var(--c-primario); padding-top: .5rem; margin-top: .2rem; }

.barra-guardar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; padding: .75rem 1rem; background: rgba(255,255,255,.96); border-top: 1px solid var(--c-borde); box-shadow: 0 -4px 14px rgba(0,0,0,.06); margin: 0 -1.5rem -3rem; backdrop-filter: blur(4px); }
.barra-guardar .tot { margin-right: auto; font-weight: 800; font-size: 1.15rem; color: var(--c-primario); align-self: center; }
@media (max-width: 1023px) { .barra-guardar { margin: 0 -1rem -3rem; } }
@media (max-width: 600px) { .barra-guardar { margin: 0 -.6rem -5rem; padding: .6rem; } .barra-guardar .btn { flex: 1; } .barra-guardar .tot { width: 100%; text-align: center; } }

/* Visor de fotos */
.visor { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 400; display: flex; align-items: center; justify-content: center; padding: 1rem; cursor: zoom-out; }
.visor img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* Importación */
.zona-archivo { display: block; border: 2px dashed #b8c6d6; border-radius: 10px; padding: 1.4rem; text-align: center; background: #f8fafc; cursor: pointer; }
.zona-archivo.sobre { background: #eef5fc; border-color: var(--c-primario); }
.resultado-import { margin-top: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.kpi { background: #f6f8fa; border-radius: 8px; padding: .7rem; text-align: center; }
.kpi b { display: block; font-size: 1.4rem; }
.lista-plantillas { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Login */
.login-pagina { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: linear-gradient(135deg, #14212e 0%, #1f4e79 60%, #2a6496 100%); }
.login-caja { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 2rem 1.6rem; box-shadow: 0 25px 60px rgba(0,0,0,.35); }
.login-caja .logo { width: 64px; height: 64px; border-radius: 16px; background: var(--c-acento); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.login-caja .logo .ico { width: 36px; height: 36px; }
.login-caja h1 { text-align: center; }
.login-caja p { text-align: center; color: var(--c-suave); margin-top: 0; }
.alerta { padding: .7rem .9rem; border-radius: 8px; background: #fde3e1; color: #8f241c; font-size: .9rem; margin-bottom: .8rem; }
.alerta.info { background: #e1ecf7; color: #1f4e79; }

/* =====================================================================
   AJUSTES PARA iPHONE / iPAD (Safari)
   ===================================================================== */
/* Los campos nunca deben salirse de su columna */
.grid > *, .filtros > *, label.campo { min-width: 0; }
input, select, textarea { max-width: 100%; min-width: 0; }

/* Campo de fecha: Safari le da un ancho propio y lo centra; se iguala a los demás y se agrega ícono de calendario */
input[type=date] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; text-align: left;
  padding-right: 2.6rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f4e79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") no-repeat right .75rem center / 20px 20px;
}
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: 0; width: 2rem; cursor: pointer; } /* el ícono propio queda visible */

/* Visor de fotos: botón Cerrar visible */
.visor { cursor: default; }
.visor-cerrar {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; z-index: 401;
  background: #fff; color: var(--c-texto); box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

/* Texto de avance bajo el círculo de carga */
#cargando { flex-direction: column; gap: .8rem; }
#cargando-txt { font-weight: 600; color: var(--c-primario); background: #fff; padding: .35rem .8rem; border-radius: 6px; box-shadow: var(--sombra); }
#cargando-txt:empty { display: none; }

/* ---------- Orden de trabajo: número, estado y colores por sección ---------- */
.campo .etq { display: block; font-size: .82rem; font-weight: 600; color: #3f4b58; margin-bottom: .3rem; }
.num-orden { min-height: 42px; display: flex; align-items: center; font-size: 1.6rem; font-weight: 800; color: var(--c-primario); font-variant-numeric: tabular-nums; }
.check-estado { min-height: 42px; display: inline-flex; align-items: center; gap: .5rem; padding: 0 .9rem; border: 1px solid var(--c-borde); border-radius: 8px; background: #fff; cursor: pointer; }
.check-estado input { width: 22px; height: 22px; }
.check-estado:has(input:checked) { border-color: var(--c-ok); background: #def5ea; color: #136b43; }
.seccion { border-left: 5px solid var(--sec-color, #1f4e79); }
.seccion-cab .sub { background: var(--sec-color, rgba(255,255,255,.15)); color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.trabajo .valor input { border-color: var(--sec-color); font-weight: 700; color: var(--sec-color); }
.totales .tot-sec span:last-child { color: var(--sec-color); font-weight: 700; }
.totales .tot-sec span:first-child { display: inline-flex; align-items: center; gap: .4rem; color: var(--c-suave); }
.totales .tot-sec span:first-child::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--sec-color); flex: none; }

/* ---------- Reportes ---------- */
.reporte-resumen { display: flex; flex-wrap: wrap; gap: .8rem; margin: .4rem 0 1rem; }
.reporte-resumen > div { flex: 1 1 160px; border: 1px solid var(--c-borde); border-radius: 8px; padding: .7rem .9rem; background: #f8fafc; }
.reporte-resumen b { display: block; font-size: 1.35rem; color: var(--c-primario); }
.descargas { display: grid; gap: .8rem; grid-template-columns: repeat(3, 1fr); }
.descargas .btn { min-height: 64px; font-size: 1rem; }
@media (max-width: 700px) { .descargas { grid-template-columns: 1fr; } }

/* ---------- Ojito para ver la contraseña ---------- */
.pass-ojo { position: relative; display: block; }
.pass-ojo > input { width: 100%; padding-right: 2.9rem; }
.pass-ojo > input::-ms-reveal, .pass-ojo > input::-ms-clear { display: none; }
.btn-ojo { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 40px; height: 36px; border: 0; background: transparent;
  color: var(--c-suave); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 6px; padding: 0; }
.btn-ojo:hover { color: var(--c-primario); background: rgba(31, 78, 121, .08); }
.btn-ojo .ico { width: 20px; height: 20px; }

/* ---------- Reportes: clientes, productos y utilidades ---------- */
.filtros.filtros-rep { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.reporte-resumen small { display: block; margin-top: .15rem; font-size: .78rem; }
.reporte-resumen .destacado { background: var(--c-primario); border-color: var(--c-primario); color: #fff; }
.reporte-resumen .destacado b { color: #fff; }
.grid-rep { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-rep > .panel { min-width: 0; }
@media (max-width: 1100px) { .grid-rep { grid-template-columns: 1fr; } }
.barra-rep { width: 100%; min-width: 60px; height: 10px; background: #edf1f6; border-radius: 5px; overflow: hidden; }
.barra-rep span { display: block; height: 100%; border-radius: 5px; }
@media (max-width: 700px) {
  .tabla.resp tfoot .fila-total { background: #eef3f9; }
  .tabla.resp tfoot .sin-dato { display: none; }
}

/* ---------- Switch de estado en el listado de órdenes ---------- */
.switch-estado { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; white-space: nowrap; }
.switch-estado input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-pista { position: relative; width: 46px; height: 26px; border-radius: 13px; background: #d93a2f; transition: background .2s; flex: none; }
.sw-bola { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch-estado.on .sw-pista { background: #1e8e5a; }
.switch-estado.on .sw-bola { transform: translateX(20px); }
.sw-txt { font-weight: 700; font-size: .82rem; color: #b3261e; }
.switch-estado.on .sw-txt { color: #136b43; }
.switch-estado input:focus-visible + .sw-pista { outline: 3px solid rgba(31, 78, 121, .35); outline-offset: 2px; }
.switch-estado input:disabled + .sw-pista { opacity: .6; }
.aviso-estado { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fde3e1; color: #b3261e; }
.aviso-estado.on { background: #def5ea; color: #136b43; }
.aviso-estado .ico { width: 32px; height: 32px; }

.xml-formato { margin: .3rem 0; padding: .5rem .7rem; background: #fff; border: 1px solid var(--c-borde); border-radius: 6px; font-size: .8rem; line-height: 1.45; overflow-x: auto; white-space: pre; }
