/* Prototipo: panel animado estilo home Holded (referencia visual, datos ficticios). */

:root {
  --brand: #1963ef;
  --brand-soft: #e8f0fd;
  --brand-deep: #1657d1;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e3e8ef;
  --surface: #f8fafc;
  --white: #fff;
  --green: #22c55e;
  --green-ink: #16a34a;
  --red: #ef4444;
  --amber: #f59e0b;
  --violet: #7c5cfc;
  --radius: 16px;
  --shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hero-ctrl-btn-bg: rgba(15, 23, 42, 0.55);
  --hero-ctrl-btn-text: #e2e8f0;
  --hero-ctrl-btn-border: rgba(148, 163, 184, 0.35);
  --hero-ctrl-btn-hover-bg: rgba(30, 41, 59, 0.9);
  --hero-ctrl-tour-bg: #1963ef;
  --hero-ctrl-tour-text: #fff;
  --hero-ctrl-tour-hover-bg: #1657d1;
  --hero-ctrl-dot-bg: rgba(148, 163, 184, 0.45);
  --hero-ctrl-dot-active-bg: #93c5fd;
  --hero-ctrl-btn-font-size: 12px;
  --hero-ctrl-btn-min-width: auto;
  --hero-ctrl-btn-padding-x: 14px;
  --hero-ctrl-btn-padding-y: 7px;
  --hero-ctrl-btn-icon-size: 2.25rem;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: transparent;
}

body.hero-demo {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(25, 99, 239, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 20%, rgba(124, 92, 252, 0.08), transparent 50%),
    #0b1220;
}

html.hero-embed,
html.hero-embed body,
body.hero-embed,
body.hero-embed .page,
body.hero-embed .panel-card {
  background: transparent !important;
  background-image: none !important;
}

body {
  padding: 48px 24px 64px;
}

body.hero-demo {
  padding: 48px 24px 64px;
}

body.hero-embed {
  padding: 0;
  color: var(--ink);
}

body.hero-embed .page {
  max-width: none;
  margin: 0;
}

body.hero-embed .panel-card {
  box-shadow:
    0 20px 50px -16px rgba(15, 23, 42, 0.22),
    0 0 0 1px rgba(15, 23, 42, 0.14);
}

body.hero-embed .panel-shell {
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

body.hero-embed .panel-glow {
  display: none;
}

.hero-mode-single .sidebar {
  display: none;
}

.hero-mode-single.panel-shell,
.panel-shell.hero-mode-single {
  border-radius: var(--radius);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
}

.page-intro {
  margin-bottom: 28px;
  color: #cbd5e1;
}

.page-intro h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.page-intro p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 52ch;
}

.page-intro code {
  font-size: 0.85em;
  color: #93c5fd;
}

/* —— Shell —— */
.panel-card {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.panel-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  box-shadow:
    0 -6px 25px rgba(34, 197, 94, 0.2),
    -6px 0 25px rgba(34, 197, 94, 0.15),
    6px 0 25px rgba(34, 197, 94, 0.15),
    0 6px 25px rgba(34, 197, 94, 0.2);
  transition: opacity 0.7s ease;
}

.panel-card:hover .panel-glow {
  opacity: 1;
}

.panel-shell {
  position: relative;
  display: flex;
  height: 640px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface);
}

.panel-shell--tall {
  height: 700px;
}

.page-mount {
  height: 100%;
  overflow: auto;
  padding: 14px 16px 18px;
}

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

/* —— Dashboard toolbar —— */
.dash-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.dash-icon {
  color: #94a3b8;
  font-size: 14px;
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-select select,
.btn-widget-store {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.range-select select {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.btn-widget-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-widget-store:hover,
.range-select select:hover {
  background: #f8fafc;
}

.widget-store {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.widget-store-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
}

.widget-store-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.store-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

.store-item:hover {
  background: #f8fafc;
}

.store-item strong {
  display: block;
}

.store-item small {
  color: var(--muted);
}

.store-item input {
  margin-top: 2px;
}

/* —— Widget grid —— */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  align-content: start;
  align-items: start;
}

.w-card {
  position: relative;
  grid-column: span 3;
  background: var(--white);
  border: 1px solid #e8edf3;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
  cursor: grab;
}

.w-card:active {
  cursor: grabbing;
}

.w-drag {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 1;
  font-size: 11px;
  line-height: 1;
  letter-spacing: -1px;
  color: #94a3b8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.w-card:hover .w-drag,
.w-card:focus-within .w-drag,
.widget-grid.is-reordering .w-drag {
  opacity: 1;
}

.w-welcome .w-drag {
  color: rgba(255, 255, 255, 0.75);
}

.widget-grid.is-reordering {
  user-select: none;
}

.w-card.is-dragging,
.proj-card.is-dragging {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  margin: 0;
  opacity: 1;
  pointer-events: none;
  cursor: grabbing;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  will-change: transform;
}

.w-card.is-placeholder,
.proj-card.is-placeholder {
  background: rgba(25, 99, 239, 0.06) !important;
  border: 1px dashed #93c5fd !important;
  box-shadow: none;
  pointer-events: none;
}

.w-card.is-placeholder > *,
.proj-card.is-placeholder > * {
  visibility: hidden;
}

.w-kpi { grid-column: span 3; }
.w-treasury { grid-column: span 3; }
.w-summary { grid-column: span 6; min-height: 200px; }
.w-channels { grid-column: span 3; }
.w-pending { grid-column: span 3; }
.w-welcome {
  grid-column: span 3;
  grid-row: span 2;
  background: linear-gradient(165deg, #3b82f6 0%, #6366f1 55%, #7c3aed 100%);
  color: #fff;
  border: 0;
}
.w-empty,
.w-stat { grid-column: span 3; }

.w-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-right: 16px;
}

.w-kpi-top h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.w-kpi-top span {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.w-kpi-value {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.w-kpi-target {
  margin: 0 0 8px;
  font-size: 11px;
  color: #64748b;
}

.w-kpi-bar {
  height: 4px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.w-kpi-bar.thin { height: 3px; }

.w-kpi-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.9s var(--ease);
}

.w-sync {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 999px;
  padding: 3px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}

.w-chart-wrap {
  height: 150px;
  display: flex;
  flex-direction: column;
}

.w-chart-wrap svg {
  flex: 1;
  width: 100%;
  height: 120px;
}

.w-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  color: #94a3b8;
}

.w-channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.w-channel-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

.w-channel-meta strong {
  font-weight: 600;
  color: #334155;
}

.w-channel-meta span {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
}

.w-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.w-welcome-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.w-welcome-av {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 800;
}

.w-welcome ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.w-welcome li {
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.95;
}

.w-empty {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 110px;
  color: #64748b;
  font-size: 13px;
}

.w-empty-icon {
  font-size: 22px;
  color: #60a5fa;
  margin-bottom: 6px;
}

.w-stat .w-kpi-value { font-size: 20px; }

/* —— Treasury —— */
.treasury-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.treasury-tx {
  grid-column: 1 / -1;
  overflow: auto;
  max-height: 240px;
}

.bank-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.bank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.bank-row:last-child {
  border-bottom: 0;
}

.bank-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.bank-row strong {
  display: block;
  font-size: 13px;
}

.bank-row small {
  color: var(--muted);
  font-size: 11px;
}

.bank-bal {
  text-align: right;
}

.bank-bal strong {
  font-variant-numeric: tabular-nums;
}

.bank-bal .pos { color: var(--green-ink); }
.bank-bal .neg { color: #dc2626; }

.cf-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
}

.cf-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

.cf-legend .cf-in,
.cf-chart .cf-in { background: #20c997; }

.cf-legend .cf-out,
.cf-chart .cf-out { background: #ff9c6e; }

.cf-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 140px;
  padding-top: 8px;
}

.cf-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.cf-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.cf-bars span {
  width: 12px;
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
  transform-origin: bottom;
  transform: scaleY(0.08);
  transition: transform 0.8s var(--ease);
}

.scene.is-active .cf-bars span {
  transform: scaleY(1);
}

.cf-col small {
  font-size: 10px;
  color: #94a3b8;
}

.data-table .pos { color: var(--green-ink); }
.data-table .neg { color: #dc2626; }

/* —— Projects kanban —— */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  min-height: 0;
  height: calc(100% - 100px);
}

.kanban-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #eef2f6;
  border-radius: 12px;
  padding: 10px;
  overflow: hidden;
}

.kanban-col header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.kanban-col header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.kanban-col header span {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: #fff;
  border-radius: 999px;
  padding: 2px 7px;
}

.kanban-col.is-drop-target {
  background: #e8eef8;
  outline: 1px dashed #93c5fd;
}

.kanban-cards {
  display: grid;
  gap: 8px;
  overflow: auto;
  align-content: start;
  flex: 1;
  min-height: 72px;
}

.proj-card {
  position: relative;
  background: var(--white);
  border: 1px solid #e8edf3;
  border-radius: 10px;
  padding: 10px 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: grab;
}

.proj-card:active {
  cursor: grabbing;
}

.proj-card .w-drag {
  top: 8px;
  right: 8px;
}

.kanban-board.is-reordering,
.kanban-board.is-reordering .proj-card {
  user-select: none;
}

.proj-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  padding-right: 16px;
}

.proj-card-top strong {
  font-size: 12px;
  line-height: 1.3;
}

.proj-card > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}

.proj-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.proj-profit {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-ink);
}

@media (max-width: 1100px) {
  .w-card,
  .w-kpi,
  .w-treasury,
  .w-summary,
  .w-channels,
  .w-pending,
  .w-welcome,
  .w-empty,
  .w-stat {
    grid-column: span 6;
  }

  .widget-store-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .panel-shell--tall {
    height: auto;
    min-height: 560px;
  }

  .w-card,
  .w-kpi,
  .w-treasury,
  .w-summary,
  .w-channels,
  .w-pending,
  .w-welcome,
  .w-empty,
  .w-stat {
    grid-column: span 12;
  }

  .widget-store-grid {
    grid-template-columns: 1fr;
  }

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

/* —— Sidebar —— */
.sidebar {
  z-index: 20;
  display: none;
  width: 64px;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 20px 0;
  border-right: 1px solid var(--line);
  background: var(--white);
}

@media (min-width: 900px) {
  .sidebar {
    display: flex;
  }
}

.sidebar-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  color: var(--ink);
}

.sidebar-logo img,
.sidebar-logo svg {
  display: block;
  width: 28px;
  height: 28px;
}

.nav-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.nav-btn.is-active {
  background: #e2e8f0;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
}

.nav-tip {
  pointer-events: none;
  position: absolute;
  left: calc(100% + 10px);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  background: #1e293b;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 30;
}

.nav-btn:hover .nav-tip,
.nav-btn:focus-visible .nav-tip {
  opacity: 1;
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: auto;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.avatar::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #4ade80;
}

/* —— Stage —— */
.stage {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.scene {
  position: absolute;
  inset: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.985);
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease),
    visibility 0.55s;
  pointer-events: none;
}

.scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scene.is-exit {
  opacity: 0;
  transform: translateY(-8px) scale(0.99);
}

/* Stagger children when scene activates */
.scene.is-active [data-enter] {
  animation: enter-up 0.55s var(--ease) both;
}

.scene.is-active [data-enter="1"] { animation-delay: 0.05s; }
.scene.is-active [data-enter="2"] { animation-delay: 0.12s; }
.scene.is-active [data-enter="3"] { animation-delay: 0.18s; }
.scene.is-active [data-enter="4"] { animation-delay: 0.24s; }
.scene.is-active [data-enter="5"] { animation-delay: 0.3s; }
.scene.is-active [data-enter="6"] { animation-delay: 0.36s; }
.scene.is-active [data-enter="7"] { animation-delay: 0.42s; }

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

/* —— Shared UI bits —— */
.scene-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scene-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.scene-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 600;
}

.live-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: live-pulse 1.6s ease-out infinite;
}

@keyframes live-pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.kpi {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.kpi small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi .delta {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green-ink);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 10px;
  height: calc(100% - 108px);
}

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.card-b {
  padding: 12px 14px;
}

/* Chart */
.chart {
  height: 160px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 4px 0;
}

.chart span {
  flex: 1;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, var(--brand));
  transform-origin: bottom;
  transform: scaleY(0.08);
  transition: transform 0.9s var(--ease);
}

.scene.is-active .chart span {
  transform: scaleY(1);
}

.chart span:nth-child(1) { height: 42%; transition-delay: 0.15s; }
.chart span:nth-child(2) { height: 58%; transition-delay: 0.2s; }
.chart span:nth-child(3) { height: 48%; transition-delay: 0.25s; }
.chart span:nth-child(4) { height: 72%; transition-delay: 0.3s; }
.chart span:nth-child(5) { height: 64%; transition-delay: 0.35s; }
.chart span:nth-child(6) { height: 86%; transition-delay: 0.4s; }
.chart span:nth-child(7) { height: 78%; transition-delay: 0.45s; background: linear-gradient(180deg, #86efac, #22c55e); }

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: #94a3b8;
}

.pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pending-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  color: #334155;
}

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

.pending-list a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  font-size: 11px;
}

/* Phone float */
.phone {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 200px;
  padding: 12px 12px 16px;
  border-radius: 28px;
  border: 3px solid #1e293b;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  animation: soft-float 7s ease-in-out infinite;
  z-index: 5;
}

.phone-notch {
  width: 72px;
  height: 8px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #334155;
}

.phone small {
  display: block;
  font-size: 10px;
  color: #94a3b8;
}

.phone strong {
  display: block;
  margin: 2px 0 12px;
  font-size: 13px;
}

.phone-kpi {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.phone-kpi span {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.phone ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.phone li {
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #cbd5e1;
}

@keyframes soft-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* —— Invoice scene —— */
.invoice-layout {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.invoice-doc {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: auto;
  min-height: 0;
}

.inv-editor {
  gap: 12px;
}

.inv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.inv-toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-toolbar-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.inv-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-action {
  padding: 6px 10px;
  font-size: 11px;
}

.inv-section h3,
.inv-notes h3,
.inv-payment h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.inv-client-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px 10px;
}

.inv-field {
  display: grid;
  gap: 4px;
  font-size: 11px;
}

.inv-field > span:first-child {
  color: var(--muted);
  font-weight: 600;
}

.inv-field > span:first-child i {
  color: #ef4444;
  font-style: normal;
}

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

.inv-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
}

.inv-control strong {
  font-weight: 600;
}

.inv-control em {
  font-style: normal;
  color: #94a3b8;
}

.inv-control.has-icons strong {
  flex: 1;
}

.inv-control-area {
  align-items: flex-start;
  min-height: 52px;
  line-height: 1.4;
}

.inv-control-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.inv-control-stack small {
  color: var(--muted);
  font-size: 11px;
}

.inv-select-like {
  justify-content: space-between;
}

.inv-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.inv-lines th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fafbfc;
}

.inv-lines th.num,
.inv-lines td.num {
  text-align: right;
}

.inv-lines td {
  padding: 10px 6px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.inv-concept {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 160px;
}

.inv-concept strong {
  display: block;
  font-size: 12px;
}

.inv-concept small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.inv-drag {
  color: #cbd5e1;
  cursor: grab;
  line-height: 1.2;
}

.inv-line-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}

.inv-input,
.inv-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.inv-input em {
  font-style: normal;
  color: #94a3b8;
}

.inv-row-actions {
  white-space: nowrap;
  text-align: right;
}

.inv-icon-btn {
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
}

.inv-icon-btn:hover {
  color: #334155;
}

.inv-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.inv-add-wrap {
  position: relative;
  margin-top: 8px;
}

.inv-add-line {
  width: 100%;
  padding: 9px;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, #cbd5e1);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-soft) 55%, #fff);
  color: var(--brand-deep);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.inv-add-line:hover,
.inv-add-line[aria-expanded="true"] {
  background: var(--brand-soft);
}

.inv-concept-picker {
  margin-top: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

.inv-concept-empty {
  margin: 0;
  padding: 8px 10px 6px;
  color: var(--muted);
  font-size: 11px;
}

.inv-concept-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.inv-concept-option:hover,
.inv-concept-option:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.inv-concept-option.is-custom {
  margin-top: 4px;
  border-top: 1px dashed var(--line);
  border-radius: 0 0 8px 8px;
}

.inv-concept-option strong,
.inv-concept-option small {
  display: block;
}

.inv-concept-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.inv-bottom {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 10px;
  margin-top: 4px;
}

.inv-notes,
.inv-payment,
.inv-totals {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fafbfc;
}

.inv-counter {
  display: block;
  margin-top: 6px;
  text-align: right;
  color: #94a3b8;
  font-size: 10px;
}

.inv-payment .inv-field {
  margin-bottom: 8px;
}

.inv-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: #475569;
  cursor: default;
}

.inv-checkbox {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}

.inv-checkbox.is-on {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px #fff;
}

.inv-totals {
  display: grid;
  align-content: center;
  gap: 8px;
}

.inv-totals > div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.inv-totals-grand {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink) !important;
  font-size: 14px !important;
}

.inv-totals-grand strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.inv-side .side-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-timeline {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.inv-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 8px;
  padding: 0 0 12px 0;
}

.inv-timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.inv-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #cbd5e1;
  margin-top: 2px;
}

.inv-timeline-item.is-done .inv-timeline-dot {
  background: var(--brand);
}

.inv-timeline-item.is-pending .inv-timeline-dot {
  background: #fbbf24;
}

.inv-timeline-item strong {
  display: block;
  font-size: 12px;
}

.inv-timeline-item small {
  color: var(--muted);
  font-size: 10px;
}

.inv-quick-stack {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.inv-quick {
  width: 100%;
  justify-content: center;
  font-size: 11px;
  padding: 8px 10px;
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.invoice-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(124, 92, 252, 0.12);
  color: var(--violet);
  font-weight: 800;
}

.invoice-brand strong {
  display: block;
  font-size: 14px;
}

.invoice-brand small {
  color: var(--muted);
  font-size: 11px;
}

.invoice-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.invoice-meta span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.invoice-meta strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.invoice-meta .total strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.invoice-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 13px;
}

.invoice-table th {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.invoice-table th:not(:first-child),
.invoice-table td:not(:first-child) {
  text-align: right;
}

.invoice-table td {
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.invoice-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.invoice-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 16px;
}

.invoice-foot p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.totals {
  width: 180px;
  font-size: 13px;
}

.totals div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
}

.totals .grand {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
}

.inv-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.inv-preview-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.inv-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.38);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

.inv-preview-overlay.is-open .inv-preview-backdrop {
  opacity: 1;
}

.inv-preview-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 94%);
  display: flex;
  flex-direction: column;
  background: #eef2f7;
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.22);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
}

.inv-preview-overlay.is-open .inv-preview-drawer {
  transform: translateX(0);
}

.inv-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.inv-preview-head h3 {
  margin: 0;
  font-size: 14px;
}

.inv-preview-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.inv-preview-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
}

.inv-preview-close:hover {
  background: var(--surface);
}

.inv-preview-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.inv-preview-paper {
  min-height: 100%;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.inv-preview-client {
  margin-top: 14px;
}

.inv-preview-client span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.inv-preview-client strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.inv-preview-client small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.invoice-mark img {
  display: block;
  width: 26px;
  height: 26px;
}

.inv-preview-paper .invoice-meta {
  flex-wrap: wrap;
  gap: 12px 16px;
}

.inv-preview-paper .invoice-table {
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .inv-preview-backdrop,
  .inv-preview-drawer {
    transition: none;
  }
}

.side-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
}

.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.side-tabs span {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.side-tabs span.is-on {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.side-body {
  padding: 14px;
  flex: 1;
  overflow: auto;
}

.side-row {
  margin-bottom: 12px;
}

.side-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}

.side-row strong {
  font-size: 13px;
}

.badge-review {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand-deep);
  font-size: 11px;
  font-weight: 600;
}

.progress-wrap {
  margin-top: 6px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--green);
  transition: width 1s var(--ease) 0.35s;
}

.scene.is-active .bar > i {
  width: var(--w, 80%);
}

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-ghost {
  background: #f1f5f9;
  color: #475569;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
}

.select-fake {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  background: #f8fafc;
}

/* —— Reports —— */
.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.report-kpis .kpi strong {
  font-size: 14px;
}

.tabs-mini {
  display: flex;
  gap: 4px;
}

.tabs-mini span {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.tabs-mini .on {
  background: var(--ink);
  color: #fff;
}

.report-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 10px;
  height: calc(100% - 86px);
}

.pl-rows {
  max-height: 100%;
  overflow: auto;
}

.pl-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: 12px;
}

.pl-row:hover {
  background: #f8fafc;
}

.pl-row.total {
  background: #f8fafc;
  font-weight: 700;
}

.pl-row .neg {
  color: #ef4444;
}

.pl-row .pos {
  color: var(--green-ink);
}

.pl-row.indent span:first-child {
  padding-left: 14px;
  color: #64748b;
}

.ratio-list {
  display: grid;
  gap: 10px;
  font-size: 12px;
}

.ratio-list div {
  display: flex;
  justify-content: space-between;
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.donut {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(
    var(--violet) 0 52%,
    var(--brand) 52% 80%,
    #34d399 80% 94%,
    var(--amber) 94% 100%
  );
  mask: radial-gradient(circle 28px at center, transparent 98%, #000 100%);
  -webkit-mask: radial-gradient(circle 28px at center, transparent 98%, #000 100%);
}

.legend {
  width: 100%;
  display: grid;
  gap: 6px;
  font-size: 11px;
}

.legend div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
}

/* —— Scanner —— */
.scan-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
  height: calc(100% - 52px);
}

.ticket-frame {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ticket-photo {
  position: relative;
  flex: 1;
  margin: 14px 14px 0;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 20%, rgba(25, 99, 239, 0.12), transparent 45%),
    linear-gradient(160deg, #1e293b, #0f172a 60%, #111827);
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 320px;
}

.ticket-paper {
  width: min(220px, 70%);
  padding: 16px 14px;
  border-radius: 4px;
  background: #faf7f2;
  color: #1f2937;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  transform: rotate(-2deg);
}

.ticket-store {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.ticket-addr {
  text-align: center;
  font-size: 9px;
  color: #6b7280;
  margin: 4px 0 10px;
}

.ticket-line {
  border-top: 1px dashed #d1d5db;
  margin: 8px 0;
}

.ticket-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  font-size: 10px;
}

.ticket-total {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
}

.ticket-iva {
  margin-top: 6px;
  text-align: center;
  font-size: 9px;
  color: #9ca3af;
}

.scan-beam {
  pointer-events: none;
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #60a5fa, #34d399, #60a5fa, transparent);
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.75);
  animation: scan-line 2.4s ease-in-out infinite;
  opacity: 0;
}

.scene.is-active .scan-beam {
  opacity: 1;
}

@keyframes scan-line {
  0% {
    top: 12%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 88%;
    opacity: 0;
  }
}

.scan-corners {
  pointer-events: none;
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
}

.scan-corners::before,
.scan-corners::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #93c5fd;
}

.scan-corners::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 4px 0 0 0;
}

.scan-corners::after {
  bottom: -1px;
  right: -1px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 4px 0;
}

.scan-hint {
  margin: 10px 14px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.scan-result {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ocr-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.ocr-field {
  position: relative;
  margin-bottom: 12px;
  padding-right: 24px;
}

.ocr-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--muted);
}

.ocr-field strong {
  font-size: 14px;
}

.ocr-check {
  position: absolute;
  top: 18px;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
}

.scene.is-active .ocr-check {
  animation: pop-check 0.35s var(--ease) both;
}

.scene.is-active .ocr-field[data-enter="3"] .ocr-check { animation-delay: 0.55s; }
.scene.is-active .ocr-field[data-enter="4"] .ocr-check { animation-delay: 0.75s; }
.scene.is-active .ocr-field[data-enter="5"] .ocr-check { animation-delay: 0.95s; }
.scene.is-active .ocr-field[data-enter="6"] .ocr-check { animation-delay: 1.15s; }

@keyframes pop-check {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* —— Contacts —— */
.contacts-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  height: calc(100% - 52px);
}

.contacts-list,
.contact-detail {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contacts-list .card-h {
  flex-wrap: wrap;
  gap: 8px;
}

.search-fake {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 160px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.contact-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}

.contact-rows li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: default;
}

.contact-rows li.is-selected {
  background: #eff6ff;
}

.contact-rows strong {
  display: block;
  font-size: 13px;
}

.contact-rows small {
  color: var(--muted);
  font-size: 11px;
}

.avatar-sm,
.avatar-lg {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--av, #1963ef) 16%, white);
  color: var(--av, #1963ef);
  font-weight: 800;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-ok {
  background: #ecfdf5;
  color: #15803d;
}

.pill-warn {
  background: #fffbeb;
  color: #b45309;
}

.pill-muted {
  background: #f1f5f9;
  color: #64748b;
}

.pill-brand {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.contact-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.contact-hero strong {
  display: block;
  font-size: 15px;
}

.contact-hero small {
  color: var(--muted);
  font-size: 12px;
}

.contact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.contact-stats div {
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.contact-stats small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.contact-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.contact-stats .pos {
  color: var(--green-ink);
}

/* —— Products —— */
.products-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.products-kpis .kpi strong {
  font-size: 16px;
}

.products-table {
  overflow: auto;
  max-height: calc(100% - 100px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: #fafbfc;
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table .num {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.data-table code {
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.data-table .muted {
  color: #94a3b8;
}

.data-table tr.is-alert {
  background: #fffbeb;
}

.data-table .warn {
  color: #d97706;
}

.margin-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.mini-bar {
  display: inline-block;
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.mini-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, var(--brand));
  transition: width 0.9s var(--ease);
}

.scene.is-active .mini-bar > i {
  width: var(--w, 50%);
}

/* —— Controls —— */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  max-width: 100%;
  padding: 0 12px;
}

body.hero-embed .controls {
  max-width: min(1120px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--hero-ctrl-dot-bg);
  cursor: pointer;
  padding: 0;
  transition: width 0.25s ease, background 0.25s ease;
}

.dot.is-active {
  width: 22px;
  background: var(--hero-ctrl-dot-active-bg);
}

.controls .ctrl-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hero-ctrl-btn-border);
  background: var(--hero-ctrl-btn-bg);
  color: var(--hero-ctrl-btn-text);
  border-radius: 999px;
  font-family: var(--font);
  font-size: var(--hero-ctrl-btn-font-size);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
  flex: 0 1 auto;
  max-width: 100%;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.controls .ctrl-btn-icon {
  width: var(--hero-ctrl-btn-icon-size);
  height: var(--hero-ctrl-btn-icon-size);
  min-width: 0;
  padding: 0;
  flex-shrink: 0;
}

.controls .ctrl-btn-text {
  min-width: min(var(--hero-ctrl-btn-min-width), 100%);
  padding: var(--hero-ctrl-btn-padding-y) var(--hero-ctrl-btn-padding-x);
  white-space: nowrap;
}

.controls .ctrl-btn:hover {
  background: var(--hero-ctrl-btn-hover-bg);
}

.controls .ctrl-btn-tour {
  background: var(--hero-ctrl-tour-bg);
  border-color: var(--hero-ctrl-tour-bg);
  color: var(--hero-ctrl-tour-text);
}

.controls .ctrl-btn-tour:hover,
.controls .ctrl-btn-tour.is-active {
  background: var(--hero-ctrl-tour-hover-bg);
  border-color: var(--hero-ctrl-tour-hover-bg);
}

.hero-tour.driver-popover {
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

.hero-tour .driver-popover-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.hero-tour .driver-popover-description {
  font-size: 13px;
  line-height: 1.45;
  color: #475569;
}

.hero-tour .driver-popover-progress-text {
  font-size: 11px;
  color: #64748b;
}

.hero-tour .driver-popover-next-btn {
  background: #1963ef;
  color: #fff;
  border: 0;
  text-shadow: none;
}

.hero-tour .driver-popover-prev-btn {
  background: #f1f5f9;
  color: #334155;
  border: 0;
  text-shadow: none;
}

.progress-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(226, 232, 240, 0.5);
  overflow: hidden;
  z-index: 40;
}

.progress-track > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--brand);
}

.panel-card.is-playing .progress-track > i {
  animation: scene-progress var(--scene-ms, 5200ms) linear forwards;
}

@keyframes scene-progress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .panel-shell {
    height: auto;
    min-height: 560px;
  }

  .scene {
    position: relative;
    inset: auto;
    display: none;
    padding: 0;
  }

  .scene.is-active {
    display: block;
  }

  .dash-grid,
  .invoice-layout,
  .report-grid,
  .report-kpis,
  .kpi-row,
  .scan-layout,
  .contacts-layout,
  .products-kpis,
  .treasury-layout,
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .treasury-tx {
    grid-column: auto;
  }

  .kanban-board {
    height: auto;
  }

  .phone {
    display: none;
  }

  .invoice-layout,
  .scan-layout,
  .contacts-layout {
    height: auto;
  }

  .inv-client-grid,
  .inv-bottom {
    grid-template-columns: 1fr;
  }

  .inv-field-wide {
    grid-column: auto;
  }

  .inv-lines {
    display: block;
    overflow-x: auto;
  }

  .ticket-photo {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scene {
    transform: none !important;
  }

  .live-pill::before,
  .phone,
  .scan-beam {
    animation: none !important;
  }
}
