@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --blue: #242c4f;
  --sky: #53afc0;
  --white: #ffffff;
  --sand: #f4f0e8;
  --navy-90: #1b223d;
  --navy-40: #3a446b;
  --mint: #d7f0f4;
  --rose: #f9d3c8;
  --sun: #f6d98d;
  --shadow: 0 20px 45px rgba(20, 28, 52, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Trebuchet MS', sans-serif;
  background: var(--sand);
  color: var(--navy-90);
}

.page {
  min-height: 100vh;
  position: relative;
  padding: 28px 28px 60px;
}

.page.modal-open {
  overflow: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(83, 175, 192, 0.35), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(36, 44, 79, 0.15), transparent 40%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.9) 0%, rgba(244, 240, 232, 0.6) 70%);
  z-index: -1;
}

.topbar {
  display: grid;
  gap: 18px;
  padding: 12px 6px 22px;
  margin-bottom: 10px;
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
}

.topbar__meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 0 6px rgba(83, 175, 192, 0.25);
}

.brand__title {
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.brand__subtitle {
  font-size: 12px;
  color: var(--navy-40);
}

.topbar__actions {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-left: 12px;
}

.ghost-link {
  color: var(--navy-40);
  text-decoration: none;
}

.primary-link {
  color: var(--white);
  background: var(--blue);
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}

.content {
  max-width: 1180px;
  margin: 0 auto;
}

.hero {
  background: var(--white);
  border-radius: 24px;
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease-out;
}

.hero h1 {
  margin: 10px 0 8px;
  font-size: 32px;
}

.hero p {
  margin: 0;
  color: var(--navy-40);
}

.hero__stats {
  display: flex;
  gap: 16px;
}

.hero__stats--compact {
  margin-left: auto;
  flex-wrap: nowrap;
}

.stat {
  background: var(--mint);
  border-radius: 16px;
  padding: 14px 18px;
  min-width: 120px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.stat {
  border: none;
  font: inherit;
  cursor: pointer;
}

button.stat:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.stat--filter:hover {
  transform: translateY(-1px);
}

.stat--filter.is-active {
  box-shadow: 0 0 0 2px currentColor;
}

.stat--danger {
  background: var(--rose);
  color: #731c22;
}

.stat--critical {
  background: #f8d7da;
  color: #7c1d1d;
}

.stat--warning {
  background: var(--sun);
  color: #7a5c10;
}

.hero__stats--compact .stat {
  padding: 8px 12px;
  min-width: 96px;
}
.stat span {
  display: block;
  font-size: 12px;
  color: var(--navy-40);
}

.stat__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.stat__label svg {
  width: 14px;
  height: 14px;
}

.stat__label svg path {
  fill: currentColor;
  stroke: currentColor;
}

.stat--danger .stat__label,
.stat--danger strong {
  color: #731c22;
}

.stat--critical .stat__label,
.stat--critical strong {
  color: #7c1d1d;
}

.stat--warning .stat__label,
.stat--warning strong {
  color: #7a5c10;
}

.stat strong {
  font-size: 20px;
  color: var(--blue);
}

.pill {
  background: rgba(83, 175, 192, 0.2);
  color: var(--blue);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tabs {
  margin-top: 28px;
}

.tabs__controls {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.tabs__controls--topbar {
  margin-left: auto;
}

.tabs__controls--topbar .tab {
  padding: 8px 14px;
  white-space: nowrap;
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-40);
}

.tab.is-active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.tabs__panel {
  display: none;
  margin-top: 22px;
  background: var(--white);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.tabs__panel.is-active {
  display: block;
  animation: fade 0.4s ease-in;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.panel__header h2 {
  margin: 0 0 6px;
}

.panel__header p {
  margin: 0;
  color: var(--navy-40);
}

.panel__hint {
  color: var(--navy-40);
  font-size: 13px;
}

.panel__actions {
  margin-bottom: 16px;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.table-tools--mono {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.table-tools--mono .selector--inline {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.table-tools--mono .field--inline {
  min-width: 0;
}

.table-tools--mono .field--inline input,
.table-tools--mono .field--inline select {
  width: 100%;
}

.table-tools--mono .selector--inline .outline {
  white-space: nowrap;
}

.pagination {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.pagination__info {
  font-size: 12px;
  color: var(--navy-40);
}

.pagination--top {
  margin-left: auto;
}

.pagination--bottom {
  justify-content: flex-end;
  margin-top: 14px;
}

.panel__form {
  background: #f7f8fb;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.form-grid--stack {
  grid-template-columns: 1fr;
}

.form-actions {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.panel__form--rpa {
  gap: 16px;
}

.form-section {
  display: grid;
  gap: 10px;
}

.form-section__title {
  font-weight: 600;
  color: var(--navy-40);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.rpa-collapse {
  border: 1px solid #dfe6f2;
  border-radius: 12px;
  background: #f9fbff;
  overflow: hidden;
}

.rpa-collapse summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-90);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rpa-collapse summary::-webkit-details-marker {
  display: none;
}

.rpa-collapse summary::after {
  content: "▾";
  font-size: 14px;
  color: var(--navy-40);
  transition: transform 0.2s ease;
}

.rpa-collapse[open] summary::after {
  transform: rotate(180deg);
}

.rpa-collapse__body {
  padding: 12px 16px 16px;
  display: grid;
  gap: 12px;
}

[data-rpa-section="categorias"] .checklist__item,
[data-rpa-section="tipos"] .checklist__item {
  border: 1px solid #d8dce6;
  border-radius: 10px;
  padding: 8px 12px;
  width: 100%;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
}

[data-rpa-section="categorias"] .checklist__item:hover,
[data-rpa-section="tipos"] .checklist__item:hover {
  border-color: #b9c6dd;
  background: #f3f6fb;
}

[data-rpa-section="categorias"] .checklist__item input[type="checkbox"],
[data-rpa-section="tipos"] .checklist__item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.choice-group {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--navy-40);
  border: 1px solid #d8dce6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.choice:hover {
  border-color: #b9c6dd;
  background: #f3f6fb;
}

.choice input[type="radio"] {
  width: 18px;
  height: 18px;
}

.checklist {
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid #d8dce6;
  border-radius: 12px;
  padding: 10px;
}

.checklist--scroll {
  max-height: 180px;
  overflow: auto;
}

.checklist--grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checklist--rpa-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checklist__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--navy-40);
}

.field__search {
  border: 1px solid #d8dce6;
  border-radius: 12px;
  padding: 8px 12px;
  font-family: inherit;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--navy-40);
}

.form-hint {
  margin: 0;
  font-size: 11px;
  color: var(--navy-40);
}

.field--inline {
  min-width: 200px;
}

.field input,
.field select {
  border: 1px solid #d8dce6;
  border-radius: 12px;
  padding: 8px 12px;
  font-family: inherit;
}

.field input[type="file"] {
  padding: 6px 0;
  border: none;
}

.field--file {
  position: relative;
}

.field--file .file-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--navy-40);
  background: #fff;
  border: 1px solid #d8dce6;
  border-radius: 10px;
  padding: 4px 10px;
  max-height: 120px;
  overflow: auto;
}

.file-list {
  display: grid;
  gap: 6px;
}

.file-empty {
  font-size: 12px;
  color: var(--navy-40);
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.file-item__name {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
  color: var(--navy-40);
}

.file-item__remove {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #d8dce6;
  background: #fff;
  color: var(--navy-40);
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}

.file-item__remove:hover {
  background: #f4f6fb;
}

.file-clear {
  border: none;
  background: transparent;
  color: var(--navy-40);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.file-clear.is-hidden {
  display: none;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid #d8dce6;
  background: #ffffff;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

.file-button:hover {
  background: #f4f6fb;
}

.field--file:focus-within .file-button {
  outline: 2px solid rgba(83, 175, 192, 0.35);
  outline-offset: 2px;
}

.table {
  display: grid;
  gap: 10px;
}

.table__row {
  display: grid;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f6f7fb;
  align-items: center;
  animation: fade 0.5s ease-in;
}

.table__row.is-clickable {
  cursor: pointer;
}

.table__row.is-clickable:hover {
  background: #eef1f8;
}

.table__row--mono {
  grid-template-columns: 2.6fr 1.4fr 1.4fr 0.7fr 0.8fr 0.6fr;
}

.table__row--facturas {
  grid-template-columns: 0.9fr 0.85fr 0.35fr 1.2fr 1.1fr 1.4fr 1.1fr 0.9fr 0.9fr 1.4fr 0.7fr;
  font-size: 12px;
}

.table__row--config {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.table__row--imports {
  grid-template-columns: 1.2fr 1.4fr 0.7fr 0.8fr 2fr;
}

#configuracion input[type="date"][data-air-datepicker="true"],
input[type="date"][data-air-picker="true"] {
  appearance: none;
  -webkit-appearance: none;
}

#configuracion input[type="date"][data-air-datepicker="true"]::-webkit-calendar-picker-indicator,
input[type="date"][data-air-picker="true"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  display: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
}

.status--done {
  background: #dff5e5;
  color: #276749;
}

.status--failed {
  background: #ffe5e5;
  color: #9b2c2c;
}

.status--processing {
  background: #e6f7f9;
  color: var(--blue);
}

.status--pending {
  background: #fff5d6;
  color: #7a5b00;
}

.table__row--topes {
  grid-template-columns: 0.6fr 1.4fr;
  align-items: center;
}

.table__row--topes input {
  width: 100%;
  border: 1px solid #d8dce6;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
}

.table__head {
  background: transparent;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--navy-40);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.badge--sube {
  background: var(--rose);
  color: #9b2c2c;
}

.badge--exclusion {
  background: #f8d7da;
  color: #7c1d1d;
}

.badge--mantiene {
  background: #d6f5d6;
  color: #2f6b2f;
}

.badge--baja {
  background: var(--sun);
  color: #7a5c10;
}

.secret-cell {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.secret {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  min-width: 96px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d8dce6;
  background: var(--white);
  color: var(--navy-40);
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  font-size: 12px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.row-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid #d8dce6;
  background: var(--white);
  color: var(--navy-40);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.icon-link svg {
  width: 16px;
  height: 16px;
}

.icon-link--danger {
  color: #9b2c2c;
  border-color: #f2c1c1;
  background: #fff5f5;
}

.icon-link.is-confirm {
  color: #7a5c10;
  border-color: #f6d98d;
  background: #fff4d1;
}
.link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.link--danger {
  color: #9b2c2c;
}

.outline {
  border: 1px solid var(--blue);
  background: transparent;
  color: var(--blue);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.selector select {
  border-radius: 999px;
  padding: 12px 18px;
  border: 1px solid #d6d6e4;
  font-family: inherit;
  font-size: 15px;
  min-width: 220px;
}

.primary {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  justify-self: start;
}

.calculo__layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.calculo__main {
  display: grid;
  gap: 16px;
}

.calculo__margins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  background: #f8fafb;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card span {
  font-size: 12px;
  color: var(--navy-40);
}

.metric-card strong {
  font-size: 20px;
  color: var(--blue);
}

.calculo__side {
  display: grid;
  gap: 16px;
}

.calculo__summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.calculo__summary .summary-card {
  background: var(--mint);
  padding: 16px;
  border-radius: 16px;
}

.calculo__summary .summary-card--sube {
  background: var(--rose);
}

.calculo__summary .summary-card--exclusion {
  background: #f8d7da;
}

.calculo__summary .summary-card--baja {
  background: var(--sun);
}

.calculo__summary .summary-card--mantiene {
  background: #d6f5d6;
}

.calculo__summary span {
  display: block;
  color: var(--navy-40);
  font-size: 12px;
}

.calculo__summary strong {
  font-size: 20px;
  color: var(--blue);
}

.summary-card__value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.summary-card__tope {
  display: inline-flex;
  font-size: 12px;
  color: var(--navy-40);
}

.calculo__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.month-card {
  background: #f8fafb;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: rise 0.6s ease-out;
}

.month-card span {
  font-size: 12px;
  color: var(--navy-40);
  letter-spacing: 0.6px;
}

.empty {
  padding: 40px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(83, 175, 192, 0.1), transparent 60%);
}

.calculo__period {
  display: grid;
  gap: 10px;
  background: #f7f8fb;
  padding: 14px;
  border-radius: 16px;
}

.calculo__period #anchorMonthDisplay {
  cursor: pointer;
}

.air-datepicker {
  z-index: 30;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.flash {
  padding: 12px 16px;
  border-radius: 12px;
  background: #e6f7f9;
  color: var(--blue);
  font-size: 14px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.flash.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
}

.flash--error {
  background: #ffe5e5;
  color: #9b2c2c;
}

.flash--success {
  background: #dff5e5;
  color: #276749;
}

.login {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: center;
}

.login__card {
  background: var(--white);
  padding: 32px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease-out;
}

.login__header h1 {
  margin: 10px 0 6px;
  font-size: 28px;
}

.login__header p {
  margin: 0;
  color: var(--navy-40);
}

.login__form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.login__form label {
  font-size: 13px;
  color: var(--navy-40);
  display: grid;
  gap: 8px;
}

.login__form input {
  border: 1px solid #e0e0ea;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
}

.login__form button {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.alert {
  background: #ffe5e5;
  color: #9b2c2c;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.login__hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--navy-40);
}

.login__aside {
  display: flex;
  justify-content: center;
}

.pulse-card {
  background: var(--blue);
  color: var(--white);
  padding: 28px;
  border-radius: 24px;
  max-width: 320px;
  box-shadow: var(--shadow);
}

.pulse-bars {
  margin-top: 22px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 90px;
}

.pulse-bars span {
  width: 26px;
  border-radius: 12px 12px 4px 4px;
  background: var(--sky);
  height: var(--h);
  animation: pulse 2s ease-in-out infinite;
}

.pulse-bars span:nth-child(2) {
  animation-delay: 0.2s;
}

.pulse-bars span:nth-child(3) {
  animation-delay: 0.4s;
}

.pulse-bars span:nth-child(4) {
  animation-delay: 0.6s;
}

.form-page {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.form-card {
  background: var(--white);
  padding: 32px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  max-width: 760px;
  width: 100%;
}

.form-card h1 {
  margin-top: 0;
}

.form-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 28, 52, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
  padding: 20px;
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal__content {
  background: var(--white);
  border-radius: 20px;
  padding: 24px;
  width: min(760px, 100%);
  box-shadow: var(--shadow);
  animation: rise 0.4s ease-out;
  max-height: calc(100vh - 80px);
  overflow: auto;
}

.modal--wide .modal__content {
  width: min(980px, 100%);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal__header h3 {
  margin: 0;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.detail-item {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--navy-40);
}

.detail-item strong {
  font-size: 14px;
  color: var(--navy-90);
  font-weight: 600;
}

.detail-item--empty {
  visibility: hidden;
}

.ghost-button {
  border: 1px solid #d8dce6;
  background: transparent;
  color: var(--navy-40);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--navy-40);
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scaleY(0.9);
    opacity: 0.9;
  }
  50% {
    transform: scaleY(1.08);
    opacity: 1;
  }
}

/* Help Section */
.help-content {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.help-nav {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f7f8fb;
  padding: 16px;
  border-radius: 16px;
}

.help-nav__link {
  color: var(--navy-40);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}

.help-nav__link:hover {
  background: var(--mint);
  color: var(--blue);
}

.help-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.help-section {
  scroll-margin-top: 20px;
}

.help-section h3 {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mint);
}

.help-section h4 {
  margin: 18px 0 10px;
  color: var(--navy-90);
  font-size: 15px;
}

.help-section p {
  margin: 0 0 12px;
  line-height: 1.6;
  color: var(--navy-90);
}

.help-section ul,
.help-section ol {
  margin: 0 0 14px;
  padding-left: 24px;
  line-height: 1.7;
}

.help-section li {
  margin-bottom: 6px;
}

.help-highlight {
  background: var(--mint);
  padding: 14px 18px;
  border-radius: 12px;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.5;
}

.help-highlight strong {
  color: var(--blue);
}

.help-example {
  background: #f7f8fb;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 14px 0;
  border-left: 4px solid var(--sky);
}

.help-example p {
  margin: 0 0 8px;
  font-size: 14px;
}

.help-example ul {
  margin: 8px 0 0;
  font-size: 14px;
}

.help-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.help-card {
  background: #f7f8fb;
  padding: 18px;
  border-radius: 14px;
}

.help-card h4 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 15px;
}

.help-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.help-estados {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.help-estado {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #f7f8fb;
}

.help-estado .badge {
  flex-shrink: 0;
  min-width: 90px;
  text-align: center;
}

.help-estado p {
  margin: 0;
  font-size: 14px;
}

.help-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #f7f8fb;
  border-radius: 12px;
  overflow: hidden;
}

.faq-item summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-90);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--blue);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  content: "-";
}

.faq-item summary:hover {
  background: #eef1f8;
}

.faq-item p {
  padding: 0 18px 16px 50px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--navy-40);
}

@media (max-width: 980px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__stats {
    width: 100%;
    justify-content: space-between;
  }

  .table__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table__row--mono,
  .table__row--facturas,
  .table__row--config,
  .table__row--topes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-content {
    grid-template-columns: 1fr;
  }

  .help-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .help-nav__link {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 18px 40px;
  }

  .topbar {
    gap: 12px;
  }

  .topbar__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topbar__actions {
    margin-left: 0;
  }

  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .calculo__summary {
    grid-template-columns: 1fr;
  }

  .calculo__layout {
    grid-template-columns: 1fr;
  }

  .calculo__margins {
    grid-template-columns: 1fr;
  }

  .help-cards {
    grid-template-columns: 1fr;
  }

  .help-estado {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .faq-item p {
    padding-left: 18px;
  }
}
