/* Tally — feuille unique, sans build.
   App mobile-first : Manrope, cartes arrondies, boutons doux, blanc et bleu. */

:root {
  color-scheme: light;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-softer: #f5f8ff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e9eef6;
  --line-strong: #dbe3ee;
  --surface: #ffffff;
  --bg: #f3f6fb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 18px 40px -24px rgba(15, 23, 42, 0.22);
  --shadow-blue: 0 16px 32px -14px rgba(37, 99, 235, 0.45);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --content-w: 480px;
  --series-income: #2563eb;
  --series-expense: #1baf7a;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.brand__name {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
}

p {
  margin-top: 0;
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

body.sheet-open {
  overflow: hidden;
}

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

.small {
  font-size: 0.76rem;
}

/* --- Authentification --------------------------------------------------- */

.auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 1.25rem;
}

.auth__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: min(100%, 420px);
}

.auth__card {
  width: 100%;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

.auth__mobile-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--blue);
  border-radius: 14px;
  color: #ffffff;
  box-shadow: var(--shadow-blue);
}

.brand__mark svg {
  width: 1.2rem;
  height: 1.2rem;
}

.brand__name {
  font-size: 1.2rem;
  font-weight: 800;
}

.auth__title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
}

.auth__subtitle {
  margin: 0.4rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth__notice {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--blue-soft);
  border-radius: 14px;
  color: #1e40af;
  font-size: 0.82rem;
  font-weight: 500;
}

.form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.field select {
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1rem;
  appearance: none;
  cursor: pointer;
}

.field select option {
  background: #ffffff;
  color: var(--ink);
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

.field input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.9;
}

.field input:hover,
.field select:hover {
  border-color: #c3cddd;
}

.field input:focus,
.field select:focus {
  background-color: #ffffff;
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field__control {
  position: relative;
}

.field__control input {
  padding-right: 4.5rem;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  padding: 0.45rem 0.6rem;
  background: none;
  border: 0;
  border-radius: 10px;
  color: var(--blue);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transform: translateY(-50%);
}

.field__toggle:hover {
  background: var(--blue-soft);
}

.field__errors {
  margin: 0;
  padding-left: 1rem;
  color: var(--danger);
  font-size: 0.78rem;
}

.field__hint {
  color: var(--muted);
  font-size: 0.76rem;
}

.field__hint ul {
  margin: 0.2rem 0 0;
  padding-left: 1rem;
}

.form__alert {
  padding: 0.75rem 0.9rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  color: var(--danger);
  font-size: 0.82rem;
}

.form__alert ul {
  margin: 0;
  padding-left: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.8rem 1.3rem;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button--primary {
  background: var(--blue);
  color: #ffffff;
  box-shadow: var(--shadow-blue);
}

.button--primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.button--block {
  width: 100%;
}

.button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.auth__switch {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.auth__switch a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.auth__switch a:hover {
  text-decoration: underline;
}

.auth__legal {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

/* --- Application -------------------------------------------------------- */

.app-shell {
  width: min(100%, var(--content-w));
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  background: var(--surface);
}

@media (min-width: 520px) {
  .app-shell {
    box-shadow: 0 0 0 1px var(--line);
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  background: var(--blue-soft);
  border-radius: 50%;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.app-main {
  padding: 1.15rem;
}

.card {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.link-button {
  padding: 0.3rem 0.1rem;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--blue);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.link-button:hover {
  color: var(--blue-dark);
}

.section__head .link-button {
  padding: 0.35rem 0.65rem;
  background: var(--blue-soft);
  border-radius: 999px;
}

.alert {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  color: var(--danger);
  font-size: 0.82rem;
}

.section {
  margin-bottom: 1.5rem;
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.section__head h2 {
  font-size: 1rem;
  font-weight: 800;
}

.hero {
  margin-bottom: 1.5rem;
  padding: 1.4rem;
  background: var(--blue);
  border-radius: 22px;
  color: #ffffff;
  box-shadow: var(--shadow-blue);
}

.hero__total + .hero__total {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero__label {
  display: block;
  margin-bottom: 0.2rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.72rem;
  font-weight: 600;
}

.hero__amount {
  display: block;
  color: #ffffff;
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.3rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.empty-state {
  padding: 1.75rem 1.25rem;
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.empty-state .button {
  margin-top: 1rem;
}

.wallet-list,
.tx-list,
.plain-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wallet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.wallet-card__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.wallet-card__meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.wallet-card__balance {
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.profit-card {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.profit-card + .profit-card {
  margin-top: 0.5rem;
}

.profit-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.28rem 0;
  font-size: 0.86rem;
}

.profit-row strong {
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.profit-row--total {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.positive {
  color: var(--blue);
}

.negative,
.neutral {
  color: var(--ink);
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.tx-item__main {
  min-width: 0;
}

.tx-item__title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tx-item__meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.tx-item__side {
  display: grid;
  justify-items: end;
  gap: 0.15rem;
}

.tx-item__amount {
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.12rem 0.5rem;
  background: var(--blue-soft);
  border-radius: 999px;
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 700;
}

.badge--late {
  background: #fef2f2;
  color: #b91c1c;
}

.plan-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.plan-card--complete {
  background: #fbfdff;
}

.plan-card--complete .progress__bar {
  background: #93c5fd;
}

.plan-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.plan-kind {
  display: inline-flex;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
}

.plan-kind--payable {
  background: #eff6ff;
  color: #2563eb;
}

.plan-kind--receivable {
  background: #e0f2fe;
  color: #0369a1;
}

.plan-kind--savings {
  background: #f1f5f9;
  color: #475569;
}

.plan-card__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.progress {
  height: 8px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 999px;
}

.progress__bar {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 250ms ease;
}

.plan-card__numbers {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.plan-card__numbers strong {
  color: var(--ink);
  font-weight: 700;
}

.plan-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.plan-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
}

.plan-card__dates {
  display: grid;
  gap: 0.1rem;
}

.plan-card__period {
  color: var(--muted);
  font-size: 0.72rem;
}

.plan-card__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-button--danger {
  color: var(--muted);
}

.icon-button--danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.button--ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.button--ghost:hover {
  background: #f8fafc;
  border-color: var(--blue);
  color: var(--blue);
}

.button--danger {
  background: #dc2626;
  color: #ffffff;
}

.button--danger:hover {
  background: #b91c1c;
}

.sheet__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.is-late-text {
  color: #b91c1c;
  font-weight: 600;
}

.button--small {
  min-height: 2.2rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  box-shadow: none;
  font-size: 0.78rem;
}

.plan-summary {
  padding: 0.8rem 0.9rem;
  background: #f8fafc;
  border-radius: 12px;
}

.plan-summary__name {
  margin: 0 0 0.15rem;
  font-weight: 700;
}

.action-button--wide {
  grid-column: 1 / -1;
}

.danger-text {
  color: #dc2626;
}

/* --- Flux et graphiques ------------------------------------------------ */

.flow-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.flow-filters .chips {
  margin-bottom: 0;
}

.flow-grid {
  display: grid;
  gap: 1rem;
  transition: opacity 150ms ease;
}

.flow-grid.is-loading {
  opacity: 0.55;
}

.flow-card {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.flow-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.flow-card__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.flow-card__sub {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.flow-card__net {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.flow-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.9rem 0 1.1rem;
}

.flow-stat {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border-radius: 12px;
}

.flow-stat span {
  color: var(--muted);
  font-size: 0.66rem;
}

.flow-stat strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.chart {
  display: flex;
  gap: 0.5rem;
}

.chart__axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 4rem;
  height: 140px;
  color: var(--muted);
  font-size: 0.55rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.chart__body {
  flex: 1;
  min-width: 0;
}

.chart__plot {
  position: relative;
  display: flex;
  gap: 2px;
  height: 140px;
  border-bottom: 1px solid var(--line-strong);
}

.chart__plot::before,
.chart__plot::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--line);
}

.chart__plot::before {
  top: 0;
}

.chart__plot::after {
  top: 50%;
}

.chart__month {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
  border-radius: 6px;
  outline: none;
}

.chart__month:hover,
.chart__month:focus-visible {
  background: var(--blue-softer);
}

.chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 0 2px;
}

.chart__bar {
  display: block;
  width: min(12px, 34%);
  border-radius: 4px 4px 0 0;
  transition:
    height 200ms ease,
    filter 150ms ease;
}

.chart__bar--income {
  background: var(--series-income);
}

.chart__bar--expense {
  background: var(--series-expense);
}

.chart__month:hover .chart__bar,
.chart__month:focus-visible .chart__bar {
  filter: brightness(0.92);
}

.chart__labels {
  display: flex;
  gap: 2px;
  margin-top: 0.35rem;
}

.chart__label {
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.55rem;
  text-align: center;
  white-space: nowrap;
}

.chart__legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.65rem;
  color: var(--text);
  font-size: 0.72rem;
}

.legend-swatch {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.35rem;
  border-radius: 2px;
  vertical-align: -1px;
}

.legend-swatch--income {
  background: var(--series-income);
}

.legend-swatch--expense {
  background: var(--series-expense);
}

.chart__readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}

.chart__readout strong {
  color: var(--ink);
  font-weight: 700;
}

.chart__readout-month {
  color: var(--ink);
}

.chart__last {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.chart__note {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.chart-table {
  margin-top: 0.75rem;
  font-size: 0.72rem;
}

.chart-table summary {
  color: var(--blue);
  font-weight: 700;
  cursor: pointer;
}

.chart-table__scroll {
  overflow-x: auto;
}

.chart-table table {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.chart-table th,
.chart-table td {
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.chart-table th:first-child,
.chart-table td:first-child {
  text-align: left;
}

.chart-table th {
  color: var(--muted);
  font-weight: 600;
}

.chips {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  padding: 0.4rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.chip--active {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

.chip--active:hover {
  color: #ffffff;
}

.category-columns {
  display: grid;
  gap: 0.75rem;
}

.category-columns h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.plain-list {
  gap: 0.4rem;
}

.plain-list li {
  color: var(--text);
  font-size: 0.86rem;
}

@media (min-width: 36rem) {
  .category-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.fab {
  position: fixed;
  right: max(1.15rem, calc((100vw - var(--content-w)) / 2 + 1.15rem));
  bottom: calc(5.2rem + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--blue);
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  font-family: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition:
    background-color 150ms ease,
    transform 150ms ease;
}

.fab:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 0.25rem;
  width: min(100%, var(--content-w));
  padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.15rem;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  cursor: pointer;
}

.bottom-nav__item svg {
  width: 1.3rem;
  height: 1.3rem;
}

.bottom-nav__item.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 50;
  width: min(100%, var(--content-w));
  max-height: min(88dvh, 44rem);
  padding: 0.75rem 1.15rem calc(1.15rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -24px 60px -24px rgba(15, 23, 42, 0.32);
  transform: translateX(-50%);
  animation: sheet-in 180ms ease-out;
}

.sheet::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 4px;
  margin: 0 auto 1rem;
  background: var(--line-strong);
  border-radius: 999px;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translate(-50%, 1rem);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 1rem));
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.sheet__head h2 {
  font-size: 1.05rem;
  font-weight: 800;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.action-button {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.action-button:hover {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.action-button span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

@media (min-width: 40rem) {
  .sheet {
    top: 50%;
    bottom: auto;
    width: min(100%, 420px);
    border-radius: var(--radius-lg);
    transform: translate(-50%, -50%);
    animation: dialog-in 160ms ease-out;
  }

  .sheet::before {
    display: none;
  }
}

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

.stock-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.stock-summary + .stock-summary {
  margin-top: 0.5rem;
}

.stock-summary__value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.catalog-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-card {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.catalog-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.catalog-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.catalog-card__name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
}

.catalog-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.9rem;
}

.catalog-metrics div {
  display: grid;
  gap: 0.05rem;
}

.catalog-metrics span {
  color: var(--muted);
  font-size: 0.65rem;
}

.catalog-metrics strong {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.catalog-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.preview-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  background: var(--blue-soft);
  border-radius: 12px;
}

.preview-box div {
  display: grid;
  gap: 0.05rem;
}

.preview-box div:last-child {
  grid-column: 1 / -1;
}

.preview-box span {
  color: #1e40af;
  font-size: 0.62rem;
}

.preview-box strong {
  color: #1e40af;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

[v-cloak] {
  display: none;
}
