/* ------------------------------------------------------------------
   LA CYCA · Catálogo interno y pedidos
   Estilo inspirado en lacyca.com: verde corporativo, naranja de acento,
   tarjetas verde claro, tipografía Outfit y botones en píldora.
   ------------------------------------------------------------------ */

:root {
  --green: #007126;
  --green-dark: #005a1e;
  --green-mid: #338d52;
  --green-soft: #c9e1d1;
  --green-softer: #e9f3ec;
  --text: #1d3b26;
  --muted: #5d7a66;
  --line: #d6e6dc;
  --orange: #fa8500;
  --orange-dark: #d97300;
  --danger: #c0392b;
  --bg: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 60, 20, 0.1);
  --font: "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --wrap: 1200px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3 { color: var(--green); line-height: 1.2; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 500; }
h2 { font-size: 1.35rem; font-weight: 500; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  padding: 0.5rem 1rem; background: var(--orange); color: #fff; border-radius: 999px;
}
.skip:focus { top: 0.5rem; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 1.25rem; padding-bottom: 3rem; }

.icon { width: 22px; height: 22px; fill: currentColor; flex: 0 0 auto; }

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "brand nav" "search search";
  align-items: center;
  gap: 0.6rem 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.brand { grid-area: brand; display: inline-flex; }
.brand img { height: 36px; width: auto; }

.search { grid-area: search; position: relative; }
.search input {
  width: 100%;
  height: 44px;
  padding: 0 1rem 0 2.6rem;
  border: 1px solid var(--green-soft);
  border-radius: 999px;
  background: var(--green-softer);
  font-size: 16px;
}
.search input:focus { outline: none; border-color: var(--green-mid); background: #fff; box-shadow: 0 0 0 4px rgba(0, 113, 38, 0.15); }
.search__icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--green-mid); pointer-events: none; }

.topnav { grid-area: nav; justify-self: end; display: flex; align-items: center; gap: 0.25rem; }
.topnav a, .menu summary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: 44px; padding: 0 0.7rem;
  border-radius: 999px;
  color: var(--green); font-weight: 600;
  cursor: pointer;
}
.topnav a:hover, .menu summary:hover, .topnav a.is-active { background: var(--green-softer); }
.topnav__label { display: none; }
.count {
  display: inline-grid; place-items: center;
  min-width: 1.45rem; height: 1.45rem; padding: 0 0.4rem;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  background: var(--orange); border-radius: 999px;
  transition: transform 0.2s ease;
}
.count.is-empty { background: var(--green-soft); color: var(--green); }
.count.is-bump { transform: scale(1.3); }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 230px; padding: 0.5rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu__who { margin: 0.25rem 0.6rem 0.5rem; font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.menu__panel a, .menu__panel button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  min-height: 44px; padding: 0 0.6rem;
  border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text); font-weight: 500; text-align: left; cursor: pointer;
}
.menu__panel a:hover, .menu__panel button:hover { background: var(--green-softer); color: var(--green); }
.menu__panel .icon { color: var(--green-mid); }

.adminnav { background: var(--green); position: relative; z-index: 40; }
.adminnav__row { display: flex; flex-wrap: wrap; gap: 0 0.25rem; }
.adminnav__link, .adminnav__grupo > summary {
  display: flex; align-items: center; gap: 0.25rem; padding: 0.7rem 0.9rem;
  color: rgba(255, 255, 255, 0.85); font-weight: 500; white-space: nowrap; cursor: pointer;
  border-bottom: 3px solid transparent; list-style: none; user-select: none;
}
.adminnav__grupo > summary::-webkit-details-marker { display: none; }
.adminnav__link:hover, .adminnav__grupo > summary:hover, .adminnav__grupo[open] > summary { color: #fff; }
.adminnav__link.is-active, .adminnav__grupo.is-active > summary { color: #fff; border-bottom-color: var(--orange); }
.adminnav__flecha { width: 1rem; height: 1rem; transform: rotate(90deg); transition: transform 0.15s; opacity: 0.8; }
.adminnav__grupo[open] .adminnav__flecha { transform: rotate(-90deg); }
.adminnav__grupo { position: relative; }
.adminnav__panel {
  position: absolute; top: 100%; left: 0; min-width: 220px; padding: 0.35rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.adminnav__panel a { display: block; padding: 0.6rem 0.8rem; border-radius: 8px; color: var(--text); font-weight: 500; white-space: nowrap; }
.adminnav__panel a:hover { background: var(--green-softer); color: var(--green); }
.adminnav__panel a.is-active { background: var(--green-softer); color: var(--green); font-weight: 700; box-shadow: inset 3px 0 0 var(--orange); }
.adminnav__toggle { display: none; }
/* Móvil: un botón «Menú» que despliega la lista; los grupos se abren dentro */
@media (max-width: 859px) {
  .adminnav__toggle {
    display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 48px; padding: 0.5rem 0;
    background: none; border: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: left;
  }
  .adminnav__toggle .icon { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; }
  .adminnav__donde { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; opacity: 0.85; padding-left: 0.6rem; border-left: 1px solid rgba(255, 255, 255, 0.35); }
  .adminnav__row { display: none; flex-direction: column; padding-bottom: 0.6rem; }
  .adminnav.is-open .adminnav__row { display: flex; }
  /* con el menú abierto la cabecera deja de ir pegada arriba: así se llega a todas las opciones deslizando la página */
  body.menu-abierto .topbar, .topbar:has(.adminnav.is-open) { position: relative; }
  .adminnav.is-open .adminnav__toggle { border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
  .adminnav__link, .adminnav__grupo > summary { padding: 0.8rem 0.25rem; border-bottom: 0; border-left: 3px solid transparent; justify-content: space-between; font-size: 1.05rem; }
  .adminnav__link.is-active, .adminnav__grupo.is-active > summary { border-bottom: 0; border-left-color: var(--orange); padding-left: 0.6rem; }
  .adminnav__link .count { margin-left: auto; }
  .adminnav__panel { position: static; min-width: 0; padding: 0 0 0.4rem 0.9rem; background: none; border: 0; box-shadow: none; }
  .adminnav__panel a { color: rgba(255, 255, 255, 0.9); padding: 0.65rem 0.6rem; }
  .adminnav__panel a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
  .adminnav__panel a.is-active { background: rgba(255, 255, 255, 0.15); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
}

@media (min-width: 860px) {
  .topbar__row { grid-template-columns: auto 1fr auto; grid-template-areas: "brand search nav"; gap: 1.5rem; }
  .brand img { height: 42px; }
  .search { max-width: 520px; width: 100%; justify-self: center; }
  .topnav__label { display: inline; }
}

/* ---------- Avisos ---------- */
.alert {
  margin: 0 0 1rem; padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--green-softer); color: var(--green-dark);
  border: 1px solid var(--green-soft);
}
.alert--error { background: #fdecea; color: #8e2a1f; border-color: #f5c6c0; }
.alert--aviso { background: #fff4e5; color: #8a4b00; border-color: #ffd8a8; }
.alert--info { background: #eaf2fb; color: #1d4f86; border-color: #c4dbf3; display: flex; align-items: center; gap: .5rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
  max-width: calc(100% - 2rem); padding: 0.8rem 1.1rem;
  background: var(--green); color: #fff; font-weight: 500;
  border-radius: 999px; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
.toast a { color: #fff; text-decoration: underline; font-weight: 700; }
.toast.is-error { background: var(--danger); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 44px; padding: 0.55rem 1.25rem;
  border: 1.5px solid var(--green); border-radius: 999px;
  background: #fff; color: var(--green);
  font-weight: 600; line-height: 1.1; text-align: center;
  cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--green-softer); color: var(--green-dark); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn--accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn--accent:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn--danger { border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: #fdecea; color: var(--danger); }
.btn--ghost { border-color: transparent; }
.btn--sm { min-height: 36px; padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; font-size: 1.1rem; }
.btn[disabled], .btn.is-busy { opacity: 0.55; pointer-events: none; }
.btn .icon { width: 20px; height: 20px; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ---------- Inicio ---------- */
.hero { padding: 1rem 0 1.5rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--green-mid); }
.hero__eyebrow { margin: 0 0 0.4rem; color: var(--orange); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.hero h1 { font-weight: 400; margin-bottom: 0.5rem; }
.hero__text { margin: 0; color: var(--green-mid); font-size: 1.05rem; max-width: 40rem; }

.underline { position: relative; display: inline-block; font-weight: 700; white-space: nowrap; }
.underline::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -0.2em; height: 0.32em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9c40-5 90-7 194-4' fill='none' stroke='%23fa8500' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; flex-wrap: wrap; }
.section-head h1, .section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

/* ---------- Tarjetas de categoría ---------- */
.cats {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  margin: 0 0 2.5rem; padding: 0; list-style: none;
}
@media (min-width: 700px) { .cats { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; } }

.cat {
  position: relative; display: flex; flex-direction: column; height: 100%;
  padding: 0.9rem 0.9rem 0.7rem;
  color: var(--green); background: #fff;
  border-top: 1px solid var(--green-mid); border-bottom: 1px solid var(--green-mid);
  transition: background-color 0.2s, border-radius 0.2s;
}
.cat:hover, .cat:focus-visible { background: var(--green-soft); border-radius: var(--radius); color: var(--green-dark); }
.cat__media {
  display: block; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 0.8rem;
  border-radius: var(--radius-sm); background: var(--green-softer); overflow: hidden;
}
.cat__img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cat__img.is-empty { display: grid; place-items: center; color: var(--green-mid); }
.cat__img.is-empty .icon { width: 40%; height: 40%; opacity: 0.6; }
.cat__name { margin: 0; font-size: 1.1rem; font-weight: 500; color: inherit; }
.cat__meta { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--green-mid); }
.cat__num { margin-top: auto; padding-top: 0.6rem; align-self: flex-end; font-size: 1.35rem; font-weight: 300; color: var(--green-mid); }
@media (min-width: 700px) {
  .cat { padding: 1.25rem 1.25rem 1rem; min-height: 15rem; }
  .cat__name { font-size: 1.3rem; }
  .cat__num { font-size: 1.6rem; }
}

/* ---------- Ruta ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0 0 0.8rem; padding: 0; list-style: none; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 0.5rem; color: var(--green-mid); }

/* ---------- Artículos ---------- */
.products { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .products { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; } }

.product {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: box-shadow 0.2s;
}
.product:hover { box-shadow: var(--shadow); }
.product__media { display: block; background: var(--green-softer); aspect-ratio: 1; }
.product__img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product__img.is-empty { display: grid; place-items: center; color: var(--green-mid); }
.product__img.is-empty .icon { width: 36%; height: 36%; opacity: 0.5; }
.product__body { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; padding: 0.75rem; }
.product__name { color: var(--text); font-weight: 500; line-height: 1.3; }
.product__name:hover { color: var(--green); }
.product__unit { font-size: 0.85rem; color: var(--muted); }
.product__match { font-size: 0.8rem; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.product__match strong { color: var(--text); }

.ref {
  align-self: flex-start;
  white-space: nowrap;
  padding: 0.12rem 0.55rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.03em; font-variant-numeric: tabular-nums;
  color: var(--green); background: var(--green-softer); border-radius: 999px;
  word-break: break-all;
}

.addform { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: auto; padding-top: 0.4rem; }
.addform .qty { flex: 1 1 100%; }
.addform__btn { flex: 1 1 100%; }
@media (min-width: 420px) {
  .addform { flex-wrap: nowrap; }
  .addform .qty { flex: 0 0 auto; }
  .addform__btn { flex: 1 1 auto; padding-inline: 0.8rem; }
}

.qty {
  display: inline-flex; align-items: center; justify-content: space-between;
  height: 44px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.qty__btn {
  display: grid; place-items: center; width: 40px; height: 100%;
  border: 0; background: none; color: var(--green); cursor: pointer; border-radius: 999px;
}
.qty__btn:hover { background: var(--green-softer); }
.qty__btn .icon { width: 18px; height: 18px; }
.qty__input {
  width: 3rem; height: 100%; border: 0; text-align: center; font-weight: 600;
  background: transparent; -moz-appearance: textfield; appearance: textfield;
}
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus { outline: none; }
.qty:focus-within { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(0, 113, 38, 0.15); }

.empty {
  padding: 2rem 1rem; text-align: center; color: var(--muted);
  background: var(--green-softer); border-radius: var(--radius);
}
.empty .icon { width: 48px; height: 48px; margin: 0 auto 0.5rem; color: var(--green-mid); }

.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.pager a { padding: 0.5rem 1rem; border: 1px solid var(--green); border-radius: 999px; font-weight: 600; }

/* Ficha */
.detail { display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; } }
.detail__media { border-radius: var(--radius); background: var(--green-softer); aspect-ratio: 1; overflow: hidden; }
.detail__media .product__img { width: 100%; height: 100%; }
.detail__code { display: flex; align-items: center; gap: 0.6rem; margin: 0.25rem 0 1rem; }
.detail__code span:first-child { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--green-mid); }
.detail__code .ref { font-size: 1.1rem; padding: 0.25rem 0.9rem; background: var(--green-soft); }
.detail__desc { color: var(--text); white-space: pre-line; }
.detail .addform { max-width: 420px; flex-wrap: nowrap; }
.detail .addform .qty { flex: 0 0 auto; }

/* ---------- Mi pedido ---------- */
.cart { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .cart { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

.lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.line {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0.4rem 0.9rem;
  align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.line__img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--radius-sm); background: var(--green-softer); grid-row: span 2; mix-blend-mode: multiply; }
.line__img.is-empty { display: grid; place-items: center; color: var(--green-mid); }
.line__info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.line__name { font-weight: 500; color: var(--text); }
.line__controls { display: flex; align-items: center; gap: 0.5rem; }
.line__remove { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.line__remove:hover { background: #fdecea; color: var(--danger); }
@media (min-width: 600px) {
  .line { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .line__img { width: 72px; height: 72px; grid-row: auto; }
}

.summary {
  padding: 1.25rem; background: var(--green-softer); border-radius: var(--radius);
}
@media (min-width: 900px) { .summary { position: sticky; top: 90px; } }
.summary h2 { margin-bottom: 0.8rem; }
.summary__row { display: flex; justify-content: space-between; padding: 0.2rem 0; }
.summary__row--total { font-weight: 700; font-size: 1.1rem; }
.summary form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--green-soft); }

/* Confirmación */
.sent {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem; margin-bottom: 1.5rem;
  background: var(--green-soft); border-radius: var(--radius);
}
.sent__icon { display: grid; place-items: center; flex: 0 0 auto; width: 3.25rem; height: 3.25rem; color: #fff; background: var(--green); border-radius: 50%; }
.sent__icon .icon { width: 30px; height: 30px; }
.sent h1 { margin: 0 0 0.2rem; }
.sent p { margin: 0; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field label, .label { font-weight: 600; color: var(--green); }
.field small, .hint { color: var(--muted); font-size: 0.85rem; }
.input, .field input[type="text"], .field input[type="tel"], .field input[type="email"], .field input[type="password"], .field input[type="number"], .field input[type="search"], .field input[type="date"], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 0.6rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  font-size: 16px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--green-mid); box-shadow: 0 0 0 4px rgba(0, 113, 38, 0.15); }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.form-grid { display: grid; gap: 0 1.25rem; }
@media (min-width: 700px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }
.form-grid--3 { grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (min-width: 700px) { .form-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card { padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card + .card { margin-top: 1.25rem; }
.card--soft { background: var(--green-softer); border-color: transparent; }

/* Acceso */
.auth { display: grid; place-items: center; min-height: 70vh; }
.auth__box { width: 100%; max-width: 400px; }
.auth__brand { text-align: center; margin-bottom: 1.5rem; }
.auth__brand img { margin: 0 auto 0.75rem; height: 56px; width: auto; }
.auth__brand p { color: var(--muted); margin: 0; }
.auth__help { text-align: center; color: var(--muted); margin-top: 1.25rem; font-size: 0.95rem; }
body.is-auth .topbar { display: none; }

/* ---------- Tablas (pedidos, panel) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-weight: 600; color: var(--green); background: var(--green-softer); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafdfb; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .nowrap { white-space: nowrap; }
.table .thumb { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--green-softer); mix-blend-mode: multiply; }
.table .thumb.is-empty { display: grid; place-items: center; color: var(--green-mid); }
.table .thumb.is-empty .icon { width: 22px; height: 22px; }
.table a.rowlink { font-weight: 600; }
.muted { color: var(--muted); }
.is-off { opacity: 0.5; }

/* Tabla convertida en tarjetas en móvil */
@media (max-width: 699px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--line); }
  .table--cards td { padding: 0.15rem 0; border: 0; }
  .table--cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.85rem; }
  .table--cards tfoot, .table--cards tfoot tr { display: block; }
  .table--cards tfoot td { display: inline-block; width: auto; padding: .6rem .9rem; border: 0; }
  .table--cards td.num { text-align: left; }
}

.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.18rem 0.65rem; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
  color: var(--badge, var(--green));
  background: color-mix(in srgb, var(--badge, var(--green)) 13%, #fff);
}
.badge::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1rem; }
.toolbar .input { width: auto; flex: 1 1 200px; }
.toolbar select.input { flex: 0 1 220px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip { padding: 0.35rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.9rem; background: #fff; }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.chip span { opacity: 0.7; margin-left: 0.25rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.stat { padding: 1rem; background: var(--green-softer); border-radius: var(--radius); }
.stat__value { display: block; font-size: 1.8rem; font-weight: 600; color: var(--green); line-height: 1.1; }
.stat__label { color: var(--muted); font-size: 0.9rem; }

.preview-img { width: 140px; height: 140px; object-fit: contain; border-radius: var(--radius-sm); background: var(--green-softer); border: 1px solid var(--line); }
.preview-img.is-empty { display: grid; place-items: center; color: var(--green-mid); }

.drop {
  display: grid; place-items: center; gap: 0.4rem; padding: 1.5rem; text-align: center;
  border: 2px dashed var(--green-soft); border-radius: var(--radius); background: var(--green-softer);
  color: var(--muted); cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--green-mid); }
.drop input { max-width: 100%; }

/* ---------- Pie ---------- */
.footer { background: var(--green); color: rgba(255, 255, 255, 0.85); padding: 1.25rem 0 calc(1.25rem + env(safe-area-inset-bottom)); font-size: 0.9rem; }
.footer__row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.footer__brand { display: inline-block; padding: 0.15rem 0.8rem; background: #fff; color: var(--green); border-radius: 999px; font-weight: 700; }

/* ---------- Impresión (hoja de preparación) ---------- */
@media print {
  .topbar, .footer, .adminnav, .no-print, .toast { display: none !important; }
  body { font-size: 12pt; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
  .table-wrap { border: 0; }
  .table th { background: none; }
  a { color: inherit; }
}

/* Grupo de campos (proveedores) */
.fieldset { margin: 0 0 1rem; padding: 0.9rem 1rem 0.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.fieldset legend { padding: 0 0.4rem; font-weight: 600; color: var(--green); }

/* Stock */
.stock { font-variant-numeric: tabular-nums; font-weight: 600; }
.stock--bajo { color: var(--orange-dark); }
.stock--cero { color: var(--danger); }
.refs-prov { margin: 0 0 1rem; padding: 0; list-style: none; font-size: 0.92rem; color: var(--muted); }
.refs-prov li { padding: 0.15rem 0; }
.refs-prov strong { color: var(--text); font-weight: 600; }
.form-grid > .card + .card { margin-top: 0; }

.req { color: var(--orange-dark); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; }
.kv dt { font-weight: 600; color: var(--green); }
.kv dd { margin: 0; }
.servido-ok { color: var(--green); font-weight: 600; }
.servido-parcial { color: var(--orange-dark); font-weight: 600; }
.qty-input { width: 6.5rem; min-height: 40px; padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-align: right; font-size: 16px; }

/* Albarán (pantalla e impresión) */
.albaran { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.albaran__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 3px solid var(--green); }
.albaran__title { text-align: right; }
.albaran__title h1 { margin: 0; font-size: 1.5rem; color: var(--green); }
.albaran__title p { margin: 0.2rem 0 0; font-weight: 600; }
.albaran__datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.5rem 2rem; margin-bottom: 1rem; }
.albaran__firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.5rem; }
.albaran__firmas div { border-top: 1px solid var(--ink, #222); padding-top: 0.4rem; min-height: 5rem; }
.albaran__firmas span { font-size: 0.85rem; color: var(--muted, #666); }
@media print {
  .albaran { border: 0; padding: 0; }
  .albaran__head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Buscador en vivo */
.search__panel {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0.35rem;
}
.search__panel.is-loading { opacity: 0.7; }
.live__item { display: flex; align-items: center; gap: 0.25rem; border-radius: var(--radius-sm); }
.live__item.is-active, .live__item:hover { background: var(--green-softer); }
.live__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0.5rem; color: inherit; text-decoration: none; }
.live__img { flex: none; width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--green-softer); border: 1px solid var(--line); }
.live__text { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; align-items: flex-start; }
.live__name { font-size: 0.95rem; line-height: 1.25; }
.live__name small { color: var(--muted); }
.live__why, .live__meta { font-size: 0.8rem; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.live__item mark { background: #ffe2bf; color: inherit; border-radius: 3px; padding: 0 1px; }
.live__btn {
  flex: none; width: 40px; height: 40px; margin-right: 0.35rem; border-radius: 999px;
  border: 1px solid var(--green); background: #fff; color: var(--green); font: 600 1.4rem/1 var(--font); cursor: pointer;
}
.live__btn:hover { background: var(--green); color: #fff; }
.live__btn.is-busy { opacity: 0.5; }
.live__btn.is-done { background: var(--green); color: #fff; }
.live__all { display: block; padding: 0.6rem 0.75rem; margin-top: 0.25rem; border-top: 1px solid var(--line); font-weight: 600; color: var(--green); text-decoration: none; }
.live__all:hover { text-decoration: underline; }
.live__empty { margin: 0; padding: 0.8rem 0.75rem; color: var(--muted); }

/* Permisos (rol personalizado) */
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.permisos { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.permisos__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.permisos__head h2 { margin: 0; }
.permisos__tabla th.c, .permisos__tabla td.c { text-align: center; width: 76px; }
.permisos__tabla input[type="radio"] { width: 20px; height: 20px; accent-color: var(--green); cursor: pointer; }
.permisos__tabla td { vertical-align: middle; }
@media (max-width: 640px) {
  .permisos__tabla th.c, .permisos__tabla td.c { width: 48px; padding-left: .25rem; padding-right: .25rem; }
}

/* Secciones en «solo ver»: sin botones de crear, guardar ni borrar */
.solo-lectura main form[method="post"] button[type="submit"],
.solo-lectura main form[method="post"].js-solo-accion,
.solo-lectura main [data-editar] { display: none !important; }
.solo-lectura main input:disabled, .solo-lectura main select:disabled, .solo-lectura main textarea:disabled,
fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea { background: #f4f8f5; color: var(--text); opacity: 1; cursor: default; }
.sin-pedidos .addform, .sin-pedidos .live__btn { display: none !important; }

/* Entregas a operarios: firma, avisos, máquinas */
.count--alerta { background: var(--orange); color: #fff; margin-left: .3rem; }
.alert--firma { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; background: #fff4e5; color: #8a4b00; border-color: #ffd8a8; }
.alert--firma span { flex: 1 1 260px; }
.card--alerta { border-color: #ffd8a8; background: #fffaf3; }
.card--alerta h2 { display: flex; align-items: center; gap: .5rem; color: #b45f00; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.lista-simple li:first-child { border-top: 0; }
.texto-alerta { color: var(--danger); font-weight: 600; }
.check--sm { display: flex; justify-content: flex-end; gap: .4rem; margin: .15rem 0; font-size: .9rem; white-space: nowrap; }
.badge--tipo { font-size: .72rem; white-space: nowrap; }
.firma-card { margin-top: 1rem; }
.firma-pad { position: relative; border: 2px dashed var(--green-mid); border-radius: var(--radius-sm); background: #fff; touch-action: none; }
.firma-pad.is-firmado { border-style: solid; }
.firma-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.firma-pad__linea { position: absolute; left: 6%; right: 6%; bottom: 22%; border-bottom: 1px solid #c9d8ce; pointer-events: none; }
.albaran__firma img { display: block; max-width: 280px; max-height: 95px; margin-bottom: .3rem; }
.albaran .badge { margin-top: .35rem; }
.estado-tabla td { vertical-align: middle; }
.form-grid > * { min-width: 0; }

/* Máquinas en el catálogo */
.product--maquina .product__media { position: relative; }
.product__estado { position: absolute; top: .5rem; left: .5rem; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--green); }
.product__estado.is-ocupada { background: #7a8a80; }
.product--maquina.is-ocupada .product__img { filter: grayscale(.8); opacity: .65; }
.product__aviso { margin: .4rem 0 0; font-size: .82rem; line-height: 1.35; color: #8a4b00; background: #fff4e5; border-radius: 8px; padding: .45rem .6rem; }
.disponibilidad { display: flex; flex-direction: column; gap: .2rem; margin: 1rem 0; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.disponibilidad.is-libre { background: #e3f3e8; border-color: #b9dcc4; color: var(--green-dark); }
.disponibilidad.is-ocupada { background: #fff4e5; border-color: #ffd8a8; color: #8a4b00; }
.disponibilidad span { font-size: .9rem; }
.live__why.is-libre { color: var(--green); font-weight: 600; }

/* Catálogo para imprimir: A4, 4 columnas × 6 filas */
.imprimir-cats__lista { max-height: 340px; overflow-y: auto; padding-right: .5rem; }
.imprimir-cats .check { margin: .15rem 0; }
.hojas { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; overflow-x: auto; padding: .5rem 0 1.5rem; }
.hoja { flex: none; width: 189mm; height: 272mm; padding: 0; background: #fff; box-shadow: 0 4px 24px rgba(0, 60, 20, .15); display: flex; flex-direction: column; color: #1d3b26; font-size: 8pt; }
@media screen { .hoja { box-sizing: content-box; padding: 6mm; } }
.hoja__cab { flex: none; height: 12mm; display: flex; align-items: center; gap: 4mm; border-bottom: .6mm solid var(--green); margin-bottom: 2.5mm; }
.hoja__cab img { height: 8mm; width: auto; }
.hoja__titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.hoja__titulo strong { font-size: 11pt; color: var(--green); }
.hoja__titulo span { font-size: 7.5pt; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hoja__pag { font-size: 7.5pt; text-align: right; color: var(--muted); line-height: 1.3; }
.hoja__rejilla { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(6, 1fr); gap: 2mm; }
.ficha { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border: .25mm solid #cfe0d5; border-radius: 2mm; padding: 1.6mm 2mm; break-inside: avoid; }
.ficha--vacia { border-style: dashed; border-color: #eef4f0; }
.ficha__foto { flex: none; height: 19mm; display: flex; align-items: center; justify-content: center; margin-bottom: 1.2mm; }
.ficha__foto img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ficha__foto span { color: #c9d8ce; }
.ficha__foto .icon { width: 10mm; height: 10mm; }
.ficha__codigos { display: flex; flex-wrap: wrap; gap: .5mm 1.5mm; align-items: baseline; }
.ficha__cod { font-weight: 700; color: var(--green); font-size: 8pt; letter-spacing: .02em; }
.ficha__fab { font-size: 6.8pt; color: #3d5a46; background: #eef5f0; border-radius: 1mm; padding: 0 1mm; }
.ficha__nombre { margin: .6mm 0 0; font-size: 7.6pt; font-weight: 600; line-height: 1.2; color: #13301d; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ficha__desc { margin: .5mm 0 0; font-size: 6.6pt; line-height: 1.22; color: #4a6352; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ficha__pie { margin: auto 0 0; padding-top: .5mm; font-size: 6.2pt; color: #7a8a80; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media print {
  .hojas { display: block; padding: 0; gap: 0; overflow: visible; }
  .hoja { box-shadow: none; margin: 0; break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hoja:last-child { break-after: auto; page-break-after: auto; }
  body:has(.hojas) .main { max-width: none; margin: 0; padding: 0; }
  body:has(.hojas) { background: #fff; }
  body:has(.hojas) .alert { display: none !important; }
}

/* Buscadores en vivo para elegir (proyecto, operario, artículo…) */
.combo-panel { position: absolute; z-index: 80; max-height: min(55vh, 380px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .25rem; }
.combo-panel__item { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: 8px; cursor: pointer; }
.combo-panel__item:hover, .combo-panel__item.is-active { background: var(--green-softer); }
.combo-panel__item img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: var(--green-softer); flex: none; }
.combo-panel__item span { display: flex; flex-direction: column; min-width: 0; }
.combo-panel__item strong { font-weight: 600; font-size: .95rem; line-height: 1.25; color: var(--text); }
.combo-panel__item small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.combo-panel mark { background: #ffe2bf; color: inherit; border-radius: 3px; }
.combo-panel__vacio { margin: 0; padding: .7rem .75rem; color: var(--muted); font-size: .9rem; }
main.is-cargando > *:not(form.toolbar) { opacity: .55; transition: opacity .15s; }
@media print { .combo-panel { display: none !important; } }

/* Almacenes, inventario, recuento y compras */
.print-only { display: none; }
[data-alm][hidden] { display: none !important; }
@media print {
  .print-only { display: block; }
  .recuento .qty-input { border: 1px solid #999; background: #fff; width: 5.5rem; }
  .recuento td, .recuento th { padding-top: 0.45rem; padding-bottom: 0.45rem; }
  .recuento tr { break-inside: avoid; }
  .chips, .stats, .toolbar, .pager { display: none !important; }
}

/* Stock por almacén en el catálogo */
.stock-alm { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; margin: 0.15rem 0 0.4rem; font-size: 0.8rem; line-height: 1.3; }
.stock-alm div { display: inline-flex; gap: 0.3rem; }
.stock-alm dt { color: var(--muted); }
.stock-alm dd { margin: 0; }
.stock-alm--grande { font-size: 0.95rem; gap: 0.3rem 1.25rem; margin: 0.25rem 0 1rem; padding: 0.6rem 0.8rem; background: var(--green-softer); border-radius: var(--radius-sm); }
.precio-barato { color: var(--green); font-weight: 700; }
.precio-caro { color: var(--orange-dark); }

/* Reparaciones */
.reparaciones { display: grid; gap: 0.9rem; }
@media (min-width: 900px) { .reparaciones { grid-template-columns: 1fr 1fr; } }
.reparacion { border-left: 4px solid var(--orange); }
.reparaciones > .reparacion { margin: 0 !important; }
.reparacion__cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.reparacion__cab .ref { margin-right: 0.35rem; }
.reparacion__averia { margin: 0.6rem 0; padding: 0.6rem 0.75rem; background: #fff4e6; border-radius: var(--radius-sm); }
.reparacion__acciones { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.reparacion__acciones .input { flex: 1 1 220px; }
.count--nav { margin-left: 0.15rem; }

/* Campanita de notificaciones */
.menu--notif summary { position: relative; padding: 0 0.6rem; }
.menu--notif summary .count { position: absolute; top: 2px; right: 0; min-width: 1.2rem; height: 1.2rem; font-size: 0.7rem; padding: 0 0.3rem; margin: 0; }
.menu--notif summary .count[hidden] { display: none; }
.notif-panel { width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
@media (max-width: 520px) { .menu--notif { position: static; } .notif-panel { left: 12px; right: 12px; width: auto; } }
.notif-panel__cab { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); }
.notif-panel__cab strong { color: var(--green); }
.menu__panel .notif-panel__todas { display: inline; width: auto; min-height: 0; padding: 0.25rem 0.4rem; font-size: 0.82rem; color: var(--green); text-decoration: underline; }
.notif-panel__lista { max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; padding: 0.3rem; }
.notif-panel__vacio { margin: 0; padding: 1.25rem 0.9rem; color: var(--muted); text-align: center; }
.menu__panel a.notif-panel__ver { justify-content: center; min-height: 42px; border-top: 1px solid var(--line); border-radius: 0; color: var(--green); font-weight: 600; }
.menu__panel a.notif, a.notif {
  display: flex; align-items: flex-start; gap: 0.7rem; min-height: 0; padding: 0.65rem 0.6rem;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; position: relative;
}
a.notif:hover { background: var(--green-softer); }
a.notif.is-nueva { background: #fff8ef; }
a.notif.is-nueva::after { content: ''; position: absolute; right: 0.6rem; top: 0.95rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--orange); }
.notif__icono { flex: 0 0 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; background: var(--green-softer); color: var(--green); }
.notif__icono .icon { width: 1.1rem; height: 1.1rem; }
.notif__icono--naranja { background: #fff0dc; color: var(--orange-dark); }
.notif__icono--rojo { background: #fde8e6; color: var(--danger); }
.notif__icono--azul { background: #e5f0fa; color: #1d6fb8; }
.notif__cuerpo { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; padding-right: 1rem; font-size: 0.92rem; line-height: 1.35; }
.notif__cuerpo strong { font-weight: 600; }
a.notif:not(.is-nueva) .notif__cuerpo strong { font-weight: 500; }
.notif__cuerpo span { color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif__cuerpo small { color: var(--muted); font-size: 0.78rem; }
.notif-lista { padding: 0.4rem; }
.notif-lista a.notif + a.notif { border-top: 1px solid var(--line); border-radius: 0; }
/* Los desplegables de arriba (campanita, usuario, buscador) quedan por encima del menú verde */
.topbar__row { position: relative; z-index: 45; }

/* ------------------------------------------------------------------
   App unificada: barra de apps e inicio
   ------------------------------------------------------------------ */
.appsbar { background: var(--green-softer); border-bottom: 1px solid var(--line); }
.appsbar__row { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.appsbar__row::-webkit-scrollbar { display: none; }
.appsbar__link {
  display: inline-flex; align-items: center; gap: 0.4rem; flex: 0 0 auto;
  min-height: 44px; padding: 0 0.8rem;
  color: var(--green-mid); font-weight: 600; font-size: 0.95rem;
  border-bottom: 3px solid transparent;
}
.appsbar__link .icon { width: 18px; height: 18px; }
.appsbar__link:hover { color: var(--green); background: rgba(0, 113, 38, 0.06); }
.appsbar__link.is-active { color: var(--green); border-bottom-color: var(--orange); }
@media (max-width: 520px) { .appsbar__link { padding: 0 0.6rem; font-size: 0.9rem; } }

.apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0.9rem; }
@media (min-width: 700px) { .apps { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 1.1rem; } }
.icon.icon--linea { fill: none; }
.appcard {
  --c: var(--green); --c2: var(--green-mid);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 1rem;
  padding: 1.1rem 1.1rem 1.1rem 1.2rem; height: 100%;
  background: #fff; background: color-mix(in srgb, var(--c) 6%, #fff);
  border: 1px solid var(--line); border-color: color-mix(in srgb, var(--c) 18%, #fff);
  border-radius: 18px; color: var(--text);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.appcard::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c2) 22%, transparent) 0%, transparent 70%); pointer-events: none;
}
.appcard:hover { color: var(--text); transform: translateY(-3px); border-color: var(--c);
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--c) 45%, transparent); }
.appcard__ico {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c2) 0%, var(--c) 100%);
  box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--c) 60%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.appcard__ico .icon { width: 30px; height: 30px; stroke-width: 1.9; }
.appcard__txt { display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 1; }
.appcard__txt strong { font-size: 1.2rem; font-weight: 600; color: var(--c); }
.appcard__txt span { color: var(--muted); font-size: .92rem; line-height: 1.35; }
.appcard__go { color: var(--c); }
@media (min-width: 700px) {
  .appcard { grid-template-columns: 1fr; justify-items: start; align-items: start; align-content: start; padding: 1.4rem; gap: .9rem; }
  .appcard__go { display: none; }
}
.appsbar__link .icon { color: var(--c, currentColor); }


@media (max-width: 560px) {
  .appsbar__row { padding: 0; gap: 0; }
  /* cada app con su nombre entero; si no caben todas, la barra se desliza de lado */
  .appsbar__row { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .appsbar__link { flex: 1 0 auto; min-width: 66px; flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 4px 6px; font-size: .74rem; line-height: 1.1; scroll-snap-align: start; }
  .appsbar__link span { white-space: nowrap; }
  .appsbar__link .icon { width: 20px; height: 20px; }
}
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .35rem 1rem; }
.disp-ok { color: var(--green, #007126); font-weight: 600; }
.disp-falta { color: #c0392b; font-weight: 700; }

/* Campos de fecha: en el iPhone salían más anchos que el resto y con la fecha centrada */
input[type="date"] {
  -webkit-appearance: none; appearance: none;
  display: block; min-width: 0; max-width: 100%; box-sizing: border-box;
  text-align: left; line-height: 1.3; color: inherit;
}
.toolbar input[type="date"] { display: inline-block; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
.field { min-width: 0; }

/* Interruptores (permisos y opciones que se activan o desactivan) */
.switches { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: .4rem 0 .8rem; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: #cfd8d2; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid rgba(0, 113, 38, .35); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.switch--solo { gap: 0; }
.permisos--flota { margin-top: 1.25rem; }
.permisos__tabla--sw { margin-bottom: .8rem; }
.permisos__tabla--sw thead th:first-child { font-size: 1rem; }
.permisos__todo { display: inline-flex; gap: .3rem; margin-left: .6rem; vertical-align: middle; }
.permisos__tabla--sw td { padding-top: .45rem; padding-bottom: .45rem; }
@media (max-width: 640px) { .permisos__tabla--sw th.c, .permisos__tabla--sw td.c { width: 64px; } .permisos__todo { display: flex; margin: .3rem 0 0; } }
.inicio-ajustes { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.5rem; }
.ficha-usuario .fieldset { margin-top: .9rem; }
.ficha-usuario .fieldset:first-of-type { margin-top: 0; }
.switches--col { flex-direction: column; gap: .55rem; }
.permisos__app { margin-top: 1rem; }
.permisos__app-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .3rem; }
.permisos__app-cab h3 { margin: 0; font-size: 1.05rem; color: var(--green); }
.permisos__app .permisos__todo { margin-left: 0; }

/* Ficha del usuario: todo en tablas como las de permisos (texto a la izquierda, campo o interruptor a la derecha) */
.ficha-usuario .permisos__app:first-of-type { margin-top: 0; }
.ficha-tabla td { vertical-align: middle; }
.ficha-tabla td label { font-weight: inherit; color: inherit; }
.ficha-tabla th.ficha-ctl, .ficha-tabla td.ficha-ctl { width: 46%; text-align: right; }
.ficha-tabla td.ficha-ctl input:not([type=checkbox]), .ficha-tabla td.ficha-ctl select { width: 100%; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: 16px; }
.ficha-tabla td.ficha-ctl input:disabled, .ficha-tabla td.ficha-ctl select:disabled { background: #f3f6f4; color: var(--muted, #5b6b61); }
.ficha-link { font-weight: 700; font-size: .9rem; }
@media (max-width: 640px) {
  .ficha-tabla thead { display: none; }
  .ficha-tabla tr { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .4rem .8rem; padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
  .ficha-tabla td { display: block; border: 0; padding: 0; width: auto !important; }
  .ficha-tabla td.ficha-ctl:has(input:not([type=checkbox])), .ficha-tabla td.ficha-ctl:has(select) { grid-column: 1 / -1; }
}

/* Artículos: almacén que se mira y filtros por columna */
.art-alm { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 1rem; padding: .7rem .9rem; background: #f4f8f5; border: 1px solid var(--line); border-radius: 14px; }
.art-alm label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--green); }
.art-alm select { flex: 1 1 240px; max-width: 420px; font-weight: 600; }
.art-tabla .art-filtro th { padding-top: 0; padding-bottom: .6rem; }
.art-tabla .art-filtro .input { width: 100%; min-width: 0; min-height: 2.3rem; padding: .35rem .6rem; font-size: .9rem; font-weight: 400; }
.art-tabla .art-filtro th:nth-child(6) .input { min-width: 7.5rem; }
@media (max-width: 699px) {
  .art-tabla thead { display: block; }
  .art-tabla thead tr:first-child { display: none; }
  .art-tabla .art-filtro { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
  .art-tabla .art-filtro th { display: block; padding: 0; border: 0; background: transparent; }
  .art-tabla .art-filtro th:first-child { display: none; }
  .art-tabla .art-filtro th::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0 0 .15rem; }
  .art-tabla .art-filtro th:nth-child(3) { grid-column: 1 / -1; }
}
.toolbar input[type="file"] { min-width: 0; max-width: 100%; }

/* Buscador en vivo de los desplegables (flota/combo.js), también en las páginas de Almacén y Repostajes */
.uc { position: relative; display: block; width: 100%; }
select[data-combo][hidden] { display: none !important; }
.uc__in { box-sizing: border-box; width: 100%; min-height: 44px; padding: .5rem 2.3rem .5rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: .98rem; font-weight: 500; color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d7a66' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px; }
.uc__in::placeholder { color: #8aa393; font-weight: 400; }
.uc__in:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-softer); }
.uc__lista { position: fixed; z-index: 1000; margin: 0; padding: .3rem; list-style: none; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 60, 20, .18); font-family: var(--u-font); }
.uc__lista[hidden] { display: none; }
.uc__op { padding: .6rem .7rem; border-radius: 8px; font-size: .95rem; font-weight: 500; color: var(--text); cursor: pointer; line-height: 1.25; }
.uc__op.is-act { background: var(--green-softer); color: var(--green-dark); }
.uc__op.is-sel { font-weight: 700; }
.uc__op.is-nada { color: var(--muted); font-style: italic; }
.uc__nada { padding: .7rem; font-size: .9rem; color: var(--muted); }
.uc .uc__in { padding-right: 2.3rem; }

/* ---------- App Repostajes ---------- */
.rpj-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; }
.rpj-tabs__a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1rem; border-radius: 999px; background: #e3f3f4; color: #0e5f66; font-weight: 600; text-decoration: none; }
.rpj-tabs__a:hover { background: #cdeaec; }
.rpj-tabs__a.is-active { background: #0e7c86; color: #fff; }
.rpj-form { max-width: 720px; }
.rpj-origen { border: 0; padding: 0; margin: .2rem 0 .8rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.rpj-origen legend { font-weight: 600; color: var(--green); margin-bottom: .3rem; padding: 0; }
.btn--lg { min-height: 52px; padding: 0 1.6rem; font-size: 1.05rem; }
.rpj-stock-mini { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.rpj-stock-mini__i { display: flex; flex-direction: column; padding: .55rem .9rem; border-radius: 12px; background: #e3f3f4; color: #0e5f66; text-decoration: none; min-width: 120px; }
.rpj-stock-mini__i span { font-size: .85rem; }
.rpj-stock-mini__i.is-bajo { background: #fde8e6; color: var(--danger); }
.rpj-filtros .uc { flex: 1 1 220px; width: auto; }
.rpj-filtros .uc__in { min-height: 44px; }
.rpj-fecha { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); }
.rpj-fecha .input { width: auto; flex: 0 1 auto; }
.rpj-depositos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.rpj-dep { padding: 1rem; border-radius: var(--radius); background: #e3f3f4; display: flex; flex-direction: column; gap: .35rem; }
.rpj-dep.is-bajo { background: #fde8e6; }
.rpj-dep.is-off { opacity: .55; }
.rpj-dep__cab { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: #0e5f66; }
.rpj-dep.is-bajo .rpj-dep__cab, .rpj-dep.is-bajo .rpj-dep__l { color: var(--danger); }
.rpj-dep__ed { font-size: .85rem; }
.rpj-dep__l { font-size: 1.8rem; font-weight: 700; color: #0e7c86; line-height: 1.1; }
.rpj-dep__barra { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.rpj-dep__barra i { display: block; height: 100%; background: #0e7c86; border-radius: 99px; }
.rpj-dep.is-bajo .rpj-dep__barra i { background: var(--danger); }
.rpj-dep__info { font-size: .85rem; color: var(--muted); line-height: 1.4; }
.rpj-acciones { align-items: start; margin-bottom: 1rem; }

/* Ficha de máquina en el catálogo: marca, modelo, n.º de serie y cadena compatible */
.maq-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem 1rem; margin: .6rem 0 1rem; }
.maq-datos div { min-width: 0; }
.maq-datos dt { font-size: .75rem; color: var(--muted, #5d7a66); text-transform: uppercase; letter-spacing: .03em; }
.maq-datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.maq-cadena { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 12px; background: var(--green-softer, #eef7f1); }
.maq-cadena > span:first-child { font-size: .75rem; color: var(--muted, #5d7a66); text-transform: uppercase; letter-spacing: .03em; width: 100%; }
.maq-cadena a { font-weight: 600; text-decoration: none; }

/* Repostar: elegir si el contador va en km o en horas */
.rpj-unidad { display: inline-flex; gap: .25rem; margin: 0 0 .4rem; padding: .2rem; border-radius: 999px; background: var(--green-softer); }
.rpj-unidad label { display: inline-flex; align-items: center; gap: .3rem; min-height: 36px; padding: 0 .9rem; border-radius: 999px; font-weight: 600; cursor: pointer; }
.rpj-unidad input { margin: 0; }
.rpj-unidad label:has(input:checked) { background: #fff; color: var(--green, #007126); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* Mis trabajos (choferes de camiones): viajes asignados por días */
.mt-dia { margin: 1.4rem 0; }
.mt-dia__cab { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin: 0 0 .6rem; font-size: 1.15rem; }
.mt-dia__cab small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.mt-dia__rel { display: inline-block; padding: .1rem .6rem; border-radius: 999px; background: #174ea6; color: #fff; font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; }
.mt-dia.is-hoy .mt-dia__rel { background: var(--orange, #fa8500); }
.mt-viaje { border: 1px solid var(--green-soft); border-left: 5px solid #174ea6; border-radius: 14px; background: #fff; padding: .8rem 1rem; margin: 0 0 .7rem; min-width: 0; }
.mt-viaje.is-curso { border-left-color: var(--orange, #fa8500); background: #fff8ef; }
.mt-viaje.is-hecho { border-left-color: var(--green, #007126); opacity: .85; }
.mt-viaje__cab { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.mt-viaje__hora { font-size: 1.15rem; font-weight: 700; }
.mt-viaje__est { font-size: .78rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px; background: #e8eefb; color: #174ea6; }
.mt-viaje.is-curso .mt-viaje__est { background: #ffe9cc; color: #a55400; }
.mt-viaje.is-hecho .mt-viaje__est { background: var(--green-softer); color: var(--green, #007126); }
.mt-viaje__ruta { margin: .35rem 0 .5rem; font-size: 1.02rem; overflow-wrap: anywhere; }
.mt-viaje__datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .35rem 1rem; margin: 0 0 .5rem; }
.mt-viaje__datos div { min-width: 0; }
.mt-viaje__datos dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.mt-viaje__datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.mt-viaje__obs { margin: 0 0 .6rem; padding: .5rem .7rem; border-radius: 10px; background: var(--green-softer); font-size: .92rem; overflow-wrap: anywhere; }
.mt-viaje__btns { display: flex; flex-wrap: wrap; gap: .4rem; }

/* Maquinaria: miniatura de la foto en la lista */
.table td.maq-foto { width: 64px; padding-right: 0; }
.table td.maq-foto .thumb { width: 56px; height: 56px; object-fit: cover; mix-blend-mode: normal; }

/* Pedir aunque no haya stock: el almacén lo pide al proveedor */
.stock-aviso { display: block; color: var(--orange-dark); margin-top: .25rem; }
.badge--falta { --badge: #b35a00; }

/* «Recibido y conforme» / «Recibido no conforme» (sustituye a la firma con el dedo) */
.conformidad { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.conformidad .btn { width: 100%; justify-content: center; min-height: 56px; }
@media (max-width: 560px) { .conformidad { grid-template-columns: 1fr; } }
.conf { margin: 0 0 .3rem; font-weight: 700; font-size: 1.05rem; }
.conf--si { color: #007126; }
.conf--no { color: #c0392b; }
.conformidad .conformidad__no { background: var(--danger); border-color: var(--danger); color: #fff; }
.conformidad .conformidad__no:hover { background: #a93226; color: #fff; }
.maq-acc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; width: 100%; }
/* Ficha de la máquina: lista de accesorios compatibles */
.acc-lista { display: flex; flex-direction: column; gap: .45rem; }
.acc-fila { display: flex; gap: .45rem; align-items: center; }
.acc-fila .combo, .acc-fila > input { flex: 1; min-width: 0; }
/* Usuarios y permisos: filtros */
.filtros-usuarios { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0; }
.filtros-usuarios .js-fu-q { flex: 1 1 260px; min-width: 0; }
.filtros-usuarios select { flex: 0 1 auto; max-width: 100%; }
.filtros-usuarios .js-fu-cuenta { margin-left: auto; }
@media (max-width: 640px) { .filtros-usuarios select, .filtros-usuarios .js-fu-q { flex: 1 1 100%; } .filtros-usuarios .js-fu-cuenta { margin-left: 0; } }
.js-fu-fila[hidden], .js-fu-vacio[hidden] { display: none !important; }
.filtros-usuarios .input { width: auto; } .filtros-usuarios .js-fu-q { width: auto; flex: 1 1 260px; }
@media (max-width: 640px) { .filtros-usuarios .input, .filtros-usuarios .js-fu-q { width: 100%; flex: 1 1 100%; } }

/* Maquinaria: devolución rápida desde la lista */
.dev-rapida { position: relative; }
.dev-rapida > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.dev-rapida > summary::-webkit-details-marker { display: none; }
.dev-rapida-celda { width: 1%; white-space: nowrap; text-align: right; }
.dev-rapida__btn { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .7rem; border: 2px solid var(--orange, #fa8500); border-radius: 10px; color: var(--orange-dark, #c76a00); background: #fff; font-weight: 800; font-size: .85rem; line-height: 1.1; }
.dev-rapida__btn .icon { width: 1rem; height: 1rem; }
.dev-rapida__btn:hover, .dev-rapida[open] > .dev-rapida__btn { background: var(--orange, #fa8500); color: #fff; }
.dev-rapida[open] > summary::before { content: ''; position: fixed; inset: 0; z-index: 1000; background: rgba(15, 30, 22, .45); cursor: default; }
.dev-rapida__caja { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1001; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; white-space: normal; display: flex; flex-direction: column; gap: .6rem; padding: .8rem; background: #fff; border: 1px solid var(--line, #d7e6dc); border-radius: 14px; box-shadow: 0 14px 34px rgba(0,0,0,.16); text-align: left; }
.dev-rapida__mal { display: flex; flex-direction: column; gap: .4rem; padding-top: .6rem; border-top: 1px solid var(--line, #e3ece6); }
.dev-rapida__caja .hint { margin: 0; }
.dev-rapida__cab { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line, #e3ece6); font-size: 1rem; }
.dev-rapida__x { flex: none; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: #eef3f0; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.dev-rapida__x:hover { background: #dde8e1; }
@media (max-width: 760px) {
  .dev-rapida-celda { padding-top: .4rem; }
  .dev-rapida > summary { display: flex; justify-content: center; width: 100%; }
}

/* Resumen de IVA (pedidos y albaranes de compra) */
.iva-resumen { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 1rem; padding: 1rem; border: 1px solid var(--line, #d7e6dc); border-radius: 14px; background: #f6faf7; }
.iva-resumen__tipo { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; }
.iva-resumen__tipo select { min-width: 14rem; }
.iva-resumen dl { display: grid; grid-template-columns: auto auto; gap: .25rem 1.5rem; margin: 0; text-align: right; }
.iva-resumen dt { color: var(--muted, #5b6b62); }
.iva-resumen dd { margin: 0; font-variant-numeric: tabular-nums; }
.iva-resumen .iva-resumen__total { font-size: 1.15rem; font-weight: 800; color: var(--text, #13261a); border-top: 1px solid var(--line, #d7e6dc); padding-top: .3rem; }
@media print { .iva-resumen { background: none; } .iva-resumen select { border: 0; appearance: none; } }

/* IVA de pedidos y albaranes de compra */
.iva-resumen { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 1rem 2rem; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line, #d7e6dc); border-radius: 14px; background: #fafcfb; }
.iva-resumen__tipo { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .9rem; }
.iva-resumen__tipo select { min-width: 12rem; }
.iva-resumen dl { display: grid; grid-template-columns: auto auto; gap: .25rem 1.5rem; margin: 0; min-width: 15rem; }
.iva-resumen dt { color: var(--muted, #5b6b62); }
.iva-resumen dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.iva-resumen .iva-resumen__total { font-weight: 800; font-size: 1.1rem; color: var(--text, #10261a); padding-top: .3rem; border-top: 1px solid var(--line, #d7e6dc); }

/* Editor de menús (Configuración › Menús): arrastrar y soltar */
.me-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; min-height: 1.2rem; }
.me-hijos { margin: .4rem 0 .2rem 1.9rem; padding: .35rem 0 .35rem .7rem; border-left: 3px solid var(--line, #d7e6dc); min-height: 2.4rem; }
.me-hijos:empty::before { content: 'Arrastra aquí opciones para meterlas en este grupo'; color: var(--muted, #6b7d72); font-size: .85rem; padding: .5rem; }
.me-fila { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem .6rem; background: #fff; border: 1px solid var(--line, #d7e6dc); border-radius: 12px; }
.me-grupo > .me-fila { background: #f2f8f4; font-weight: 700; }
.me-asa { cursor: grab; touch-action: none; user-select: none; font-size: 1.25rem; line-height: 1; color: var(--muted, #6b7d72); padding: .35rem .3rem; border-radius: 8px; }
.me-asa:hover { background: rgba(0,0,0,.05); color: var(--green, #007126); }
.me-ico { color: var(--green, #007126); }
.me-nombre { flex: 1 1 0; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: .4rem .5rem; font: inherit; color: inherit; }
.me-nombre:hover, .me-nombre:focus { border-color: var(--line, #c9dccf); background: #fff; outline: none; }
.me-url { flex: 1 1 14rem; min-width: 0; order: 9; border: 1px solid var(--line, #c9dccf); border-radius: 8px; padding: .4rem .5rem; font: inherit; font-weight: 400; font-size: .9rem; }
.me-solo { order: 10; display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted, #5b6b62); white-space: nowrap; }
.me-tag { font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: #e3eefc; color: #1d5fbf; white-space: nowrap; }
.me-ojo, .me-quitar { border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; padding: .3rem .45rem; border-radius: 8px; }
.me-ojo:hover, .me-quitar:hover { background: rgba(0,0,0,.06); }
.me-quitar { color: var(--danger, #c62828); font-weight: 800; }
.me-item.is-oculto > .me-fila { opacity: .5; background: repeating-linear-gradient(135deg, #fff, #fff 8px, #f4f4f4 8px, #f4f4f4 16px); }
.me-item.is-oculto > .me-fila .me-nombre { text-decoration: line-through; }
.me-hueco { border: 2px dashed var(--orange, #fa8500); border-radius: 12px; background: #fff8ef; }
.me-arrastrando { display: none; }
.me-fantasma { position: fixed; z-index: 1000; pointer-events: none; opacity: .92; box-shadow: 0 14px 34px rgba(0,0,0,.2); border-radius: 12px; list-style: none; }
.me-fantasma .me-hijos { display: none; }
@media (max-width: 600px) { .me-url { flex-basis: 100%; } .me-hijos { margin-left: .8rem; } }

/* Artículo que no existe en un pedido o albarán de compra: crear o línea manual */
.combo-panel__nuevo { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 .8rem .6rem; }
.combo-panel__ayuda { margin: 0; padding: 0 .8rem .7rem; font-size: .8rem; color: var(--muted, #5b6b62); }
.linea-manual { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: #fff1de; color: #a25300; font-weight: 700; font-size: .8rem; }
tr.is-manual .js-art { font-style: italic; }
.art-nuevo { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 30, 18, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 1rem; overflow: auto; }
.art-nuevo__caja { width: min(520px, 100%); margin: 0; }
.art-nuevo__caja h2 { margin-top: 0; }
.art-nuevo__err { color: var(--danger, #c62828); font-weight: 600; }
.select-buscador { width: 100%; }
.combo-panel__item.is-elegida strong { color: var(--green, #1d7a46); }
