/* Live recreation of the invoices view shown on the pricing page. It replaces
   the screen-facturas.png capture with DOM, following the hero-panel pattern
   from inicio.css: the mock is laid out exactly once at its fixed 1060px
   design width and the frame scales that finished layout proportionally via
   scale: tan(atan2(100cqw, 1060px)) — it never reflows.

   The frame's aspect ratio is the mock's measured natural size, and every
   animation phase preserves it: the drafted invoice row enters a clamped
   list (max-height at the 4-row base height + overflow hidden), so the new
   row pushes the last one past the clip like a list with more content below
   the fold, and the panel's outer size never moves. If content changes,
   re-measure and update both the ratio and the clamp.

   Decorative (aria-hidden, described by .fa-sr): nothing inside is
   focusable, and its type may run smaller than the page's body-text floor —
   an illustration of a UI, not UI. */

.fa-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fa-frame {
  aspect-ratio: 1060 / 520;
  container-type: inline-size;
  overflow: hidden;
  background: #fbfbfb;
}

.fa-demo {
  --fa-ink: #17172a;
  --fa-mut: #6d6d80;
  --fa-dim: #9a9aa8;
  --fa-line: #ececf1;
  --fa-canvas: #fbfbfb;
  --fa-green: #1c7d44;
  --fa-green-soft: #e5f6ec;
  width: 1060px;
  transform-origin: top left;
  scale: tan(atan2(100cqw, 1060px));
  display: flex;
  background: var(--fa-canvas);
  color: var(--fa-ink);
  line-height: 1.35;
  cursor: default;
  user-select: none;
}

.fa-demo * {
  min-width: 0;
}

/* The mock is laid out in px by design; the page's default paragraph margins
   (1em of each paragraph's own size) would inflate it unpredictably. */
.fa-demo p {
  margin: 0;
}

/* ---------- sidebar ---------- */

.fa-side {
  display: flex;
  flex-direction: column;
  flex: 0 0 190px;
  padding: 12px 10px 12px;
  border-right: 1px solid var(--fa-line);
  background: #f4f4f6;
}

.fa-brand {
  padding: 2px 8px 8px;
}

.fa-brand img {
  display: block;
  width: auto;
  height: 18px;
}

.fa-label {
  margin: 8px 8px 3px;
  color: var(--fa-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.fa-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 4.5px 8px;
  border-radius: 8px;
  color: var(--fa-mut);
  font-size: 12px;
  font-weight: 500;
}

.fa-item svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.fa-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fa-item.is-active {
  background: #e8e8ec;
  color: var(--fa-ink);
  font-weight: 600;
}

.fa-item.is-active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #45b0f5;
}

.fa-badge {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: #ececf1;
  color: var(--fa-mut);
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fa-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px 8px 0;
  border-top: 1px solid var(--fa-line);
}

.fa-user-name {
  font-size: 11.5px;
  font-weight: 600;
}

.fa-user-role {
  color: var(--fa-dim);
  font-size: 10px;
}

.fa-chev {
  margin-left: auto;
  color: var(--fa-dim);
}

/* ---------- avatars ---------- */

.fa-ava {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fa-ava.is-em { background: #23233c; }
.fa-ava.is-ki { background: #c08df2; }
.fa-ava.is-we { background: #6cd9ad; }
.fa-ava.is-lu { background: #ca4894; }
.fa-ava.is-nv { background: #7db9ef; }
.fa-ava.is-gl { background: #e3455a; }

/* ---------- main column ---------- */

.fa-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.fa-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--fa-line);
  background: #fff;
}

.fa-top svg {
  width: 15px;
  height: 15px;
  color: var(--fa-dim);
}

.fa-top-title {
  font-size: 13px;
  font-weight: 700;
}

.fa-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 260px;
  padding: 4px 10px;
  border: 1px solid var(--fa-line);
  border-radius: 9px;
  background: #fff;
  color: var(--fa-dim);
  font-size: 11px;
}

.fa-search span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fa-kbd {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--fa-line);
  border-radius: 5px;
  background: #f2f2f6;
  font-size: 9px;
}

.fa-top-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.fa-bell {
  position: relative;
}

.fa-bell-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e23c4f;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
}

/* ---------- content ---------- */

.fa-body {
  padding: 16px 18px 20px;
  transition: opacity 0.22s ease;
}

.fa-demo.is-reset .fa-body {
  opacity: 0.3;
}

.fa-head-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fa-h1 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.fa-new-btn {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 7px 15px;
  border-radius: 9px;
  background: #5d63f7;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.fa-sub {
  margin-top: 2px;
  color: var(--fa-mut);
  font-size: 12px;
}

.fa-card {
  border: 1px solid var(--fa-line);
  border-radius: 12px;
  background: #fff;
}

.fa-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.fa-kpi {
  padding: 12px 14px;
}

.fa-kpi-label {
  color: var(--fa-dim);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.fa-kpi-value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.fa-cur {
  margin-right: 2px;
  color: var(--fa-dim);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- invoices table ---------- */

.fa-table {
  margin-top: 12px;
  overflow: hidden;
}

.fa-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.fa-tool-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #eef0fd;
  color: #5661d6;
}

.fa-tool-icon svg {
  width: 14px;
  height: 14px;
}

.fa-tool-title {
  font-size: 13px;
  font-weight: 700;
}

.fa-count {
  padding: 1px 7px;
  border-radius: 6px;
  background: #f0f0f4;
  color: var(--fa-mut);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fa-tool-search {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 170px;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--fa-line);
  border-radius: 9px;
  color: var(--fa-dim);
  font-size: 10.5px;
}

.fa-tool-search svg,
.fa-select svg,
.fa-icon-btn svg,
.fa-cols-btn svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.fa-select {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--fa-line);
  border-radius: 9px;
  background: #f4f4f6;
  color: var(--fa-mut);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}

.fa-select svg {
  width: 10px;
  height: 10px;
}

.fa-icon-btn,
.fa-cols-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--fa-line);
  border-radius: 9px;
  background: #fff;
  color: var(--fa-mut);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Grid template shared by the header and every row, so columns stay glued
   through row enter/leave. */
.fa-cols {
  display: grid;
  grid-template-columns: 52px minmax(0, 1.5fr) 108px 104px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 14px;
}

.fa-thead {
  padding-top: 7px;
  padding-bottom: 7px;
  border-top: 1px solid var(--fa-line);
  border-bottom: 1px solid var(--fa-line);
  background: #f6f6f6;
  color: var(--fa-mut);
  font-size: 10.5px;
  font-weight: 600;
}

.fa-th-num {
  text-align: right;
}

.fa-sort {
  color: var(--fa-dim);
  font-size: 8px;
}

/* The clamp: base height is exactly four rows. The drafted invoice enters at
   the top and pushes the fourth row past the clip; the panel's outer height —
   promised by the frame's aspect ratio — never moves. Keep in sync with the
   measured row height (4 × 35px). */
.fa-rows {
  max-height: 140px;
  overflow: hidden;
}

.fa-row {
  height: 35px;
  border-bottom: 1px solid #f3f3f6;
  font-size: 12px;
}

.fa-row-num {
  color: var(--fa-mut);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fa-client {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  font-weight: 600;
}

.fa-client span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fa-money {
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.fa-money b {
  font-weight: 700;
}

/* ---------- status chips ---------- */

.fa-st {
  display: none;
  align-items: center;
  gap: 5px;
  justify-self: start;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.fa-st i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.fa-st-draft {
  background: #f0f0f4;
  color: #71717f;
}

.fa-st-sent {
  background: #d3edfe;
  color: #1a6fc0;
}

.fa-st-paid {
  background: var(--fa-green-soft);
  color: var(--fa-green);
}

.fa-row[data-state='draft'] .fa-st-draft,
.fa-row[data-state='sent'] .fa-st-sent,
.fa-row[data-state='paid'] .fa-st-paid {
  display: inline-flex;
}

.fa-row.is-flash {
  animation: fa-flash 1.1s ease-out;
}

/* The drafted invoice and its exit are staged by facturas-demo.js. Both ends
   are classes with explicit display so the row cannot half-exist, and the
   entrance animates transform/opacity only. */
.fa-row-extra {
  display: none;
}

.fa-demo.has-draft .fa-row-extra {
  display: grid;
  animation: fa-in 0.32s ease-out;
}

.fa-row-extra.is-leaving {
  opacity: 0;
  transition: opacity 0.4s ease-in;
}

/* ---------- table footer ---------- */

.fa-tfoot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--fa-mut);
  font-size: 10.5px;
}

.fa-page-size {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--fa-line);
  border-radius: 7px;
  background: #f4f4f6;
  font-weight: 600;
}

.fa-page-size svg {
  width: 9px;
  height: 9px;
}

.fa-range {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.fa-pager {
  display: flex;
  gap: 5px;
}

.fa-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--fa-line);
  border-radius: 7px;
  background: #f7f7fa;
  color: var(--fa-dim);
  font-size: 9px;
}

/* ---------- toast ---------- */

.fa-toast {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 9px;
  width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--fa-line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 30px -12px rgb(14 14 26 / 25%);
  font-size: 11.5px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
}

.fa-toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

.fa-toast-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: #27a25c;
}

.fa-toast b {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
}

.fa-toast small {
  display: block;
  margin-top: 1px;
  color: var(--fa-mut);
  font-size: 10.5px;
}

/* ---------- motion accents ---------- */

.fa-pop {
  animation: fa-pop 0.45s ease-out;
}

@keyframes fa-in {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fa-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

@keyframes fa-flash {
  0% { background: #eef4ff; }
  100% { background: #fff; }
}

/* ---------- pricing-page pin positions ----------
   precios.css places the three numbered pins as percentages of .shot-frame,
   read off the 1600x849 capture this mock replaces. The mock's geometry
   differs, so the pins are re-aimed here (later stylesheet, same regions:
   the totals row, the status column, the balance column). Measured off the
   1060x566 design layout. */

.shot-frame .shot-pin-1 {
  top: 29.3%;
  left: 39.1%;
}

.shot-frame .shot-pin-2 {
  top: 56.8%;
  left: 50.8%;
}

.shot-frame .shot-pin-3 {
  top: 56.8%;
  left: 90.3%;
}
