/* ============================================================
   FyraTienda — tokens y componentes
   Paleta: lime #D5F400 · grafito #25262B · perla #F1F2F4
   ============================================================ */

:root {
  --canvas: #f1f2f4;
  --surface: #ffffff;
  --subtle: #f7f8f9;
  --ink: #25262b;
  --muted: #62656f;
  --border: #e2e3e7;
  --card-ink: #25262b;
  --on-card: #ffffff;
  --on-card-muted: #b8bbc4;
  --on-lime: #25262b;
  --lime: #d5f400;
  --lime-pressed: #c6e300;
  --lime-soft: #f5ffd6;
  --success: #147d50;
  --success-soft: #e7f6eb;
  --warning: #9a6700;
  --warning-soft: #fff4cc;
  --danger: #b42318;
  --disabled-bg: #e2e3e7;
  --disabled-fg: #858892;
  --focus-ring: #25262b;
  --radius-sm: 12px;
  --radius: 14px;
  --radius-lg: 16px;
  --shadow: 0 12px 28px rgba(37, 38, 43, 0.07);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(213, 244, 0, 0.13), transparent 25rem),
    var(--canvas);
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  line-height: 1.45;
}

body.sheet-open { overflow: hidden; }

::selection { background: var(--lime); color: var(--on-lime); }

button, input { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }

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

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 6vw, 40px); letter-spacing: -0.045em; line-height: 1.05; }
h2 { font-size: 19px; letter-spacing: -0.03em; }
.muted { color: var(--muted); font-size: 13.5px; }
.caption { color: var(--muted); font-size: 12px; }
.caption.light { color: var(--on-card-muted); }
.numeric { font-variant-numeric: tabular-nums; }
.icon { display: block; flex: 0 0 auto; }

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; padding-bottom: 88px; }
body.focus-mode .app-shell { padding-bottom: 0; }

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 760px;
  padding: 20px 22px 10px;
}
.brand { align-items: center; display: inline-flex; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -0.045em; }
.brand span span { font-weight: 500; }
.brand img { height: 34px; object-fit: contain; width: 34px; }
.topbar-actions { align-items: center; display: flex; gap: 10px; }

.icon-button, .profile-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-button:hover { background: var(--subtle); color: var(--ink); }
.icon-button.small { height: 34px; width: 34px; }
.profile-button { background: var(--card-ink); border: 0; color: var(--lime); font-size: 12px; font-weight: 800; }

.view-container {
  margin: 0 auto;
  max-width: 760px;
  padding: 8px 22px 34px;
}
body.focus-mode .view-container { padding-bottom: 190px; }

/* ---------- home ---------- */
.hero { display: flex; gap: 18px; justify-content: space-between; padding: 22px 0 24px; }
.hero-copy { display: grid; gap: 8px; }
.hero-copy p:not(.eyebrow) { color: var(--muted); font-size: 14px; max-width: 370px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
.eyebrow::first-letter { text-transform: uppercase; }
.status-pill {
  align-items: center;
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 7px;
  padding: 8px 11px;
  white-space: nowrap;
}
.status-pill::before { background: var(--lime); border-radius: 50%; content: ""; height: 7px; width: 7px; }

.snapshot {
  background: var(--card-ink);
  border-radius: var(--radius-lg);
  color: var(--on-card);
  display: grid;
  gap: 20px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}
.snapshot::after {
  background: var(--lime);
  border-radius: 50%;
  content: "";
  height: 190px;
  opacity: 0.14;
  position: absolute;
  right: -72px;
  top: -90px;
  width: 190px;
}
.snapshot-top { align-items: center; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.snapshot-top span { color: var(--on-card-muted); font-size: 12px; }
.snapshot-top strong { font-size: 12px; font-weight: 600; }
.metrics { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); position: relative; z-index: 1; }
.metric { display: grid; gap: 5px; }
.metric + .metric { border-left: 1px solid rgba(255, 255, 255, 0.13); padding-left: 13px; }
.metric small { color: var(--on-card-muted); font-size: 11px; }
.metric strong { font-size: clamp(17px, 4.6vw, 25px); letter-spacing: -0.045em; }
.metric:last-child strong { color: var(--lime); }

.section-heading { align-items: end; display: flex; gap: 12px; justify-content: space-between; margin: 28px 0 13px; }
.section-heading a { color: var(--muted); font-size: 12px; font-weight: 700; }
.section-heading h2 { font-size: 18px; }

.module-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.module-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 16px;
  min-height: 138px;
  padding: 18px;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.module-tile:hover, .module-tile:focus-visible { border-color: var(--ink); box-shadow: var(--shadow); outline: none; transform: translateY(-2px); }
.module-tile:active { transform: translateY(0) scale(0.995); }
.module-tile.primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.tile-icon { align-items: center; background: var(--subtle); border-radius: 12px; color: var(--ink); display: inline-flex; height: 42px; justify-content: center; width: 42px; }
.primary .tile-icon { background: rgba(37, 38, 43, 0.12); color: var(--on-lime); }
.module-tile strong { display: block; font-size: 16px; margin-bottom: 4px; }
.module-tile small { color: var(--muted); font-size: 12px; }
.primary small { color: rgba(37, 38, 43, 0.72); }

.alert-card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.alert-card { align-items: center; display: flex; gap: 12px; margin-top: 12px; padding: 15px; }
.alert-card strong { display: block; font-size: 13px; }
.alert-card p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.alert-mark { align-items: center; background: var(--warning-soft); border-radius: 10px; color: var(--warning); display: flex; flex: 0 0 36px; height: 36px; justify-content: center; width: 36px; }
.alert-mark.ok { background: var(--lime-soft); color: var(--ink); }

/* ---------- shared ---------- */
.screen-header { align-items: end; display: flex; gap: 16px; justify-content: space-between; padding: 24px 0 20px; }
.screen-header > div { display: grid; gap: 7px; min-width: 0; }
.back-link { align-items: center; color: var(--muted); display: inline-flex; font-size: 13px; font-weight: 700; gap: 5px; }
.back-link:hover { color: var(--ink); }

.primary-button, .secondary-button {
  align-items: center;
  border-radius: var(--radius);
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  gap: 6px;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.primary-button { background: var(--lime); border: 1px solid var(--lime); color: var(--on-lime); }
.primary-button:hover { background: var(--lime-pressed); border-color: var(--lime-pressed); }
.primary-button:active { transform: scale(0.99); }
.primary-button:disabled { background: var(--disabled-bg); border-color: var(--border); color: var(--disabled-fg); }
.secondary-button { background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.secondary-button:hover { border-color: var(--ink); }
.secondary-button:disabled { color: var(--disabled-fg); }
.full { width: 100%; }
.spaced { margin-top: 10px; }
.text-button { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 800; padding: 6px 0; }
.text-button:hover { color: var(--ink); }

.search-field { position: relative; margin-bottom: 14px; }
.search-field .icon { color: var(--muted); left: 14px; position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-field .search { padding-left: 42px; }

.search {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  min-height: 46px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}
.search::placeholder { color: var(--muted); }
.search:focus { border-color: var(--ink); }
.search:disabled { opacity: 0.5; }

.empty { color: var(--muted); font-size: 13px; padding: 14px 2px; }
.empty.wide { grid-column: 1 / -1; }

.list { display: grid; gap: 10px; }
.list-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px;
}
.row-leading { align-items: center; display: flex; gap: 12px; min-width: 0; }
.avatar {
  align-items: center;
  background: var(--lime-soft);
  border-radius: 11px;
  color: var(--on-lime);
  display: flex;
  flex: 0 0 40px;
  font-size: 12px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 40px;
}
.row-copy { min-width: 0; }
.row-copy strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-copy small { color: var(--muted); display: block; font-size: 12px; margin-top: 3px; }
.row-value { text-align: right; }
.row-value strong { display: block; font-size: 15px; }
.row-value small { font-size: 11px; font-weight: 700; }
.tag { border-radius: 999px; display: inline-flex; font-size: 11px; font-weight: 800; padding: 4px 8px; }
.tag.success { background: var(--success-soft); color: var(--success); }
.tag.warning { background: var(--warning-soft); color: var(--warning); }
.tag.neutral { background: var(--subtle); color: var(--muted); }

/* ---------- dinero ---------- */
.money-card {
  background: var(--card-ink);
  border-radius: var(--radius-lg);
  color: var(--on-card);
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 22px;
}
.money-card small { color: var(--on-card-muted); font-size: 12px; }
.money-card strong { font-size: 33px; letter-spacing: -0.05em; }
.account-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.account { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 5px; padding: 14px; }
.account small { color: var(--muted); font-size: 11px; }
.account strong { font-size: 15px; }
.account .dot { background: var(--lime); border-radius: 50%; height: 7px; width: 7px; }

/* ---------- vender ---------- */
.amount-row {
  align-items: center;
  background: var(--card-ink);
  border: 1px solid var(--card-ink);
  border-radius: var(--radius-lg);
  color: var(--on-card);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
  min-height: 74px;
  padding: 14px 18px;
  text-align: left;
  transition: transform 0.12s var(--ease);
  width: 100%;
}
.amount-row:active { transform: scale(0.995); }
.amount-row-copy { display: grid; gap: 3px; }
.amount-row-copy small { color: var(--on-card-muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; }
.amount-row-copy strong { font-size: 24px; letter-spacing: -0.04em; }
.amount-row-hint { align-items: center; color: var(--lime); display: inline-flex; font-size: 12px; font-weight: 800; gap: 5px; }

.quick-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  min-height: 104px;
  padding: 13px;
  text-align: left;
  transition: border-color 0.15s var(--ease), transform 0.12s var(--ease), box-shadow 0.15s var(--ease);
}
.quick-card.in-cart { border-color: var(--lime); }
.in-cart-badge {
  background: var(--lime);
  border-radius: 999px;
  color: var(--on-lime);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  padding: 3px 8px;
}
.quick-card:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.quick-card:active { transform: scale(0.985); }
.quick-card:disabled { opacity: 0.5; }
.quick-name {
  display: -webkit-box;
  font-size: 13px;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  overflow: hidden;
}
.quick-meta { display: grid; gap: 6px; justify-items: start; }
.quick-meta strong { font-size: 14px; }

.cart { display: grid; gap: 9px; }
.cart-line { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 8px; padding: 13px 14px; }
.cart-top { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; }
.cart-top strong { font-size: 13.5px; }
.cart-top strong:last-child { font-size: 14px; }
.cart-bottom { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.cart-bottom small { color: var(--muted); font-size: 11.5px; }
.free-actions { align-items: center; display: flex; gap: 6px; }

.stepper { align-items: center; background: var(--subtle); border: 1px solid var(--border); border-radius: 999px; display: inline-flex; gap: 2px; padding: 2px; }
.stepper button { align-items: center; border-radius: 50%; color: var(--ink); display: flex; height: 30px; justify-content: center; width: 30px; }
.stepper button:hover { background: var(--surface); }
.stepper span { font-size: 13px; font-weight: 800; min-width: 22px; text-align: center; }

/* ---------- dock ---------- */
.sale-dock {
  background: var(--surface);
  border-top: 1px solid var(--border);
  bottom: 0;
  box-shadow: 0 -8px 24px rgba(37, 38, 43, 0.06);
  left: 0;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 15;
}
.sale-dock-inner { display: grid; gap: 10px; margin: 0 auto; max-width: 760px; }
.dock-row { align-items: center; display: flex; gap: 14px; justify-content: space-between; }
.dock-modality { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
.dock-chips { align-items: center; display: flex; gap: 6px; }
.dock-count { color: var(--muted); font-size: 11px; font-weight: 700; }
.dock-hint { color: var(--muted); font-size: 11.5px; }
.modality {
  align-self: start;
  justify-self: start;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
}
.dock-total { display: grid; flex: 0 0 auto; gap: 1px; text-align: right; }
.dock-total small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.dock-total strong { font-size: 21px; letter-spacing: -0.04em; white-space: nowrap; }
.dock-note { color: var(--muted); font-size: 11.5px; text-align: center; }

body.focus-mode .bottom-nav { display: none; }
body.focus-mode .toast { bottom: 168px; }

/* ---------- cobrar ---------- */
.pay-card { background: var(--card-ink); border-radius: var(--radius-lg); color: var(--on-card); display: grid; gap: 5px; margin-bottom: 16px; padding: 22px; }
.pay-card > small { color: var(--on-card-muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pay-card > strong { font-size: 34px; letter-spacing: -0.05em; }
.pay-pending { align-items: baseline; border-top: 1px solid rgba(255, 255, 255, 0.14); display: flex; justify-content: space-between; margin-top: 12px; padding-top: 13px; }
.pay-pending span { color: var(--on-card-muted); font-size: 12px; }
.pay-pending strong { color: var(--lime); font-size: 19px; letter-spacing: -0.03em; }

.method-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.pay-row {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
  min-height: 62px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}
.pay-row:hover { border-color: var(--ink); }
.pay-row:disabled { opacity: 0.55; }
.pay-row-copy { display: grid; gap: 2px; }
.pay-row-copy strong { font-size: 13.5px; }
.pay-row-copy small { color: var(--muted); font-size: 11.5px; }
.pay-row-action { align-items: center; background: var(--lime); border-radius: 50%; color: var(--on-lime); display: flex; height: 34px; justify-content: center; width: 34px; }

.fiado-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 12px; margin-top: 18px; padding: 16px; }
.fiado-head { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.fiado-head strong { display: block; font-size: 14px; }
.fiado-head small { color: var(--muted); display: block; font-size: 11.5px; margin-top: 3px; }
.fiado-client { align-items: center; background: var(--subtle); border-radius: var(--radius-sm); display: flex; gap: 10px; padding: 10px; }
.fiado-client strong { display: block; font-size: 13px; }
.fiado-client small { color: var(--muted); font-size: 11.5px; }

/* ---------- confirmación ---------- */
.done-hero { display: grid; gap: 8px; justify-items: start; padding: 42px 0 24px; }
.done-check { align-items: center; background: var(--lime); border-radius: 50%; color: var(--on-lime); display: flex; height: 52px; justify-content: center; margin-bottom: 6px; width: 52px; }
.receipt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); display: grid; gap: 2px; margin-bottom: 18px; padding: 18px; }
.receipt-row { align-items: baseline; display: flex; gap: 12px; justify-content: space-between; padding: 7px 0; }
.receipt-row span { color: var(--muted); font-size: 13px; }
.receipt-row strong { font-size: 16px; }
.receipt-row.quiet span, .receipt-row.quiet .numeric { color: var(--muted); font-size: 12.5px; }
.receipt-note { border-top: 1px solid var(--border); display: grid; gap: 3px; margin-top: 10px; padding-top: 12px; }
.receipt-note strong { font-size: 12px; }
.receipt-note span { color: var(--muted); font-size: 12px; }

/* ---------- hojas ---------- */
.sheet-overlay {
  align-items: flex-end;
  background: rgba(18, 19, 22, 0.5);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 40;
  animation: overlay-in 0.2s var(--ease);
}
.sheet {
  animation: sheet-in 0.26s var(--ease);
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 48px rgba(18, 19, 22, 0.24);
  display: grid;
  gap: 16px;
  max-height: 92vh;
  max-width: 760px;
  overflow: auto;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
}
.sheet-handle { background: var(--border); border-radius: 999px; height: 4px; margin: 0 auto 2px; width: 42px; }
.sheet-head { align-items: start; display: flex; gap: 14px; justify-content: space-between; }
.sheet-head strong { display: block; font-size: 16px; }
.sheet-head p { margin-top: 3px; }
.sheet-display { font-size: 44px; font-weight: 800; letter-spacing: -0.05em; text-align: right; }
.keypad { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.keypad button {
  align-items: center;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  display: flex;
  font-size: 21px;
  font-weight: 700;
  justify-content: center;
  min-height: 54px;
  transition: background 0.12s var(--ease);
}
.keypad button:hover { background: var(--lime-soft); }
.keypad button:active { background: var(--lime); }
.sheet-actions { display: grid; gap: 10px; grid-template-columns: 1fr 1.4fr; }
.sheet-list { max-height: 46vh; overflow: auto; }
.client-option { cursor: pointer; text-align: left; width: 100%; }
.client-option:hover { border-color: var(--ink); }
.inline-form { display: flex; gap: 8px; }
.inline-form .search { flex: 1; }

.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field span { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.field-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.check { align-items: center; color: var(--muted); display: flex; font-size: 12.5px; gap: 9px; }
.check input { accent-color: var(--lime); height: 18px; width: 18px; }
.field-error { color: var(--danger); font-size: 12px; font-weight: 600; min-height: 16px; }

@keyframes sheet-in {
  from { opacity: 0.4; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- nav y toast ---------- */
.bottom-nav {
  align-items: center;
  background: var(--surface);
  border-top: 1px solid var(--border);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 10;
}
.nav-item { align-items: center; color: var(--muted); display: grid; flex: 1; gap: 3px; justify-items: center; max-width: 110px; padding: 4px 0; }
.nav-item small { font-size: 11px; font-weight: 700; }
.nav-item.active { color: var(--ink); }
.nav-item.active .icon { color: var(--success); }

.toast {
  background: var(--card-ink);
  border-radius: 12px;
  bottom: 84px;
  color: var(--on-card);
  font-size: 13px;
  left: 50%;
  max-width: calc(100% - 44px);
  opacity: 0;
  padding: 12px 15px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tema oscuro ---------- */
body.dark {
  color-scheme: dark;
  --canvas: #121316;
  --surface: #1b1c20;
  --subtle: #25262b;
  --ink: #f5f6f8;
  --muted: #b8bbc4;
  --border: #3a3c43;
  --lime-soft: #343a20;
  --success: #6ee7a8;
  --success-soft: #10301f;
  --warning: #ffd66b;
  --warning-soft: #3a2f00;
  --disabled-bg: #393b41;
  --disabled-fg: #9498a2;
  --focus-ring: #d5f400;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
body.dark .avatar { color: var(--lime); }
body.dark .alert-mark.ok { background: var(--lime-soft); color: var(--lime); }
body.dark .profile-button { background: var(--lime); color: var(--on-lime); }
body.dark .chip[aria-pressed="true"] { color: var(--canvas); }
body.dark .snapshot::after { opacity: 0.1; }

/* ---------- responsive ---------- */
@media (min-width: 560px) {
  .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-grid { gap: 14px; }
}
@media (min-width: 700px) {
  .view-container { padding-top: 16px; }
  .sale-dock { border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 18px 18px 0 0; left: 50%; right: auto; transform: translateX(-50%); width: min(760px, 100%); }
  .sheet { border-radius: 24px 24px 0 0; }
}
@media (max-width: 420px) {
  .metrics { gap: 8px; }
  .metric + .metric { padding-left: 8px; }
  .metric strong { font-size: 16px; }
  .account { padding: 12px; }
  .account strong { font-size: 13.5px; }
  .section-heading { align-items: baseline; }
  .sheet-display { font-size: 38px; }
  .field-row { grid-template-columns: 1fr; }
}

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