:root {
  --background: #f3f2ee;
  --foreground: #1c1c1c;
  --card: #fafaf7;
  --primary: #0061fe;
  --primary-foreground: #fafafa;
  --secondary: #e8e7e3;
  --muted: #e9e8e4;
  --muted-foreground: #7a7872;
  --destructive: #c23b2e;
  --success: #2f9d5a;
  --success-foreground: #fafafa;
  --ink: #161616;
  --ink-foreground: #f5f4f0;
  --border: #d4d3ce;
  --font: "Archivo", ui-sans-serif, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

.display-xl {
  font-family: var(--font);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.86;
  font-stretch: 75%;
  margin: 0;
}

.display-md {
  font-family: var(--font);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.9;
  font-stretch: 80%;
  margin: 0;
}

.label-mono {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.625rem;
}

.office-only {
  display: none;
}

.campo-only {
  display: block;
}

.shell {
  margin: 0 auto;
  min-height: 100vh;
  max-width: 520px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--background);
  padding-bottom: 6rem;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--foreground);
  background: color-mix(in srgb, var(--background) 95%, transparent);
  padding: 1rem 1.25rem;
  backdrop-filter: blur(8px);
}

.topbar-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.topbar img {
  height: 2.25rem;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  object-position: left;
}

.btn-back {
  flex-shrink: 0;
  border: 2px solid var(--foreground);
  padding: 0.25rem 0.5rem;
}

.bottom-nav-wrap {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  margin: 0 auto;
  max-width: 520px;
  border-top: 2px solid var(--foreground);
  background: var(--ink);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-wrap::before,
.bottom-nav-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.6rem;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.bottom-nav-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--ink), transparent);
}

.bottom-nav-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--ink) 28%, transparent);
}

.bottom-nav-wrap.has-left::before,
.bottom-nav-wrap.has-right::after {
  opacity: 1;
}

.bottom-nav-more {
  position: absolute;
  top: 50%;
  right: 0.15rem;
  z-index: 3;
  display: none;
  width: 1.7rem;
  height: 1.7rem;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--ink-foreground);
  transform: translateY(-50%);
}

.bottom-nav-wrap.has-right .bottom-nav-more {
  display: flex;
  animation: nav-nudge 1.35s ease-in-out infinite;
}

@keyframes nav-nudge {
  0%,
  100% { transform: translate(0, -50%); opacity: 0.55; }
  50% { transform: translate(5px, -50%); opacity: 1; }
}

.bottom-nav {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0.75rem;
  touch-action: pan-x;
  padding-right: 1.6rem;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.bottom-nav a {
  display: flex;
  flex: 0 0 auto;
  min-width: 5.75rem;
  height: 4.35rem;
  align-items: center;
  justify-content: center;
  border-right: 1px solid color-mix(in srgb, var(--ink-foreground) 15%, transparent);
  color: color-mix(in srgb, var(--ink-foreground) 60%, transparent);
  text-align: center;
  padding: 0 1.15rem;
  font-size: 0.62rem;
  scroll-snap-align: start;
  white-space: nowrap;
}

.bottom-nav a:last-child {
  border-right: 0;
}

.bottom-nav a.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.bottom-nav.is-admin {
  overflow: hidden;
  padding-right: 0;
  scroll-snap-type: none;
}

.bottom-nav.is-admin a {
  flex: 1 1 0;
  min-width: 0;
  height: 3.7rem;
  padding: 0 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.15;
  white-space: normal;
}

@media (max-width: 959px) {
  .admin-bloque.is-off {
    display: none !important;
  }
}

.office-aside {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  width: 13rem;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 2px solid var(--foreground);
  background: var(--ink);
  color: var(--ink-foreground);
}

.office-brand {
  border-bottom: 2px solid var(--foreground);
  background: var(--background);
  padding: 0.75rem;
}

.office-brand img {
  width: 100%;
  object-fit: contain;
}

.brand-text {
  display: block;
  font-family: var(--font);
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--foreground);
}

.office-brand .brand-text {
  max-width: 11rem;
}

.brand-text-sm {
  font-size: 0.95rem;
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text-auth {
  margin: 0 auto;
  font-size: 1.15rem;
  text-align: center;
  max-width: 16rem;
}

.office-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.5rem;
}

.office-nav a {
  padding: 0.5rem;
  color: color-mix(in srgb, var(--ink-foreground) 65%, transparent);
  font-size: 0.65rem;
}

.office-nav a:hover {
  background: color-mix(in srgb, var(--ink-foreground) 10%, transparent);
  color: var(--ink-foreground);
}

.office-nav a.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.office-nav .nav-icon {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.office-nav .nav-icon svg {
  flex-shrink: 0;
}

.office-nav .nav-pin {
  margin-top: auto;
}

.office-foot {
  border-top: 1px solid color-mix(in srgb, var(--ink-foreground) 15%, transparent);
  padding: 0.75rem;
  color: color-mix(in srgb, var(--ink-foreground) 40%, transparent);
  font-size: 0.6rem;
}

.btn-logout-nav {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.btn-logout-nav:hover {
  color: var(--ink-foreground);
}

.btn-logout-top {
  flex-shrink: 0;
  border: 2px solid var(--foreground);
  padding: 0.35rem 0.6rem;
  background: var(--card);
}

.office-head {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--foreground);
  background: color-mix(in srgb, var(--background) 95%, transparent);
  padding: 0.5rem 1.25rem;
  backdrop-filter: blur(8px);
}

.section {
  border-bottom: 2px solid var(--foreground);
  padding: 2rem 1.25rem;
}

.section:last-child {
  border-bottom: 0;
}

.section-pad {
  padding: 2rem 1.25rem;
}

.section-head {
  margin-bottom: 1.25rem;
}

.section-head.compact {
  margin-bottom: 0.5rem;
}

.section-head .kicker {
  color: var(--primary);
}

.section-head h2 {
  margin-top: 0.5rem;
  font-size: 2rem;
}

.section-head.compact h2 {
  margin-top: 0.125rem;
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-stretch: normal;
  line-height: 1.3;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--foreground);
  margin-top: 1.5rem;
}

.kpi {
  background: var(--background);
  padding: 1rem;
}

.kpi .num {
  font-size: 1.875rem;
}

.kpi .lbl {
  margin-top: 0.25rem;
  color: var(--muted-foreground);
}

.dash {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dash-hero {
  display: grid;
  gap: 0.75rem;
}

.dash-hero-item {
  border: 2px solid var(--foreground);
  padding: 1.15rem 1rem 1.25rem;
}

.dash-hero-item.is-pending {
  background: color-mix(in srgb, var(--primary) 12%, var(--card));
}

.dash-hero-item.is-done {
  background: var(--ink);
  color: var(--ink-foreground);
  border-color: var(--ink);
}

.dash-hero-item.is-done .label-mono {
  color: color-mix(in srgb, var(--ink-foreground) 70%, transparent);
}

.dash-amount {
  margin: 0.4rem 0 0;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.dash-sub {
  margin: 0.45rem 0 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.dash-hero-item.is-done .dash-sub {
  color: color-mix(in srgb, var(--ink-foreground) 72%, transparent);
}

.dash-grid {
  display: grid;
  gap: 0.75rem;
}

.dash-card {
  border: 2px solid var(--foreground);
  background: var(--card);
  padding: 1rem;
}

.dash-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.dash-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.dash-card-head a {
  color: var(--primary);
  flex-shrink: 0;
}

.dash-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.dash-card-actions .btn {
  width: auto;
  min-height: 2.25rem;
  height: 2.25rem;
  padding: 0 0.85rem;
}

.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.dash-stat,
.dash-fact {
  display: block;
  padding: 0.75rem 0.7rem 0.85rem;
  border: 2px solid var(--foreground);
  color: inherit;
}

.dash-stat.is-pending {
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.dash-stat.is-done {
  background: color-mix(in srgb, var(--success) 12%, var(--card));
}

.dash-fact.is-pending {
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.dash-fact.is-done {
  background: color-mix(in srgb, var(--success) 12%, var(--card));
}

.dash-count {
  margin: 0.35rem 0 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dash-eur {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dash-bar {
  margin-top: 0.85rem;
  height: 0.5rem;
  background: var(--secondary);
  border: 2px solid var(--foreground);
}

.dash-bar span {
  display: block;
  height: 100%;
  background: var(--success);
}

.dash-bar-lbl {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.dash-partial {
  display: block;
  margin-top: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 2px dashed var(--foreground);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
}

.dash-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.dash-fact .dash-eur {
  font-size: 0.8rem;
}

a.dash-stat:hover,
a.dash-fact:hover,
.dash-partial:hover,
.dash-alert:hover {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.dash-alert {
  display: block;
  padding: 0.85rem 1rem;
  border: 2px solid var(--foreground);
  background: color-mix(in srgb, var(--destructive) 10%, var(--card));
  font-weight: 700;
  font-size: 0.9rem;
}

.dash .actions-2 {
  margin-top: 0;
}

.home-campo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 0;
}

.home-campo-head {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

.home-campo-name {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--muted-foreground);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.home-campo-brand {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-campo-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 94%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.home-campo-marca {
  margin: 0;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(1.25rem, 6vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.95;
  text-align: center;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.home-actions {
  display: grid;
  gap: 0.85rem;
  margin-top: 0;
  flex-shrink: 0;
}

.home-campo .btn {
  min-height: 3.5rem;
  font-size: 0.7rem;
}

.btn-pedido {
  gap: 0.65rem;
}

.btn-pedido img {
  height: 1.6rem;
  width: auto;
  object-fit: contain;
}

.pedido-logo {
  display: block;
  max-width: 12rem;
  max-height: 3.5rem;
  margin: 1.5rem 0 0;
  object-fit: contain;
}

.pedido-search {
  position: relative;
}

.pedido-search .input {
  font-size: 1.05rem;
  padding: 0.9rem 0.85rem;
}

.pedido-search .suggest {
  background: var(--card);
  max-height: 16rem;
  overflow-y: auto;
}

.pedido-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--foreground);
}

.pedido-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 2px solid var(--foreground);
}

.pedido-item.is-on {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  margin: 0 -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.pedido-item-info h3 {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
}

.pedido-ref {
  color: var(--primary);
}

.pedido-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.pedido-qty-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--foreground);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  background: var(--card);
}

.pedido-qty-val {
  width: 2.4rem;
  height: 2.4rem;
  border: 2px solid var(--foreground);
  background: var(--background);
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0;
}

.pedido-cart {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.pedido-cart li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.pedido-bar {
  position: sticky;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin: 0 -1.25rem -1rem;
  padding: 0.85rem 1.25rem;
  border-top: 2px solid var(--foreground);
  background: var(--ink);
  color: var(--ink-foreground);
}

.pedido-bar .btn {
  min-height: 3rem;
  padding: 0 1rem;
}

.pedido-bar[hidden] {
  display: none !important;
}

@media (max-width: 959px) {
  html:has(.is-home),
  html:has(.is-home) body {
    min-height: 0;
    height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .shell:has(.home-campo) {
    display: flex;
    flex-direction: column;
    height: 100svh;
    min-height: 0;
    max-height: 100svh;
    overflow: hidden;
    padding-bottom: 0;
  }

  .shell:has(.home-campo) .main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .shell:has(.home-campo) .topbar {
    flex-shrink: 0;
    position: relative;
    padding: 0.65rem 1rem;
  }

  .shell:has(.home-campo) .body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
  }

  .home-campo {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0.7rem 1.15rem 0.5rem;
  }

  .home-campo-brand {
    min-height: 0;
    overflow: hidden;
  }

  .home-campo .home-actions {
    gap: 0.5rem;
  }

  .home-campo .btn {
    min-height: 2.95rem;
  }

  .shell:has(.home-campo) .office-head,
  .shell:has(.home-campo) .bottom-nav-wrap {
    flex-shrink: 0;
  }

  .pedido-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 4.35rem;
    margin: 0 auto;
    max-width: 520px;
  }

  .shell:has(#pedido-cart) {
    padding-bottom: 10.5rem;
  }
}

.informe-page {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.informe-bar {
  padding-bottom: 0.75rem;
  margin-bottom: 0;
}

.informe-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.informe-print {
  width: auto;
  min-height: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  flex-shrink: 0;
}

.informe-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
  margin-top: 0.65rem;
}

.informe-filtros .field {
  flex: 1 1 8.5rem;
  min-width: 7.5rem;
  margin: 0;
}

.informe-filtros .field + .field {
  margin-top: 0;
}

.informe-filtros .select {
  margin-top: 0.2rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.875rem;
}

.informe-marca {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 2px solid var(--foreground);
  background: var(--card);
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  min-height: 2.35rem;
  flex: 0 0 auto;
}

.informe-marca.is-on {
  background: color-mix(in srgb, var(--primary) 12%, var(--card));
}

.informe-marca input {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.informe-rango {
  margin: 0;
  align-self: center;
  flex: 1 1 auto;
}

.informe-nota {
  margin: 0 0 0.5rem;
}

.informe-res .res-hero {
  gap: 0.5rem;
}

.informe-res .dash-hero-item {
  padding: 0.6rem 0.7rem 0.7rem;
}

.informe-res .dash-amount {
  margin-top: 0.2rem;
  font-size: 1.45rem;
}

.informe-res .dash-sub {
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.res-parts {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.res-parts li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.res-parts em {
  display: block;
  font-style: normal;
  opacity: 0.72;
  font-size: 0.68rem;
}

.dash-hero-item.is-done .res-parts {
  color: color-mix(in srgb, var(--ink-foreground) 82%, transparent);
}

.res-parts .is-rech {
  color: var(--destructive);
}

.dash-hero-item.is-done .res-parts .is-rech {
  color: color-mix(in srgb, #ff8a7a 90%, #fff);
}

.res-parts .is-sum {
  margin-top: 0.15rem;
  padding-top: 0.2rem;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}

.res-hint {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  line-height: 1.3;
}

.table tr.is-rech-row td {
  background: color-mix(in srgb, var(--destructive) 8%, var(--card));
}

.informe-res .dash-card {
  padding: 0.65rem 0.75rem;
}

.informe-res .dash-card-head {
  margin-bottom: 0.45rem;
}

.informe-res .dash-card-head h2 {
  font-size: 0.85rem;
}

.informe-res .res-split {
  margin-top: 0.5rem;
}

.res-year {
  margin-top: 0.5rem;
}

.res-year .dash-card-head h2 {
  font-size: 0.95rem;
}

.chart-year {
  min-height: 8rem;
}

.chart-year .chart-col-bars {
  min-height: 7rem;
}

.chart-col.is-now .chart-col-lbl {
  color: var(--primary);
}

.chart-col.is-now .chart-col-bars {
  border-bottom-color: var(--primary);
}

.informe-res .chart-legend {
  margin-top: 0.4rem;
}

.informe-listados {
  border-top: 2px solid var(--foreground);
  padding-top: 0.85rem;
}

.informe-listados h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.informe-listados h3 + .table-wrap,
.informe-listados h3 + .empty {
  margin-top: 0;
}

.informe-listados h3:not(:first-child) {
  margin-top: 1rem;
}

.dash-hero-item.is-loss {
  background: color-mix(in srgb, var(--destructive) 12%, var(--card));
}

.dash-hero-item.is-loss .dash-amount {
  color: var(--destructive);
}

.res-split {
  display: grid;
  gap: 0.5rem;
}

.chart-bars {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  min-height: 6.25rem;
}

.chart-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.chart-col-bars {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 5.5rem;
  border-bottom: 2px solid var(--foreground);
}

.chart-bar {
  display: block;
  width: 42%;
  min-height: 0;
  background: var(--foreground);
}

.chart-bar.is-in {
  background: var(--primary);
}

.chart-bar.is-out {
  background: var(--ink);
}

.chart-col-lbl {
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--muted-foreground);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted-foreground);
}

.chart-swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.25rem;
  vertical-align: -0.1rem;
  background: var(--ink);
}

.chart-swatch.is-in {
  background: var(--primary);
}

.chart-hbars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chart-hbar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.chart-hbar-track {
  height: 0.5rem;
  border: 2px solid var(--foreground);
  background: var(--secondary);
}

.chart-hbar-track span {
  display: block;
  height: 100%;
  background: var(--primary);
  min-width: 0;
}

.chart-hbar-track span.is-presupuestos {
  background: var(--ink);
}

.chart-hbar-track span.is-rechazados {
  background: var(--destructive);
}

.chart-hbar-track span.is-cat {
  background: var(--foreground);
}

.informe-totales {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.table tfoot td {
  border-top: 2px solid var(--foreground);
  font-weight: 700;
}

.informe-iva {
  margin-top: 0;
}

@media print {
  .topbar,
  .office-aside,
  .office-head,
  .bottom-nav,
  .bottom-nav-wrap,
  .no-print,
  .flash,
  .modal,
  .lightbox,
  .help-fab {
    display: none !important;
  }

  .shell,
  .main,
  .body {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .table {
    font-size: 11px;
  }
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0 0.75rem;
  text-align: center;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-ghost {
  border: 2px solid var(--foreground);
  color: var(--foreground);
}

.btn-success {
  background: var(--success);
  color: var(--success-foreground);
}

.btn-danger {
  border: 2px solid var(--foreground);
  color: var(--destructive);
}

.btn-dash {
  border: 2px dashed var(--foreground);
}

.btn-sm {
  min-height: 3rem;
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--foreground);
  border-bottom: 2px solid var(--foreground);
}

.doc-list li {
  border-bottom: 2px solid var(--foreground);
}

.doc-list li:last-child {
  border-bottom: 0;
}

.doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 1rem 0;
  align-items: start;
}

.doc-row .meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.doc-row h3 {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
}

.doc-row .sub {
  margin: 0.25rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.doc-row .amt {
  text-align: right;
  flex-shrink: 0;
}

.badge {
  padding: 0.125rem 0.5rem;
}

.badge-borrador,
.badge-pendiente {
  background: var(--secondary);
  color: var(--foreground);
}

.badge-enviado,
.badge-emitida {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-firmado,
.badge-aceptado,
.badge-procesado {
  background: var(--success);
  color: var(--success-foreground);
}

.badge-rechazado,
.badge-error {
  background: var(--destructive);
  color: #fff;
}

.badge-facturado {
  background: var(--ink);
  color: var(--ink-foreground);
}

.badge-facturado_parcial,
.badge-anticipo {
  background: color-mix(in srgb, var(--primary) 18%, var(--secondary));
  color: var(--foreground);
}

.badge-pendiente_cobro {
  background: var(--secondary);
  color: var(--foreground);
}

.badge-cobrada {
  background: var(--success);
  color: var(--success-foreground);
}

.acciones-doc form {
  margin: 0;
}

.gasto-foto-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.5rem 0;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
}

.gasto-foto {
  display: block;
  max-height: 8rem;
  border: 2px solid var(--foreground);
  object-fit: contain;
  background: var(--card);
}

.gasto-foto-link:hover .gasto-foto,
.gasto-foto-link:focus-visible .gasto-foto {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.gasto-foto-hint {
  font-size: 0.65rem;
  color: var(--muted-foreground);
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 4rem 1rem 1rem;
}

.lightbox.open {
  display: flex;
}

.lightbox.is-real {
  display: block;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.lightbox-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 81;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
}

.lightbox-bar .btn {
  background: var(--background);
  min-height: 2.5rem;
  height: 2.5rem;
  width: auto;
  padding: 0 0.85rem;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  background: #fff;
}

.lightbox.is-real .lightbox-img {
  max-width: none;
  max-height: none;
  margin-top: 4rem;
  cursor: zoom-out;
}

.gasto-edit-row td {
  background: var(--card);
}

.acciones-doc .btn {
  min-height: 0;
  height: auto;
  line-height: 1.2;
  padding: 0.2rem 0.5rem;
  width: auto;
  font-size: 0.6rem;
}

.table td:last-child {
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.table .acciones-doc {
  padding: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.25rem;
}

.table .acciones-doc .btn {
  min-height: 0;
  height: auto;
  padding: 0.125rem 0.45rem;
}

.actions-2 .acciones-doc {
  grid-column: 1 / -1;
  padding: 0;
}

.actions-2 .acciones-doc .btn {
  min-height: 3.5rem;
  height: auto;
  flex: 1;
  font-size: inherit;
}

.flash {
  margin: 0.75rem 1.25rem 0;
  padding: 0.75rem;
  border: 2px solid var(--foreground);
  font-size: 0.875rem;
  font-weight: 600;
}

.flash-error {
  color: var(--destructive);
}

.flash-ok {
  color: var(--success);
}

.muted {
  color: var(--muted-foreground);
}

.lead {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted-foreground);
  max-width: 36rem;
}

.auth {
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
  max-width: 520px;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--background);
  padding: 2.5rem 1.25rem;
}

.auth img {
  margin: 0 auto;
  height: 3.5rem;
  width: auto;
  object-fit: contain;
}

.auth h1 {
  margin-top: 2rem;
  font-size: 2.4rem;
}

.auth .lead {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.field {
  display: block;
}

.field + .field {
  margin-top: 1.25rem;
}

.iva-field {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.iva-field legend {
  padding: 0;
}

.iva-opciones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.iva-opcion {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-height: 2.45rem;
  padding: 0.28rem 0.15rem;
  border: 2px solid var(--foreground);
  background: var(--background);
  cursor: pointer;
  text-align: center;
}

.iva-opcion input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.iva-opcion .pct {
  font-weight: 900;
  font-size: 0.88rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.iva-opcion .nom {
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.iva-opcion:has(input:checked) {
  background: var(--foreground);
  color: var(--background);
}

.iva-opcion:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  margin-top: 0.5rem;
  border: 2px solid var(--foreground);
  background: var(--card);
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 0;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.textarea {
  min-height: 8rem;
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.totals {
  background: var(--ink);
  color: var(--ink-foreground);
  padding: 1.5rem 1.25rem;
}

.totals .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--ink-foreground) 60%, transparent);
}

.totals .row + .row {
  margin-top: 0.5rem;
}

.totals .total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--ink-foreground) 20%, transparent);
}

.totals .total .num {
  font-size: 1.875rem;
  color: var(--primary-foreground);
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--foreground);
}

.photo {
  position: relative;
  aspect-ratio: 1;
  background: var(--secondary);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo .x {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: var(--background);
  padding: 0 0.375rem;
  font-size: 0.75rem;
}

.firma-canvas {
  width: 100%;
  height: 9rem;
  touch-action: none;
  border: 2px dashed var(--foreground);
  background: #fff;
}

.table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--foreground);
  text-align: left;
  table-layout: auto;
}

.table thead {
  background: var(--ink);
  color: var(--ink-foreground);
}

.table th {
  padding: 0.5rem 0.75rem;
  font-weight: 400;
}

.table td {
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  font-size: 0.875rem;
  border-top: 2px solid var(--foreground);
  background: var(--card);
}

.table tbody tr:hover td {
  background: var(--secondary);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  border: 1px solid var(--foreground);
  padding: 0.25rem 0.625rem;
  font-size: 0.65rem;
  background: var(--background);
}

.chip.active {
  background: var(--foreground);
  color: var(--background);
}

.suggest {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 2px solid var(--foreground);
}

.suggest button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  text-align: left;
  border-top: 2px solid var(--foreground);
}

.suggest li:first-child button {
  border-top: 0;
}

.cli-extra {
  border: 1px solid var(--border);
  background: var(--card);
}

.cli-extra summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

.cli-extra summary::-webkit-details-marker {
  display: none;
}

.cli-extra summary::after {
  content: "+";
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1;
}

.cli-extra[open] summary::after {
  content: "–";
}

.cli-extra-note {
  margin: 0 1rem 0.85rem;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.cli-extra .space-y {
  padding: 0 1rem 1rem;
}

.lineas-head,
.linea-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.5rem 4.5rem 5rem;
  gap: 0.5rem;
  align-items: center;
}

.lineas-head {
  border-bottom: 2px solid var(--foreground);
  padding: 0.375rem 0;
  color: var(--muted-foreground);
}

.linea-view {
  border-bottom: 1px solid var(--foreground);
  padding: 0.375rem 0;
}

.linea-view p {
  margin: 0;
  font-size: 0.875rem;
}

.right {
  text-align: right;
}

.sumas {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.sumas .row {
  display: flex;
  justify-content: space-between;
}

.sumas .row.total {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 2px solid var(--foreground);
  font-weight: 600;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 1.25rem;
}

.modal.open {
  display: flex;
}

.modal-box {
  width: 100%;
  max-width: 28rem;
  border: 2px solid var(--foreground);
  background: var(--background);
  padding: 1.25rem;
}

.grid-btns {
  display: grid;
  gap: 0.75rem;
}

.notas-box {
  border: 2px dashed var(--foreground);
  padding: 0.75rem;
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
}

.empty {
  border-top: 2px solid var(--foreground);
  border-bottom: 2px solid var(--foreground);
  padding: 1.5rem 0;
  color: var(--muted-foreground);
}

.hidden {
  display: none !important;
}

.space-y > * + * {
  margin-top: 1.25rem;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.error {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--destructive);
}

.ok {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success);
}

@media (min-width: 960px) {
  .campo-only,
  .topbar,
  .bottom-nav,
  .bottom-nav-wrap {
    display: none !important;
  }

  .office-only {
    display: revert;
  }

  .shell {
    display: flex;
    max-width: none;
    border: 0;
    padding-bottom: 0;
  }

  .office-aside {
    display: flex;
  }

  .office-head {
    display: flex;
  }

  .main {
    flex: 1;
  }

  .body {
    margin: 0 auto;
    max-width: 56rem;
    padding: 1rem 1.25rem;
  }

  .body.wide {
    max-width: none;
    width: 100%;
  }

  .section {
    border-bottom: 1px solid var(--foreground);
    padding: 0 0 0.75rem;
    margin-bottom: 1rem;
  }

  .section-pad {
    padding: 0;
  }

  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-top: 0.75rem;
  }

  .dash-hero,
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .informe-page .section.informe-bar {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .body.wide:has(.informe-page) {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }

  .informe-filtros {
    flex-wrap: wrap;
    max-width: none;
  }

  .informe-filtros .field {
    flex: 0 1 11rem;
  }

  .res-hero,
  .res-split {
    grid-template-columns: 1fr 1fr;
  }

  .dash-hero.res-hero {
    grid-template-columns: repeat(3, 1fr);
  }

  .informe-res .res-split {
    grid-template-columns: 1fr 1fr;
  }

  .informe-res .dash-amount {
    font-size: 1.65rem;
  }

  .dash-amount {
    font-size: 2.35rem;
  }

  .kpi {
    padding: 0.625rem 0.75rem;
  }

  .kpi .num {
    font-size: 1.25rem;
  }

  .actions-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .btn,
  .btn-sm {
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 1rem;
    font-size: 0.65rem;
  }

  .acciones-doc .btn,
  .table .acciones-doc .btn {
    min-height: 0;
    height: auto;
    padding: 0.125rem 0.45rem;
    font-size: 0.6rem;
  }

  .photos {
    grid-template-columns: repeat(4, 1fr);
  }

  .photo {
    aspect-ratio: 4 / 3;
  }

  .modal {
    align-items: center;
  }

  .office-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
  }

  .doc-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }

  .doc-hero .amt {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: none;
    letter-spacing: 0;
    font-stretch: normal;
  }
}

.btn-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: #fff;
  color: #1c1c1c;
  border: 2px solid var(--foreground);
}

.btn-google:hover {
  background: var(--card);
}

.trial-chip {
  display: inline-block;
  border: 1px solid currentColor;
  padding: 0.2rem 0.45rem;
  color: inherit;
  white-space: nowrap;
}

.office-foot .trial-chip,
.office-foot p {
  color: color-mix(in srgb, var(--ink-foreground) 80%, transparent);
}

.plan-grid {
  display: grid;
  gap: 1rem;
}

.plan-card {
  border: 2px solid var(--foreground);
  background: var(--card);
  padding: 1.25rem 1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plan-card.is-current {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.plan-price {
  margin: 0;
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.plan-price span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.plan-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.9rem;
  flex: 1;
}

.plan-list li + li {
  margin-top: 0.35rem;
}

.admin-user {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}

.rastreo-visita {
  padding: 0.9rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.rastreo-hasta {
  margin: 0.35rem 0 0;
  font-weight: 800;
}

.rastreo-pasos {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.rastreo-pasos li {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  padding: 0.22rem 0;
}

.rastreo-pasos time {
  flex: none;
  width: 6.2rem;
}

.admin-user .admin-plan {
  margin-top: 0.75rem;
}

.admin-table {
  table-layout: fixed;
  width: 100%;
}

.admin-table th,
.admin-table td {
  padding: 0.45rem 0.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1) {
  width: 32%;
}

.admin-table th:nth-child(2),
.admin-table td:nth-child(2) {
  width: 34%;
}

.admin-table th:nth-child(3),
.admin-table td:nth-child(3) {
  width: 16%;
}

.admin-table th:nth-child(4),
.admin-table td:nth-child(4) {
  width: 18%;
}

.admin-meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.admin-uso {
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
}

.admin-plan {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.admin-plan .select {
  min-width: 0;
  flex: 1 1 8rem;
  max-width: 100%;
  font-size: 0.75rem;
  padding: 0.3rem 0.4rem;
}

.admin-plan .btn {
  flex: 0 0 auto;
}

@media (min-width: 900px) {
  .plan-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.top-icon,
.help-top-icon {
  display: flex;
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--foreground);
  background: var(--primary);
  color: var(--primary-foreground);
}

.top-icon.is-active,
.help-top-icon.is-active {
  background: var(--ink);
  color: var(--ink-foreground);
}

.help-fab {
  position: fixed;
  z-index: 45;
  right: 1.1rem;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  width: 3.5rem;
  height: 3.5rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--foreground);
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 4px 4px 0 var(--foreground);
}

@media (min-width: 521px) {
  .help-fab {
    right: max(1.1rem, calc(50% - 260px + 1.1rem));
  }
}

.help-actions {
  display: grid;
  gap: 1rem;
}

.help-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5.4rem;
  padding: 1rem 1.15rem;
  border: 2px solid var(--foreground);
  background: var(--card);
}

.help-card strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.help-card-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.help-icon {
  display: flex;
  flex-shrink: 0;
  width: 3.35rem;
  height: 3.35rem;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--foreground);
}

.help-card-wa .help-icon {
  background: #25d366;
  color: #fff;
}

.help-card-tel .help-icon {
  background: var(--primary);
  color: var(--primary-foreground);
}

@media (min-width: 960px) {
  .help-fab {
    display: none !important;
  }

  .help-actions {
    grid-template-columns: 1fr 1fr;
    max-width: 40rem;
  }
}

.guia {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  justify-self: start;
  width: fit-content;
  max-width: min(16.5rem, 100%);
  margin: 0 0 0.85rem;
  padding: 0.7rem 1.35rem 0.7rem 0.85rem;
  border-radius: 1.15rem;
  background: #e10600;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 10px 22px rgba(225, 6, 0, 0.35);
  animation: guia-bote 1.5s ease-in-out infinite;
}

.guia p {
  margin: 0;
}

.guia strong {
  font-weight: 800;
}

.guia-x {
  position: absolute;
  top: -0.45rem;
  right: -0.4rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #fff;
  color: #e10600;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.guia::after {
  content: "";
  position: absolute;
  left: 1.15rem;
  bottom: -8px;
  border-width: 8px 7px 0;
  border-style: solid;
  border-color: #e10600 transparent transparent;
}

@keyframes guia-bote {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .guia { animation: none; }
}

.ficha-share-label {
  margin: 0 0 0.55rem;
  color: var(--muted-foreground);
  letter-spacing: 0.12em;
}

.ficha-share {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.ficha-share form {
  margin: 0;
  min-width: 0;
}

.ficha-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  width: 100%;
  min-height: 3.35rem;
  padding: 0.45rem 0.3rem;
  border: 2px solid var(--foreground);
  background: var(--card);
  color: var(--foreground);
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ficha-share-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.ficha-share-btn.is-wa svg { color: #25d366; }
.ficha-share-btn.is-pdf svg { color: var(--primary); }
.ficha-share-btn.is-mail svg { color: var(--foreground); }

.ficha-card {
  margin-top: 1rem;
  padding: 1.05rem 1rem 1rem;
  background: var(--card);
  border: 2px solid var(--foreground);
  box-shadow: 6px 6px 0 var(--foreground);
}

.ficha-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--primary);
}

.ficha-title {
  margin: 0.6rem 0 0;
  font-weight: 900;
  font-stretch: 75%;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 0.9;
  font-size: clamp(1.7rem, 7.2vw, 2.45rem);
}

.ficha-meta,
.ficha-desc {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.ficha-meta { color: var(--muted-foreground); }

.ficha-nota {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ficha-nota.is-info { color: var(--primary); }
.ficha-nota.is-bad { color: var(--destructive); }
.ficha-nota.is-ok { color: var(--success); }

.ficha-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--foreground);
}

.ficha-eur {
  margin: 0;
  color: var(--primary);
  font-weight: 900;
  font-stretch: 75%;
  letter-spacing: -0.045em;
  line-height: 0.85;
  font-size: clamp(2.1rem, 10vw, 2.9rem);
}

.ficha-iva {
  margin: 0 0 0.2rem;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ficha-cliente {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ficha-acciones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.ficha-acciones > form,
.ficha-acciones > .acciones-doc {
  display: contents;
}

.ficha-acciones .btn {
  width: 100%;
  min-height: 2.75rem;
  height: auto;
  border-radius: 0;
  font-size: 0.72rem;
  font-weight: 800;
}

.ficha-acciones .btn-success {
  background: var(--success);
  color: var(--success-foreground);
  border: 2px solid var(--foreground);
}

.ficha-borrar {
  margin: 0.35rem 0 0;
  text-align: center;
}

.ficha-borrar button {
  min-height: 2.4rem;
  color: var(--destructive);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
