/* Tipografía de marca: Poppins (Google Fonts, licencia OFL), guardada en /fonts */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/poppins-700.woff2") format("woff2"); }

/* Colores de marca Lucvan (dossier de identidad):
   azul marino #243F59 (principal) · amarillo #F9E229 (acento) · azul #0069AA · naranja #F79239 · crema #E8E7DA */
:root {
  --marino: #243f59;
  --marino-oscuro: #1a2f44;
  --amarillo: #f9e229;
  --amarillo-suave: #fdf6c3;
  --azul: #0069aa;
  --naranja: #f79239;
  --crema: #e8e7da;
  --bg: #ffffff;
  --card: #ffffff;
  --text: #243f59;
  --muted: #5f7286;
  --border: #d6dde5;
  --accent: #243f59;
  --accent-text: #ffffff;
  --link: #0069aa;
  --danger: #c62828;
  --ok-bg: #e6f0f7;
  --ok-text: #243f59;
  --err-bg: #fdecec;
  --err-text: #9b1c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14.5px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { font-weight: 600; color: var(--marino); }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--marino); border-bottom: 3px solid var(--amarillo);
}
.brand { display: flex; align-items: center; }
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar nav a { color: #ffffff; text-decoration: none; }
.topbar nav a:hover { color: var(--amarillo); }
.who { color: #c9d4df; }
.topbar button.link { color: #ffffff; }
.topbar button.link:hover { color: var(--amarillo); }

.logo { display: block; width: 240px; max-width: 100%; height: auto; margin: 4px auto 20px; }
.topbar .logo { width: auto; height: 36px; margin: 0; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.auth { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.auth form { text-align: left; }

label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 12px; }
input {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

button {
  padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
}
.auth button { width: 100%; margin-top: 4px; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; }
button.link.danger { color: var(--danger); }
.topbar form { margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.grid .actions { grid-column: 1 / -1; }

.small { display: inline-block; margin-top: 14px; font-size: 0.9rem; color: var(--accent); }
.muted { color: var(--muted); }
.flash { padding: 10px 12px; border-radius: 8px; text-align: left; }
.flash.error { background: var(--err-bg); color: var(--err-text); }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); }

[hidden] { display: none !important; }

.topbar nav a.tab { padding: 6px 2px; border-bottom: 3px solid transparent; }
.topbar nav a.tab.active { color: var(--amarillo); font-weight: 600; border-bottom-color: var(--amarillo); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }
.page-head > a:not(.button) { color: var(--accent); text-decoration: none; }

a.button {
  display: inline-block; padding: 10px 16px; border-radius: 8px; text-decoration: none;
  background: var(--accent); color: var(--accent-text); font-weight: 600;
}
button.secondary { background: #e8edf5; color: var(--text); }

select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #f1f3f6; color: var(--text); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.step-label { margin: 0 0 4px; color: var(--muted); font-size: 0.85rem; }
.order-form.readonly .step-label { display: none; }
.order-form h2 + .grid, .order-form .grid + h2 { margin-top: 4px; }
.order-form .grid + h2 { margin-top: 12px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.recogida { margin-bottom: 12px; }
.recogida .label { font-size: 0.9rem; font-weight: 500; margin: 0 0 6px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 400; }
label.inline input { display: inline; width: auto; margin: 0; }

label.short { max-width: 240px; margin-top: 10px; }
.archivos { margin-bottom: 12px; }
.archivos .label { font-size: 0.9rem; font-weight: 500; margin: 0 0 6px; }
ul.files { list-style: none; padding: 0; margin: 0 0 12px; }
ul.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
ul.files a { color: var(--accent); text-decoration: none; word-break: break-all; }
ul.files label.inline { margin: 0 0 0 auto; }
input[type="file"] { padding: 8px; background: #fafbfc; }

/* Paso 3: protocolo */
.protocolo .block { padding: 14px 0; border-top: 1px solid var(--border); }
.protocolo .block:first-child { border-top: 0; padding-top: 0; }
.protocolo h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; }
.protocolo .sub { font-size: 0.88rem; font-weight: 500; margin: 12px 0 6px; }
.protocolo .req { color: var(--danger); font-weight: 400; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 999px; font-weight: 500;
}
.pill small { color: var(--muted); font-weight: 400; }
.pill:hover { border-color: var(--accent); }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill.on small { color: #dbe6ff; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.25); display: inline-block; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.card-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px;
  background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: 10px; font-weight: 400;
}
.card-opt:hover { border-color: var(--accent); }
.card-opt.on { border: 2px solid var(--accent); padding: 7px; }
.card-opt strong { font-size: 0.85rem; text-align: center; }
.card-opt small { color: var(--muted); font-size: 0.75rem; min-height: 1em; }
.foto { width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #f1f3f6; display: grid; place-items: center; }
.foto img { width: 100%; height: 100%; object-fit: contain; }
.foto .foto-txt { display: none; color: var(--muted); font-size: 0.75rem; }
.foto.sin-foto .foto-txt { display: block; }
.chosen { display: flex; align-items: center; gap: 14px; padding: 8px; border: 2px solid var(--accent); border-radius: 10px; }
.chosen .foto { width: 110px; flex: none; }
.chosen > div { flex: 1; }
.chosen small { color: var(--muted); }

/* Elementos */
.protocolo .sub2 { font-size: 0.8rem; color: var(--muted); margin: 8px 0 4px; }
.protocolo h3 .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; text-align: center; }
.elementos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.elemento { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fff; }
.elemento.on { grid-column: 1 / -1; border: 2px solid var(--accent); padding: 7px 9px; }
.el-head { display: flex; align-items: center; gap: 10px; }
.el-head strong { flex: 1; font-size: 0.9rem; }
.el-img { width: 56px; height: 48px; flex: none; display: grid; place-items: center; }
.el-img img { max-width: 100%; max-height: 100%; }
.elemento.on .el-img { width: 120px; height: 100px; }
button.small { padding: 6px 12px; font-size: 0.85rem; }
.el-head button { background: var(--accent); color: #fff; }
.el-head button.secondary { background: #e8edf5; color: var(--text); }
.el-body { padding: 4px 0 4px; }
.el-select { max-width: 200px; }
.grid .span2 { grid-column: span 2; }
.form-clonar { display: inline; margin: 0; }
.liberado { margin: 16px 0 12px; padding: 18px 20px; border: 3px solid var(--ok-text); border-radius: 10px; background: var(--ok-bg);
  color: var(--ok-text); font-size: 1.5rem; font-weight: 800; letter-spacing: .03em; text-align: center; }
.documentos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.documento { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); background: #fff; }
.documento:hover { border-color: var(--accent); }
.documento strong::before { content: "PDF · "; color: var(--accent); }
.documento span { color: var(--muted); font-size: .85rem; }
.badge.borrador { background: #eceff3; color: #475467; }
.badge.bloqueado { background: var(--err-bg); color: var(--err-text); }
.badge.modif { background: #fde8d7; color: #a4470b; text-decoration: none; }
tr.inactivo td { opacity: .55; }
tr.fila-borrador td { background: #fafbfc; }
img.mini { width: 64px; height: 48px; object-fit: contain; vertical-align: middle; }
.page-head h1 img.mini { width: 80px; height: 60px; }
.mono { font-family: Consolas, monospace; }
.sub-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 8px; }
fieldset.accesos label.otras { display: inline-flex; align-items: center; gap: 8px; }
fieldset.accesos label.otras input { width: 180px; margin: 0; }
fieldset.accesos label.span2 { display: block; margin-top: 6px; }
.inline-form { margin: 10px 0 0; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn { background: none; color: var(--muted); border-radius: 8px 8px 0 0; padding: 10px 16px; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn.on { color: var(--text); border-bottom-color: var(--accent); background: var(--card); }
.coste-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #eef3fb; border-radius: 10px; margin-bottom: 12px; }
.coste-total strong { font-size: 1.4rem; }
table.desglose td:last-child { text-align: right; white-space: nowrap; }
table.desglose tr.total td { font-weight: 700; border-top: 2px solid var(--text); }
.precios { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.euro { display: flex; align-items: center; gap: 6px; }
.euro input { max-width: 140px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.programas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 8px; }
.programa {
  display: flex; flex-direction: column; gap: 10px; padding: 36px 28px; min-height: 180px;
  background: var(--card); border: 2px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text);
}
.programa:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(31, 111, 235, .12); }
.programa strong { font-size: 1.2rem; letter-spacing: .02em; }
.programa span { color: var(--muted); }
.programa em { margin-top: auto; align-self: flex-start; font-style: normal; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #f1f3f6; color: var(--muted); }
.programa.bloqueado { opacity: .65; }
/* Logos de los programas (LucvanFAB, LucvanFOOTLAB) en la elección de programa: en negro */
.programa-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 10px; }
.programa-texto { color: var(--text); font-size: .95rem; line-height: 1.5; }
.programa-texto p { margin: 0 0 8px; }
.programa-texto ul { margin: 0; padding-left: 20px; color: var(--muted); }
.programa-texto li { margin: 3px 0; }
.programa-texto .pequena { font-size: .85rem; line-height: 1.45; }
.logo-pagina { display: block; width: 320px; max-width: 80%; height: auto; margin: 4px 0 18px; }
.suscripcion-tit { margin: 4px 0 10px; }
.programa.activable em { color: #F79239; font-style: normal; font-weight: 600; }
/* Suscripción a Diseño plantillas 3D */
.planes-3d { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.plan-3d { display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--border); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.plan-3d:has(input:checked) { border-color: #0069AA; background: #f2f7fb; }
.plan-3d input { align-self: flex-start; width: auto; margin: 0; }
#suscripcion .actions button { white-space: nowrap; }
#suscripcion button.danger { background: #fff; color: #b42318; border: 1px solid #b42318; }
.plan-3d span { color: #667085; font-size: .9rem; }
.plan-3d .plan-ahorro { color: #F79239; font-weight: 600; font-size: .85rem; }
.plan-destacado { border-color: #F79239; }
/* Página de suscripción a LucvanFOOTLAB */
.footlab-info { display: grid; grid-template-columns: 1fr 440px; gap: 24px; align-items: center; }
.footlab-captura { display: block; width: 100%; max-width: 440px; height: auto; border-radius: 10px; border: 1px solid var(--border); }
@media (max-width: 760px) { .footlab-info { grid-template-columns: 1fr; } }
/* Ventana "Su petición de suscripción ha sido tramitada" */
.modal-tramitada { position: fixed; inset: 0; background: rgba(36, 63, 89, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-tramitada-caja { background: #fff; border-radius: 14px; padding: 28px; max-width: 520px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-tramitada-caja h2 { margin-top: 0; color: #F79239; }
.footlab-ventajas { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.footlab-ventajas ul, .footlab-precios { padding-left: 20px; line-height: 1.7; margin: 0; }
.footlab-fotos { display: grid; grid-template-columns: 2fr 3fr; gap: 10px; align-items: center; }
.footlab-fotos img { width: 100%; height: auto; border-radius: 10px; display: block; }
.footlab-alta h2 { font-size: 1.6rem; color: #F79239; margin-bottom: 6px; }
.footlab-oferta { font-size: 1.15rem; }
.boton-alta { background: #F79239; border-color: #F79239; font-size: 1.05rem; padding: 12px 26px; }
@media (max-width: 760px) { .footlab-ventajas { grid-template-columns: 1fr; } }
.tabla-cargos { width: 100%; font-size: .9rem; }
#suscripcion .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#suscripcion .actions form { margin: 0; display: flex; gap: 8px; align-items: center; }
fieldset.accesos { grid-column: 1 / -1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 4px; margin-bottom: 12px; }
fieldset.accesos legend { font-size: .9rem; font-weight: 500; padding: 0 4px; }
.filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.filtros label { margin: 0; }
.filtros label:first-child { flex: 1 1 320px; }
.filtros select { min-width: 160px; }
.filtros .limpiar { color: var(--accent); text-decoration: none; padding-bottom: 10px; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row input { flex: 1; }
.pw-row button { margin-top: 4px; white-space: nowrap; }
.pw-help { display: block; margin-top: 4px; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.pw-help.bad { color: var(--danger); }
.pw-help.good { color: var(--ok-text); }
.actions-note { grid-column: 1 / -1; margin: 0; }
td.acciones form { margin: 0; }
label.observaciones { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
td.acciones { display: flex; gap: 14px; }
td.acciones a.pdf { font-weight: 600; font-size: 0.8rem; padding: 1px 8px; border: 1px solid var(--accent); border-radius: 6px; }
.head-links { display: flex; align-items: center; gap: 16px; }
.head-links > a:not(.button) { color: var(--accent); text-decoration: none; }
a.button.secondary-link { background: #e8edf5; color: var(--text); }
.el-pies {display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 24px; }

.status-form { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.status-form label { margin: 0; min-width: 200px; }
.status-form.taller button:disabled { background: var(--ok-bg); color: var(--ok-text); cursor: default; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge.recibido { background: #e6efff; color: #1f4fb0; }
.badge.proceso { background: #fff3d6; color: #8a5a00; }
.badge.enviado { background: var(--ok-bg); color: var(--ok-text); }
.flash.info { background: #eef3fb; color: #24456f; }

dl.data { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; margin: 0 0 12px; }
dl.data dt { color: var(--muted); font-size: 0.85rem; }
dl.data dd { margin: 2px 0 0; font-weight: 500; }
.small-text { font-size: 0.88rem; }
td a { color: var(--accent); text-decoration: none; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }

/* Materiales 3D: foto de cada color */
.fotos-colores { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.foto-color { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 10px; border: 1px solid #e3e6ea; border-radius: 8px; }
.foto-color input[type=file] { max-width: 100%; font-size: 12px; }
.foto-color .check { display: flex; gap: 6px; align-items: center; font-size: 13px; }


/* Listado de clientes: el nombre y el e-mail pueden partirse para no necesitar barra lateral */
.tabla-clientes td:nth-child(2), .tabla-clientes td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; min-width: 140px; }


/* Modelo base: OTRA BASE (texto libre) */
.otra-base { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; }
.otra-base input { flex: 1; min-width: 220px; }


/* Aviso de usuario bloqueado por intentos fallidos */
.aviso-bloqueo { border-color: #f0b4b4; background: #fff5f5; }
.aviso-bloqueo p { margin: 0 0 10px; }


/* Registro de accesos */
.tabla-accesos td { white-space: normal; }
.tabla-accesos td.nowrap { white-space: nowrap; }


/* ===================== Imagen de marca Lucvan ===================== */
/* Enlaces en el azul de marca */
a, .small, button.link, .page-head > a:not(.button), ul.files a, td a, .head-links > a:not(.button), .filtros .limpiar { color: var(--link); }
.topbar nav a, .topbar button.link { color: #ffffff; }
.topbar nav a.tab.active { color: var(--amarillo); }
button.link.danger { color: var(--danger); }

/* Botones: azul marino; secundarios en crema */
button, a.button { background: var(--marino); color: #ffffff; transition: background .15s; }
button:not(.pill):not(.card-opt):not(.link):not(.tab-btn):not(.secondary):hover, a.button:not(.secondary-link):hover { background: var(--marino-oscuro); }
button.link, button.link:hover, .tab-btn, .tab-btn:hover { background: none; }
button.secondary, a.button.secondary-link, .el-head button.secondary { background: var(--crema); color: var(--marino); }
button.secondary:hover, a.button.secondary-link:hover { background: #dcdbcb; }
.el-head button { background: var(--marino); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul); outline-offset: 0; border-color: var(--azul); }

/* Selección en el protocolo: azul marino con el amarillo de marca */
.pill:hover, .card-opt:hover, .documento:hover { border-color: var(--azul); }
.pill.on { background: var(--marino); border-color: var(--marino); color: var(--amarillo); }
.pill.on small { color: #d9e2ea; }
.card-opt.on, .chosen, .elemento.on { border-color: var(--marino); background: var(--amarillo-suave); }
.protocolo h3 { color: var(--marino); }
.protocolo h3 .count { background: var(--amarillo); color: var(--marino); }
.step-label { color: var(--naranja); font-weight: 600; letter-spacing: .02em; }
.documento strong::before { color: var(--naranja); }

/* Pestañas dentro de un pedido */
.tab-btn.on { color: var(--marino); border-bottom-color: var(--amarillo); font-weight: 600; }

/* Estados de los pedidos */
.badge.recibido { background: #e0eef7; color: var(--azul); }
.badge.proceso { background: #fde9d6; color: #9a4c08; }
.badge.enviado { background: var(--marino); color: #ffffff; }
.badge.borrador { background: var(--crema); color: var(--marino); }
.badge.modif { background: var(--amarillo-suave); color: var(--marino); }

/* Avisos */
.flash.ok { background: #e6f0f7; color: var(--marino); border-left: 4px solid var(--azul); }
.flash.info { background: #f4f3ec; color: var(--marino); border-left: 4px solid var(--crema); }
.flash.error { border-left: 4px solid var(--danger); }
.liberado { border-color: var(--marino); background: var(--amarillo-suave); color: var(--marino); }
.coste-total { background: #f4f3ec; }
.coste-total strong { color: var(--marino); }

/* Tarjetas y tablas */
.card { border-color: var(--border); box-shadow: 0 1px 2px rgba(36, 63, 89, .04); }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.programa:hover { border-color: var(--amarillo); box-shadow: 0 6px 20px rgba(36, 63, 89, .12); }
.programa strong { color: var(--marino); }
.sticky-actions { background: rgba(255, 255, 255, .96); }
input:disabled, select:disabled, textarea:disabled { background: #f4f6f8; }

/* Pantallas sin sesión (acceso, recuperar contraseña): fondo crema con las líneas curvas del dossier */
body.publica {
  background-color: var(--crema);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='none'%3E%3Cpath d='M0 260 C 420 520 980 520 1440 300' fill='none' stroke='%23F79239' stroke-width='1.5'/%3E%3Cpath d='M0 760 C 520 700 1040 520 1440 340' fill='none' stroke='%23F79239' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 100% 100%; background-attachment: fixed; min-height: 100vh;
}
body.publica .auth { box-shadow: 0 10px 30px rgba(36, 63, 89, .12); border: 0; }
body.publica .auth h1 { color: var(--marino); }

/* Poppins es algo más ancha: tablas un poco más compactas para que quepan sin barra lateral */
table { font-size: 0.86rem; }
th, td { padding: 8px 8px; }


/* Estado En modificación */
.badge.modificacion { background: var(--amarillo); color: var(--marino); }
.status-form.taller .badge { align-self: center; }


/* Elementos: elección de la referencia con su foto */
.cards.refs { grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); margin-bottom: 6px; }


/* Fotos de referencia de elementos: la pieza completa y centrada en su recuadro (sin recortar) */
.cards.refs .foto { position: relative; background: #ffffff; }
.cards.refs .foto img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; object-position: center; }


/* Nombres largos en las tarjetas: que se partan en varias líneas sin descuadrar la rejilla */
.card-opt { min-width: 0; }
.card-opt strong { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }


/* Precios: grupos y secciones desplegables */
details.precio-grupo > summary, details.precio-seccion > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
details.precio-grupo > summary::-webkit-details-marker, details.precio-seccion > summary::-webkit-details-marker { display: none; }
details.precio-grupo > summary h2 { margin: 0; }
details.precio-grupo > summary::before, details.precio-seccion > summary::before { content: "▸"; color: var(--naranja); font-size: 1rem; transition: transform .15s; }
details[open].precio-grupo > summary::before, details[open].precio-seccion > summary::before { transform: rotate(90deg); }
details[open].precio-grupo > summary { margin-bottom: 12px; }
details.precio-seccion { border-top: 1px solid var(--border); padding: 10px 0 6px 6px; }
details.precio-seccion > summary { font-weight: 600; color: var(--marino); }
details[open].precio-seccion > summary { margin-bottom: 10px; }
.contador { font-size: .78rem; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--crema); color: var(--marino); }
.contador.completo { background: var(--marino); color: var(--amarillo); }

/* Desplegable de una opción del modelo base (p. ej. espesor del ALZA) */
.opcion-select { max-width: 200px; }


/* Listado de pacientes y pedidos: todas las columnas a la vista, sin barra lateral.
   Letra algo más pequeña y los textos largos (cliente, paciente, modelo) en dos líneas, centrados en la fila. */
.tabla-pedidos { font-size: 0.82rem; table-layout: auto; }
.tabla-pedidos th, .tabla-pedidos td { padding: 8px 6px; vertical-align: middle; }
.tabla-pedidos th { font-size: 0.72rem; white-space: normal; }
.tabla-pedidos td { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.tabla-pedidos td:first-child, .tabla-pedidos td:nth-child(2) { white-space: nowrap; }
.tabla-pedidos .badge { white-space: nowrap; font-size: 0.72rem; padding: 2px 8px; }
.tabla-pedidos td.acciones { display: table-cell; white-space: nowrap; }
.tabla-pedidos td.acciones > * { margin-right: 8px; vertical-align: middle; }
.tabla-pedidos td.acciones form { display: inline; }

/* Taller: modificar el protocolo de fabricación hasta que se envía al cliente */
.editor-protocolo { border: 2px solid var(--amarillo); }


/* TALLA BASE PLANTILLA (taller y administrador) */
.talla-base { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.talla-base label { margin: 0; font-weight: 600; color: var(--marino); }
.talla-base input { width: 160px; }
.talla-base.falta { border: 2px solid var(--amarillo); background: var(--amarillo-suave); }
p.talla-base { display: block; }

/* TALLA BASE PLANTILLA dentro del resumen del protocolo (a rellenar por el taller) */
dl.data .talla-box { grid-column: span 2; padding: 12px 14px; border: 3px solid var(--naranja); border-radius: 12px; background: #fff4e8; }
dl.data .talla-box.falta { border-color: var(--naranja); background: #ffe8d1; box-shadow: 0 0 0 3px rgba(247, 146, 57, .2); }
.talla-box label { margin: 0; font-weight: 700; color: var(--marino); letter-spacing: .02em; }
.talla-box .aviso { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--naranja); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: middle; }
.talla-box .fila { display: flex; gap: 8px; margin-top: 6px; }
.talla-box input { flex: 1; min-width: 0; font-size: 1.1rem; font-weight: 700; color: var(--marino); margin: 0; }
.talla-box button { white-space: nowrap; }
.talla-box small { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; }

/* --- Analíticas (Lucas, 12/11/2026) --- */
a.tab-btn { display: inline-block; text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; }
.kpi b { font-size: 1.5rem; color: var(--marino); line-height: 1.2; }
.kpi span { color: var(--muted); font-size: 0.85rem; }
.kpi small { color: var(--muted); font-size: 0.75rem; }
.grafica svg { width: 100%; height: auto; display: block; }
.grafica .g-linea { stroke: var(--border); stroke-width: 1; }
.grafica .g-num, .grafica .g-et { fill: var(--muted); font-size: 11px; font-family: inherit; }
.g-leyenda { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.g-leyenda span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; }
.reparto { display: flex; flex-direction: column; gap: 6px; }
.rep-fila { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 0.88rem; }
.rep-et { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-barra { background: #eef1f5; border-radius: 4px; height: 10px; overflow: hidden; }
.rep-barra span { display: block; height: 100%; background: var(--marino); border-radius: 4px; }
.rep-n { text-align: right; font-variant-numeric: tabular-nums; }
.rep-n small { color: var(--muted); }
.dos-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.tabla-analiticas td.num, .tabla-analiticas th { text-align: right; }
.tabla-analiticas td:first-child, .tabla-analiticas th:first-child { text-align: left; }
.tabla-analiticas td.num { font-variant-numeric: tabular-nums; }/* Analíticas: tabla sin barra (varias líneas por fila) y fechas a su tamaño */
.filtros.fechas label:first-child { flex: 0 1 auto; }
.filtros input[type="date"] { width: auto; }
.tabla-analiticas { width: 100%; }
.tabla-analiticas th, .tabla-analiticas td { white-space: normal; vertical-align: top; }
.tabla-analiticas .linea { display: block; font-size: 0.78rem; line-height: 1.35; }