/*
 * This is a manifest file that'll be compiled into application.css.
 */

/* ─── Design System Variables ─── */
:root {
  --green: #1a6b4a;
  --green-light: #2d9b6f;
  --green-pale: #e8f5ef;
  --green-accent: #00c47a;
  --dark: #0f1f17;
  --gray: #4a5e54;
  --gray-light: #8fa89d;
  --white: #fdfffe;
  --cream: #f7faf8;
  --border: #d4e8dd;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--dark);
  overflow-x: hidden;
}

/* ─── Flash Messages ─── */
.flash {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 520px;
  width: calc(100% - 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  animation: slideDown 0.3s ease;
}
.flash-notice {
  background: var(--green);
  color: white;
}
.flash-alert {
  background: #c0392b;
  color: white;
}
.flash-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  flex-shrink: 0;
  line-height: 1;
}
.flash-close:hover { opacity: 1; }

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── Auth Pages ─── */
.auth-page {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(0,196,122,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(26,107,74,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
  margin-bottom: 1.75rem;
}

.auth-logo a {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
}

.auth-logo a span {
  color: var(--green-accent);
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 1.75rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
}

.form-field input {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,74,0.12);
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.forgot-link {
  font-size: 0.78rem;
  color: var(--green);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

.btn-submit {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: var(--green);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.35rem;
}
.btn-submit:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #c0392b;
}
.form-errors p { margin-bottom: 0.25rem; }
.form-errors p:last-child { margin-bottom: 0; }

.form-row-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-footer-link {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
  margin-top: 1.25rem;
}
.auth-footer-link a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* ─── Dashboard ─── */
.dashboard-page {
  min-height: 100svh;
  background: var(--cream);
}

.verification-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 1rem 1.5rem;
}

.verification-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.verification-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.verification-banner-inner > div {
  flex: 1;
}

.verification-banner-inner strong {
  display: block;
  font-size: 0.9rem;
  color: #92400e;
  margin-bottom: 0.2rem;
}

.verification-banner-inner p {
  font-size: 0.82rem;
  color: #b45309;
  line-height: 1.5;
}

.verification-actions {
  flex-shrink: 0;
}

.btn-resend {
  background: #f59e0b;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.btn-resend:hover { background: #d97706; }

.dashboard-header {
  background: var(--dark);
  padding: 0 1.5rem;
  position: relative;
  z-index: 200;
}

.dashboard-nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.dashboard-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.dashboard-logo span { color: var(--green-accent); }

/* ── User dropdown trigger ── */
.nav-user-menu {
  position: relative;
}

.nav-user-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.4rem 0.75rem 0.4rem 0.5rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  color: white;
}

.nav-user-trigger:hover {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.05);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-greeting {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
}

.nav-greeting strong {
  color: white;
  font-weight: 600;
}

.nav-chevron {
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
  transition: transform 0.2s;
}

/* ── Dropdown menu ── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  overflow: hidden;
  z-index: 300;
}

.nav-dropdown.is-open {
  display: block;
}

.nav-dropdown-user {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-dropdown-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
}

.nav-dropdown-email {
  font-size: 0.75rem;
  color: var(--gray-light);
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.nav-dropdown-item:hover {
  background: var(--cream);
  color: var(--green);
}

.nav-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.nav-dropdown-item:hover svg {
  opacity: 1;
}

.nav-dropdown-signout {
  color: #c0392b;
}

.nav-dropdown-signout:hover {
  background: #fdf2f2;
  color: #c0392b;
}

.dashboard-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.dashboard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.dashboard-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 0.2rem;
}

.dashboard-subtitle {
  font-size: 0.9rem;
  color: var(--gray);
}

/* ── Stats ── */
.dashboard-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
}

.stat-value--green { color: var(--green); }
.stat-value--muted { color: var(--gray-light); }

.stat-label {
  font-size: 0.78rem;
  color: var(--gray);
  font-weight: 500;
}

/* ── Receipts section ── */
.receipts-section {
  margin-bottom: 2rem;
}

.receipts-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.receipts-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}

.receipts-section-link {
  font-size: 0.82rem;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
}
.receipts-section-link:hover { text-decoration: underline; }

.empty-state {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state.locked {
  opacity: 0.6;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.btn-new-receipt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green-accent);
  color: var(--dark);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-new-receipt:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,196,122,0.3);
}

/* ─── Templates Page ─── */
.templates-page {
  min-height: 100vh;
  background: var(--cream);
}

.templates-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.templates-header {
  margin-bottom: 2.5rem;
}

.templates-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.templates-subtitle {
  font-size: 1rem;
  color: var(--gray);
}

/* ─── Templates Grid ─── */
.templates-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ─── Template Card ─── */
.template-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
}

.template-card:not(.locked):hover {
  box-shadow: 0 8px 28px rgba(26,107,74,0.13);
  transform: translateY(-3px);
  border-color: var(--green-accent);
}

.template-card.locked {
  cursor: default;
}

.template-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 280 / 380;
  background: #f0f4f2;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-thumbnail svg {
  display: block;
  width: 100%;
  height: 100%;
}

.template-info {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.template-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
}

.template-desc {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.btn-use-template {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--green-accent);
  color: var(--dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem;
  border-radius: 7px;
  text-decoration: none;
  align-self: flex-start;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-use-template:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0,196,122,0.3);
}

/* ─── Locked State ─── */
.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,31,23,0.55);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.plan-badge {
  background: var(--green-accent);
  color: var(--dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.btn-unlock {
  background: var(--white);
  color: var(--dark);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-unlock:hover {
  background: var(--cream);
}

/* ─── Upgrade Modal ─── */
.upgrade-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  align-items: center;
  justify-content: center;
}

.upgrade-modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,31,23,0.6);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem 2rem 2rem;
  width: 100%;
  max-width: 440px;
  margin: 1rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--gray-light);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: var(--dark);
  background: var(--cream);
}

.modal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.modal-plans {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.modal-plan {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  position: relative;
}

.modal-plan.featured {
  border-color: var(--green-accent);
  background: var(--green-pale);
}

.plan-badge-inline {
  position: absolute;
  top: -0.6rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-accent);
  color: var(--dark);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.plan-name {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 0.6rem;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
  color: var(--gray);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green-accent);
  color: var(--dark);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,196,122,0.3);
}

/* ════════════════════════════════════════
   Receipt Builder
   ════════════════════════════════════════ */

.receipt-builder {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

/* ── Builder body: form + preview side by side ── */
.builder-body {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 0;
}

/* ── LEFT: Form panel ── */
.builder-form-panel {
  width: 380px;
  flex-shrink: 0;
  min-height: calc(100vh - 60px);
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.builder-form-inner {
  padding: 1.75rem 1.5rem 3rem;
}

.builder-form-header {
  margin-bottom: 1.75rem;
}

.builder-back {
  font-size: 0.8rem;
  color: var(--gray);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  transition: color 0.15s;
}
.builder-back:hover { color: var(--green); }

.builder-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.2rem;
}

.builder-subtitle {
  font-size: 0.82rem;
  color: var(--gray);
}

/* ── Form sections ── */
.form-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dark);
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,74,0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238fa89d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* $-prefix input */
.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 0.8rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray);
  pointer-events: none;
  z-index: 1;
}

.form-input-prefixed {
  padding-left: 1.6rem;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--gray-light);
  margin-top: 0.2rem;
}

input[readonly].form-input {
  background: var(--cream);
  color: var(--gray);
  cursor: default;
}

/* ── Builder actions ── */
.builder-actions {
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-builder-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s, background 0.15s;
}

.btn-builder-action--primary {
  background: var(--green-accent);
  color: var(--dark);
}

.btn-builder-action--primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,196,122,0.35);
}

.btn-builder-action--secondary {
  background: white;
  color: var(--dark);
  border: 1.5px solid var(--border);
}

.btn-builder-action--secondary:not(:disabled):hover {
  background: var(--green-pale);
  border-color: var(--green);
}

.btn-builder-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.builder-required-hint {
  font-size: 0.74rem;
  color: var(--gray-light);
  text-align: center;
}

/* ── RIGHT: Preview panel ── */
.builder-preview-panel {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 2rem 3rem;
  min-height: calc(100vh - 60px);
  overflow-y: auto;
}

.builder-preview-inner {
  width: 100%;
  max-width: 480px;
}

.preview-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* ════════════════════════════════════════
   Receipt Preview — Clásico Template
   ════════════════════════════════════════ */

.receipt-preview {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
  font-family: 'DM Sans', sans-serif;
}

/* ── Header ── */
.rp-header {
  background: var(--green);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rp-logo {
  flex-shrink: 0;
}

.rp-logo-generic svg,
.rp-logo-custom {
  display: block;
}

.rp-company {
  flex: 1;
}

.rp-company-name {
  font-weight: 700;
  font-size: 1rem;
  color: white;
  line-height: 1.3;
}

.rp-company-number {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.15rem;
}

/* ── Title bar ── */
.rp-title-bar {
  padding: 1rem 1.5rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.rp-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
}

.rp-num {
  font-size: 0.78rem;
  color: var(--gray-light);
  margin-top: 0.15rem;
}

.rp-date {
  font-size: 0.78rem;
  color: var(--gray);
  text-align: right;
  flex-shrink: 0;
  max-width: 140px;
}

/* ── Dashed divider ── */
.rp-dashed {
  margin: 0 1.5rem;
  border-top: 1.5px dashed var(--border);
}

/* ── Rows ── */
.rp-rows {
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.83rem;
}

.rp-label {
  color: var(--gray);
  flex-shrink: 0;
  min-width: 100px;
}

.rp-value {
  font-weight: 500;
  color: var(--dark);
  text-align: right;
  word-break: break-word;
}

.rp-value-concept {
  text-align: right;
  max-width: 220px;
}

/* ── Amount box ── */
.rp-amount-box {
  margin: 0.5rem 1.5rem 0;
  background: var(--green-pale);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rp-amount-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.06em;
}

.rp-amount-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
}

/* ── Total in words ── */
.rp-words {
  padding: 0.5rem 1.5rem 0.85rem;
  font-size: 0.75rem;
  color: var(--gray);
  font-style: italic;
}

/* ── Signatures ── */
.rp-signatures {
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 2rem;
}

.rp-sig {
  flex: 1;
}

.rp-sig-line {
  height: 1px;
  background: var(--dark);
  margin-bottom: 0.4rem;
}

.rp-sig-label {
  font-size: 0.72rem;
  color: var(--gray-light);
  text-align: center;
}

/* ── Footer / watermark ── */
.rp-footer {
  border-top: 1.5px dashed var(--border);
  padding: 0.65rem 1.5rem;
  text-align: center;
}

.rp-footer-text {
  font-size: 0.68rem;
  color: var(--gray-light);
}

.rp-watermark {
  font-size: 0.65rem;
  color: var(--gray-light);
  opacity: 0.8;
}

/* ── Responsive: stack on small screens ── */
@media (max-width: 800px) {
  .builder-body {
    flex-direction: column;
  }

  .builder-form-panel {
    width: 100%;
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .builder-preview-panel {
    padding: 1.5rem 1rem 2.5rem;
    min-height: auto;
  }
}


/* ════════════════════════════════════════
   Profile Page
   ════════════════════════════════════════ */

.profile-page {
  min-height: 100vh;
  background: var(--cream);
}

.profile-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.profile-header {
  margin-bottom: 2rem;
}

.profile-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.35rem;
}

.profile-subtitle {
  font-size: 0.9rem;
  color: var(--gray);
}

/* ── Cards ── */
.profile-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.profile-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1.25rem;
}

.profile-card-subtitle {
  font-size: 0.82rem;
  color: var(--gray);
  margin-top: -0.9rem;
  margin-bottom: 1.25rem;
}

/* ── Radio groups ── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.radio-group-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-pale);
}

.radio-option input[type="radio"] {
  accent-color: var(--green);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.radio-label {
  font-size: 0.85rem;
  color: var(--dark);
  font-weight: 500;
  line-height: 1.3;
}

/* ── Actions ── */
.profile-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-save-profile {
  background: var(--green);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.15s;
}

.btn-save-profile:hover {
  background: var(--green-light);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════
   Receipt rows
   ═══════════════════════════════════════════════ */

.receipts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.receipt-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: white;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-row:hover {
  background: var(--green-pale);
}

.receipt-row--voided {
  opacity: 0.55;
}

.receipt-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

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

.receipt-row-consecutive {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray);
  font-family: monospace;
  letter-spacing: 0.03em;
}

.receipt-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15em 0.55em;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receipt-badge--voided {
  background: #fee2e2;
  color: #b91c1c;
}

.receipt-row-who {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-row-concept {
  font-size: 0.8rem;
  color: var(--gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  white-space: nowrap;
}

.receipt-row-amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.receipt-row-currency {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray);
  margin-left: 0.2em;
}

.receipt-row-date {
  font-size: 0.78rem;
  color: var(--gray);
}

/* ── Row actions dropdown ── */

.receipt-row-actions {
  position: relative;
}

.receipt-actions-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--gray);
  transition: background 0.12s, color 0.12s;
}

.receipt-actions-trigger:hover {
  background: var(--border);
  color: var(--dark);
}

.receipt-actions-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  min-width: 170px;
  z-index: 100;
  overflow: hidden;
  padding: 0.3rem 0;
}

.receipt-actions-menu.is-open {
  display: block;
}

.receipt-action-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s;
}

.receipt-action-item:hover {
  background: var(--green-pale);
}

.receipt-action-item--danger {
  color: #b91c1c;
}

.receipt-action-item--danger:hover {
  background: #fee2e2;
}

/* ── Pagination ── */

.pagy-nav {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.pagy-nav .pagy {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.pagy-nav a,
.pagy-nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dark);
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.pagy-nav a:hover {
  background: var(--green-pale);
  border-color: var(--border);
}

.pagy-nav .pagy-page.active,
.pagy-nav span.current {
  background: var(--green);
  color: white;
  border-color: var(--green);
  font-weight: 700;
}

.pagy-nav .pagy-gap,
.pagy-nav .gap {
  color: var(--gray);
  border: none;
  cursor: default;
}

/* ── Receipt row clickable link ── */

.receipt-row-link {
  display: contents; /* lets the two inner divs participate in the parent grid */
  text-decoration: none;
  color: inherit;
}

/* ═══════════════════════════════════════════════
   Receipt show page
   ═══════════════════════════════════════════════ */

.receipt-show-consecutive {
  font-family: monospace;
  color: var(--gray);
  font-weight: 700;
}

.receipt-show-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-receipt-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
}

.btn-receipt-action--secondary {
  color: var(--dark);
}

.btn-receipt-action--secondary:hover {
  background: var(--green-pale);
  border-color: var(--green);
}

.btn-receipt-action--danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-receipt-action--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.receipt-show-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.receipt-show-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 1.5rem;
  gap: 1.25rem 2rem;
}

.receipt-show-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.receipt-show-field--wide {
  grid-column: 1 / -1;
}

.receipt-show-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-show-value {
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 500;
}

.receipt-show-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  background: var(--green-pale);
  border-top: 1.5px solid var(--border);
}

.receipt-show-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-show-total-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green);
}

.receipt-show-total-currency {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray);
  margin-left: 0.3em;
}

.receipt-show-back {
  margin-bottom: 1rem;
}

.receipt-back-link {
  font-size: 0.875rem;
  color: var(--gray);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.12s;
}

.receipt-back-link:hover {
  color: var(--green);
}

/* ════════════════════════════════════════
   Receipt Preview — Moderno Template
   ════════════════════════════════════════ */

.receipt-moderno {
  font-family: 'DM Sans', sans-serif;
}

/* ── Dark header strip ── */
.rm-header {
  background: #0f1f17;
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.rm-header-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.rm-logo-generic svg {
  display: block;
}

.rm-company {
  flex: 1;
}

.rm-company-name {
  font-weight: 700;
  font-size: 0.97rem;
  color: white;
  line-height: 1.3;
}

.rm-company-number {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.15rem;
}

.rm-header-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 0.85rem;
}

.rm-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #00c47a;
}

.rm-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
  margin-top: 0.2rem;
}

.rm-date {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  text-align: right;
  flex-shrink: 0;
  max-width: 140px;
}

/* ── White body ── */
.rm-body {
  background: white;
  padding: 0.1rem 0 0;
}

/* ── Rows ── */
.rm-rows {
  padding: 1rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.83rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f0f4f2;
}

.rm-row:last-child {
  border-bottom: none;
}

.rm-label {
  color: #6b7c74;
  flex-shrink: 0;
  min-width: 100px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.rm-value {
  font-weight: 600;
  color: #0f1f17;
  text-align: right;
  word-break: break-word;
}

.rm-value-concept {
  text-align: right;
  max-width: 220px;
}

/* ── Amount highlight ── */
.rm-amount-box {
  margin: 0.75rem 1.5rem 0;
  background: #0f1f17;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rm-amount-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rm-amount-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #00c47a;
}

/* ── Total in words ── */
.rm-words {
  padding: 0.55rem 1.5rem 0.9rem;
  font-size: 0.74rem;
  color: #6b7c74;
  font-style: italic;
}

/* ── Footer ── */
.rm-footer {
  border-top: 1px solid #f0f4f2;
  padding: 0.65rem 1.5rem;
  text-align: center;
}

.rm-footer-text {
  font-size: 0.68rem;
  color: #a0b0a8;
}

/* ════════════════════════════════════════
   Receipt Preview — Ejecutivo Template
   ════════════════════════════════════════ */

.receipt-ejecutivo {
  font-family: 'DM Sans', sans-serif;
  background: white;
}

.re-header {
  padding: 1.4rem 1.5rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.re-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.re-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a6b4a;
  margin-bottom: 0.3rem;
}

.re-company-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f1f17;
  line-height: 1.3;
}

.re-company-number {
  font-size: 0.73rem;
  color: #7a8f85;
  margin-top: 0.1rem;
}

.re-header-right {
  text-align: right;
  flex-shrink: 0;
}

.re-num-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7a8f85;
}

.re-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #0f1f17;
  line-height: 1.1;
}

.re-date {
  font-size: 0.72rem;
  color: #7a8f85;
  margin-top: 0.25rem;
}

.re-rule {
  height: 2px;
  background: linear-gradient(to right, #1a6b4a, #00c47a 40%, transparent);
  margin: 0 1.5rem;
}

.re-rows {
  padding: 0.9rem 1.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.re-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.83rem;
}

.re-label {
  color: #7a8f85;
  flex-shrink: 0;
  min-width: 100px;
}

.re-value {
  font-weight: 600;
  color: #0f1f17;
  text-align: right;
  word-break: break-word;
}

.re-value-concept {
  text-align: right;
  max-width: 220px;
}

.re-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: #f4faf7;
}

.re-amount-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #1a6b4a;
  text-transform: uppercase;
}

.re-amount-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #1a6b4a;
}

.re-words {
  padding: 0.45rem 1.5rem 0.8rem;
  font-size: 0.74rem;
  color: #7a8f85;
  font-style: italic;
}

.re-footer {
  padding: 0.6rem 1.5rem;
  text-align: center;
}

.re-footer-text {
  font-size: 0.68rem;
  color: #a0b0a8;
}

/* ════════════════════════════════════════
   Receipt Preview — Minimal Template
   ════════════════════════════════════════ */

.receipt-minimal {
  font-family: 'DM Sans', sans-serif;
  background: white;
}

.rmin-header {
  padding: 1.6rem 1.5rem 0.9rem;
}

.rmin-company-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #111;
}

.rmin-company-number {
  font-size: 0.72rem;
  color: #999;
  margin-top: 0.1rem;
}

.rmin-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 0 1.5rem;
}

.rmin-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 1.5rem 0.1rem;
}

.rmin-title {
  font-size: 0.8rem;
  color: #555;
}

.rmin-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: #111;
}

.rmin-date {
  padding: 0 1.5rem 0.75rem;
  font-size: 0.72rem;
  color: #999;
}

.rmin-rows {
  padding: 0.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rmin-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.82rem;
}

.rmin-label {
  color: #999;
  flex-shrink: 0;
  min-width: 95px;
}

.rmin-value {
  font-weight: 500;
  color: #111;
  text-align: right;
  word-break: break-word;
}

.rmin-value-concept {
  text-align: right;
  max-width: 210px;
}

.rmin-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.8rem 1.5rem;
}

.rmin-amount-label {
  font-size: 0.72rem;
  color: #999;
}

.rmin-amount-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111;
}

.rmin-words {
  padding: 0 1.5rem 0.8rem;
  font-size: 0.72rem;
  color: #bbb;
  font-style: italic;
}

.rmin-footer {
  padding: 0.6rem 1.5rem;
  text-align: center;
}

.rmin-footer-text {
  font-size: 0.67rem;
  color: #ccc;
}

/* ════════════════════════════════════════
   Receipt Preview — Bold Template
   ════════════════════════════════════════ */

.receipt-bold {
  font-family: 'DM Sans', sans-serif;
  background: #0f1f17;
}

.rb-header {
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.rb-logo-generic svg {
  display: block;
}

.rb-company {
  flex: 1;
}

.rb-company-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
}

.rb-company-number {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.12rem;
}

.rb-title-band {
  background: #00c47a;
  padding: 0.7rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rb-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #0f1f17;
}

.rb-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f1f17;
}

.rb-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.rb-date-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.rb-date {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
}

.rb-rows {
  padding: 0.75rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.82rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rb-row:last-child {
  border-bottom: none;
}

.rb-label {
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  min-width: 95px;
}

.rb-value {
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-align: right;
  word-break: break-word;
}

.rb-value-concept {
  text-align: right;
  max-width: 210px;
}

.rb-amount-box {
  margin: 0.5rem 1.5rem 0;
  background: rgba(0,196,122,0.12);
  border: 1px solid rgba(0,196,122,0.3);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rb-amount-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #00c47a;
}

.rb-amount-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #00c47a;
}

.rb-words {
  padding: 0.5rem 1.5rem 0.85rem;
  font-size: 0.73rem;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

.rb-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 0.65rem 1.5rem;
  text-align: center;
}

.rb-footer-text {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.25);
}

/* ════════════════════════════════════════
   Receipt Preview — Corporativo Template
   ════════════════════════════════════════ */

.receipt-corporativo {
  font-family: 'DM Sans', sans-serif;
  background: white;
}

.rcorp-layout {
  display: flex;
  min-height: 100%;
}

.rcorp-band {
  width: 56px;
  flex-shrink: 0;
  background: #1a6b4a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0;
  gap: 0.5rem;
}

.rcorp-band-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.rcorp-band-num {
  font-size: 1rem;
  font-weight: 800;
  color: white;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.05em;
}

.rcorp-band-date {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

.rcorp-main {
  flex: 1;
  padding: 1.25rem 1.25rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
}

.rcorp-company {
  margin-bottom: 0.75rem;
}

.rcorp-company-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: #0f1f17;
}

.rcorp-company-number {
  font-size: 0.72rem;
  color: #7a8f85;
  margin-top: 0.1rem;
}

.rcorp-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #1a6b4a;
  margin-top: 0.35rem;
}

.rcorp-rule {
  height: 1px;
  background: #e4ede8;
  margin: 0.6rem 0;
}

.rcorp-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rcorp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.81rem;
}

.rcorp-label {
  color: #7a8f85;
  flex-shrink: 0;
  min-width: 85px;
  font-size: 0.76rem;
}

.rcorp-value {
  font-weight: 600;
  color: #0f1f17;
  text-align: right;
  word-break: break-word;
}

.rcorp-value-concept {
  text-align: right;
  max-width: 190px;
}

.rcorp-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: #f4faf7;
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  margin-top: 0.25rem;
}

.rcorp-amount-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a6b4a;
  text-transform: uppercase;
}

.rcorp-amount-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a6b4a;
}

.rcorp-words {
  padding: 0.35rem 0 0.6rem;
  font-size: 0.72rem;
  color: #7a8f85;
  font-style: italic;
}

.rcorp-footer {
  border-top: 1px solid #e4ede8;
  padding-top: 0.55rem;
  text-align: center;
  margin-top: auto;
}

.rcorp-footer-text {
  font-size: 0.67rem;
  color: #a0b0a8;
}

/* ════════════════════════════════════════
   Receipt Preview — Elegante Template
   ════════════════════════════════════════ */

.receipt-elegante {
  font-family: 'DM Sans', sans-serif;
  background: #f7faf5;
}

.rel-header {
  padding: 1.5rem 1.5rem 1rem;
  text-align: center;
}

.rel-ornament {
  font-size: 0.8rem;
  color: #8aad96;
  letter-spacing: 0.5em;
  margin-bottom: 0.7rem;
}

.rel-company-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2c3e32;
  line-height: 1.3;
}

.rel-company-number {
  font-size: 0.72rem;
  color: #8aad96;
  margin-top: 0.15rem;
}

.rel-title {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b876f;
  margin-top: 0.6rem;
}

.rel-thin-rule {
  height: 1px;
  background: linear-gradient(to right, transparent, #c5d9c4, transparent);
  margin: 0 1.5rem;
}

.rel-meta {
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 1.5rem;
}

.rel-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.rel-meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8aad96;
}

.rel-meta-value {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2c3e32;
}

.rel-rows {
  padding: 0.75rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.82rem;
}

.rel-label {
  color: #8aad96;
  flex-shrink: 0;
  min-width: 100px;
}

.rel-value {
  font-weight: 500;
  color: #2c3e32;
  text-align: right;
  word-break: break-word;
}

.rel-value-concept {
  text-align: right;
  max-width: 210px;
}

.rel-amount-box {
  margin: 0.5rem 1.5rem 0;
  border: 1px solid #c5d9c4;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.rel-amount-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #6b876f;
}

.rel-amount-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #2c3e32;
}

.rel-words {
  padding: 0.45rem 1.5rem 0.75rem;
  font-size: 0.73rem;
  color: #8aad96;
  font-style: italic;
}

.rel-footer {
  padding: 0.65rem 1.5rem;
  text-align: center;
}

.rel-ornament-sm {
  font-size: 0.7rem;
  color: #c5d9c4;
  letter-spacing: 0.5em;
  margin-bottom: 0.3rem;
}

.rel-footer-text {
  font-size: 0.67rem;
  color: #a0b8a3;
}

/* ════════════════════════════════════════
   Receipt Preview — Noche Template
   ════════════════════════════════════════ */

.receipt-noche {
  font-family: 'DM Sans', sans-serif;
  background: #1a2620;
}

.rn-header {
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border-bottom: 1px solid #2a3f33;
}

.rn-logo-generic svg {
  display: block;
}

.rn-company {
  flex: 1;
}

.rn-company-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #d4e8db;
}

.rn-company-number {
  font-size: 0.72rem;
  color: #4a6055;
  margin-top: 0.12rem;
}

.rn-title-bar {
  padding: 0.85rem 1.5rem 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.rn-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #4a8060;
}

.rn-num {
  font-size: 0.88rem;
  font-weight: 700;
  color: #d4e8db;
  margin-top: 0.2rem;
}

.rn-date {
  font-size: 0.73rem;
  color: #4a6055;
  text-align: right;
  flex-shrink: 0;
}

.rn-rule {
  height: 1px;
  background: #2a3f33;
  margin: 0 1.5rem;
}

.rn-rows {
  padding: 0.8rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rn-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.82rem;
}

.rn-label {
  color: #4a6055;
  flex-shrink: 0;
  min-width: 95px;
}

.rn-value {
  font-weight: 500;
  color: #d4e8db;
  text-align: right;
  word-break: break-word;
}

.rn-value-concept {
  text-align: right;
  max-width: 210px;
}

.rn-amount-box {
  margin: 0.65rem 1.5rem 0;
  background: #0f1f17;
  border: 1px solid #2a3f33;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rn-amount-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #4a8060;
  text-transform: uppercase;
}

.rn-amount-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #00c47a;
}

.rn-words {
  padding: 0.5rem 1.5rem 0.85rem;
  font-size: 0.73rem;
  color: #3a5548;
  font-style: italic;
}

.rn-footer {
  border-top: 1px solid #2a3f33;
  padding: 0.65rem 1.5rem;
  text-align: center;
}

.rn-footer-text {
  font-size: 0.68rem;
  color: #3a5548;
}

/* ════════════════════════════════════════
   Receipt Preview — Colores Template
   ════════════════════════════════════════ */

.receipt-colores {
  font-family: 'DM Sans', sans-serif;
  background: white;
}

.rcol-band {
  display: flex;
  height: 7px;
}

.rcol-band-seg {
  flex: 1;
}

.rcol-band-seg--1 { background: #1a6b4a; }
.rcol-band-seg--2 { background: #00c47a; }
.rcol-band-seg--3 { background: #a8edcc; }

.rcol-header {
  padding: 1.1rem 1.5rem 0.5rem;
}

.rcol-company-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: #0f1f17;
}

.rcol-company-number {
  font-size: 0.72rem;
  color: #7a8f85;
  margin-top: 0.1rem;
}

.rcol-meta {
  padding: 0.3rem 1.5rem 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.rcol-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a6b4a;
}

.rcol-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.rcol-num {
  font-size: 0.8rem;
  color: #0f1f17;
}

.rcol-date {
  font-size: 0.72rem;
  color: #7a8f85;
}

.rcol-divider {
  height: 1px;
  background: #e4ede8;
  margin: 0 1.5rem;
}

.rcol-rows {
  padding: 0.75rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rcol-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.82rem;
}

.rcol-label {
  color: #7a8f85;
  flex-shrink: 0;
  min-width: 95px;
}

.rcol-value {
  font-weight: 500;
  color: #0f1f17;
  text-align: right;
  word-break: break-word;
}

.rcol-value-concept {
  text-align: right;
  max-width: 210px;
}

.rcol-amount-box {
  margin: 0.5rem 1.5rem 0;
  background: linear-gradient(135deg, #1a6b4a, #00c47a);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rcol-amount-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
}

.rcol-amount-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
}

.rcol-words {
  padding: 0.5rem 1.5rem 0.8rem;
  font-size: 0.73rem;
  color: #7a8f85;
  font-style: italic;
}

.rcol-footer {
  padding: 0.6rem 1.5rem;
  text-align: center;
}

.rcol-footer-text {
  font-size: 0.68rem;
  color: #a0b0a8;
}
