:root {
  --navy: #071a3a;
  --navy-2: #0d2b63;
  --blue: #2563eb;
  --ink: #101828;
  --muted: #667085;
  --line: #e4eaf4;
  --bg: #f4f7fc;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #f04438;
  --shadow: 0 10px 30px rgba(16, 24, 40, .07);
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --side: 248px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink); background: var(--bg);
  font-family: var(--font);
  font-optical-sizing: auto;
  letter-spacing: -.01em;
}
h1, h2, h3, .kpi, .dash-hero h1, .dash-hero-stat strong {
  font-family: var(--display);
  font-optical-sizing: auto;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; height: auto; }

.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 480px at 12% -8%, #3b82f6 0%, transparent 50%),
              linear-gradient(160deg, #071433, #12357a 55%, #1d4ed8);
}
.login-art { position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.2' fill='white' opacity='.12'/%3E%3C/svg%3E");
}
.login-card {
  position: relative; width: min(420px, 100%); background: #fff;
  border-radius: 24px; padding: clamp(22px, 5vw, 36px) clamp(18px, 4vw, 30px) 24px;
  text-align: center; box-shadow: 0 40px 90px rgba(0,0,0,.28);
}
.login-logo { width: min(196px, 70%); }
.login-kicker { color: var(--ok); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; }
.login-card h1 { margin: 4px 0 0; font-size: clamp(26px, 5vw, 32px); letter-spacing: -.03em; }
.login-sub { color: var(--muted); margin: 6px 0 18px; }
.login-card form { display: grid; gap: 14px; text-align: left; }
.login-card label, .form-grid label, .field-wrap {
  display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.field, .login-card input, .toolbar input, .toolbar select, .form-grid input, .form-grid select, .form-grid textarea, .card input, .card select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: #fbfcfe; color: var(--ink); outline: none;
  transition: border .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.field:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}
.login-foot { color: var(--muted); font-size: 12px; margin-top: 18px; }

.app-body { display: flex; min-height: 100vh; min-height: 100dvh; }
.scrim {
  display: none; position: fixed; inset: 0; background: rgba(7, 20, 51, .42);
  z-index: 28; opacity: 0; transition: opacity .3s var(--ease);
}
.sidebar {
  width: var(--side); flex: 0 0 var(--side);
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #d7e4ff; display: flex; flex-direction: column; padding: 16px 12px;
  transition: transform .4s var(--ease), width .4s var(--ease), flex-basis .4s var(--ease), padding .3s var(--ease);
}
.brand img { width: 158px; display: block; margin: 2px auto 18px; }
.erp-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: rgba(255,255,255,.08); border-radius: 12px; padding: 4px; margin-bottom: 10px;
}
.erp-switch button {
  border: 0; background: transparent; color: #c5d4f5; border-radius: 9px;
  padding: 8px 6px; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer;
}
.erp-switch button.on { background: #fff; color: var(--navy); }
.erp-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #9fb4de; margin: 0 8px 10px;
}
.erp-auto .sidebar { background: linear-gradient(180deg, #1a1207, #3d2a12); }
.erp-auto .nav-link.active { color: #3d2a12; }
.erp-super .sidebar { background: linear-gradient(180deg, #0b1020, #1c2744); }
.super-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.super-card h3 { margin: 6px 0 4px; }
.btn.hidden { display: none !important; }
.sidebar nav { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.nav-link {
  width: 100%; border: 0; background: transparent; color: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-align: left;
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease);
}
.nav-link.active { background: #fff; color: var(--navy); font-weight: 700; }
.nav-link .ico, .nav-group summary .ico { width: 22px; text-align: center; flex: 0 0 22px; }
.nav-group { border-radius: 12px; }
.nav-group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; color: #c5d4f5; font-weight: 700;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary .nav-label { flex: 1; }
.nav-group .chev {
  margin-left: auto; font-size: 11px; opacity: .7; transition: transform .22s var(--ease);
}
.nav-group[open] > summary { color: #fff; background: rgba(255,255,255,.08); }
.nav-group[open] .chev { transform: rotate(180deg); }
.nav-group.on > summary { color: #fff; }
.nav-sub { display: grid; gap: 2px; padding: 4px 0 8px; }
.nav-sub .nav-link { padding: 8px 12px 8px 42px; font-size: 13px; color: #b7c8ea; }
.nav-sub .nav-link.active { color: var(--navy); }
.logout-form { margin-top: auto; }
.nav-link.danger { color: #ffb4b4; }
.shell { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 12px clamp(12px, 2vw, 22px);
  background: rgba(255,255,255,.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.icon-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 8px 11px; cursor: pointer; min-width: 42px; min-height: 42px;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.search-wrap, .topbar-spacer { flex: 1; min-width: 0; }
.btn {
  border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer; font-weight: 700;
  background: #e8eef8; color: var(--navy);
  transition: transform .2s var(--ease), filter .2s var(--ease), box-shadow .2s var(--ease);
}
.btn.primary { background: linear-gradient(180deg, #3b82f6, var(--blue)); color: #fff; box-shadow: 0 8px 18px rgba(37,99,235,.22); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.full { width: 100%; }
.btn.lg { padding: 13px 16px; font-size: 16px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.sell { padding: 11px 18px; white-space: nowrap; }
.who { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.3; white-space: nowrap; }
.content { padding: clamp(14px, 2.5vw, 24px) clamp(12px, 2.4vw, 24px) 48px; overflow: auto; }
.page-title {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.page-title h2 {
  margin: 0; font-size: clamp(26px, 4.4vw, 34px); letter-spacing: -.04em; font-weight: 700; line-height: 1.1;
}
.hint { color: var(--muted); margin: 4px 0 0; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.cards-4, .cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(14px, 2vw, 18px); box-shadow: var(--shadow);
  animation: rise .45s var(--ease);
}
.kpi {
  font-size: clamp(28px, 5vw, 36px); font-weight: 700; color: var(--navy); letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.hero-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 8px 0 18px; }
.hero {
  display: flex; flex-direction: column; gap: 8px; min-height: 108px; justify-content: center;
  border: 0; color: #fff; padding: 18px; border-radius: 18px;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.hero b { font-size: 17px; }
.hero span { opacity: .88; font-size: 13px; }
.h-sell { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.h-in { background: linear-gradient(135deg, #12b76a, #039855); }
.h-out { background: linear-gradient(135deg, #f79009, #dc6803); }
.h-buy { background: linear-gradient(135deg, #7a5af8, #5925dc); }
.h-cash { background: linear-gradient(135deg, #0ea5e9, #026aa2); }

.dash { display: grid; gap: 18px; }
.dash-hero {
  display: grid; gap: 0; align-items: start;
  position: relative; overflow: hidden; color: #fff;
  border-radius: 28px; padding: clamp(22px, 3.5vw, 36px); min-width: 0;
  background:
    radial-gradient(720px 320px at 108% -10%, rgba(96,165,250,.5), transparent 58%),
    radial-gradient(420px 220px at 0% 120%, rgba(14,165,233,.28), transparent 50%),
    linear-gradient(145deg, #061228 0%, #0c2d6b 52%, #1d4ed8 130%);
  box-shadow: 0 24px 50px rgba(7, 26, 58, .22);
}
.dash-hero::after {
  content: ""; position: absolute; inset: auto -20% -40% 40%; height: 160%;
  background: repeating-linear-gradient(-18deg, transparent, transparent 18px, rgba(255,255,255,.04) 18px, rgba(255,255,255,.04) 19px);
  pointer-events: none;
}
.dash-kicker {
  margin: 0; text-transform: capitalize; letter-spacing: .12em;
  font-size: 11px; font-weight: 800; color: #9ec0ff;
}
.dash-hero h1 {
  margin: 8px 0 6px; font-size: clamp(40px, 7vw, 64px); font-weight: 700;
  letter-spacing: -.045em; line-height: .92; color: #fff;
}
.dash-lead { margin: 0 0 18px; max-width: 34ch; color: #d7e4ff; font-size: 16px; font-weight: 500; line-height: 1.45; }
.dash-cta { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.btn.dash-sell {
  background: #fff; color: var(--navy); padding: 13px 22px; font-size: 15px;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.btn.dash-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.dash-hero-top {
  display: flex; justify-content: flex-start; align-items: center; gap: 12px; flex-wrap: wrap;
  position: relative; z-index: 1; margin-bottom: 8px;
}
.dash-pill {
  padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16);
}
.dash-pill.ok { background: #e7f8ee; color: #067647; border: 0; }
.dash-pill.warn { background: #fffaeb; color: #b54708; border: 0; }
.dash-hero-stat {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; border-radius: 14px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
}
.dash-hero-stat span { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #9ec0ff; }
.dash-hero-stat strong {
  font-size: clamp(22px, 3vw, 28px); font-weight: 700; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.dash-hero-stat small { color: #c7d7ff; font-size: 13px; font-weight: 600; }
.dash-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px;
}
.dash-metric {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px;
  box-shadow: var(--shadow); display: grid; gap: 4px; min-width: 0;
  animation: rise .5s var(--ease) both;
}
.dash-metric:nth-child(2) { animation-delay: .05s; }
.dash-metric:nth-child(3) { animation-delay: .1s; }
.dash-metric:nth-child(4) { animation-delay: .15s; }
.dash-metric label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dash-metric b {
  font-family: var(--display); font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.04em; color: var(--navy);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.dash-metric span { color: var(--muted); font-size: 13px; font-weight: 600; }
.dash-metric.warn b { color: #b54708; }
.dash-metric.ok b { color: #067647; }
.dash-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.dash-go {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 18px; color: #fff; min-height: 92px; justify-content: center;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.dash-go b { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.dash-go span { font-size: 12px; opacity: .88; font-weight: 600; }
.dash-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.dash-panel {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 8px 6px 10px;
  box-shadow: var(--shadow); min-width: 0;
}
.dash-panel h3 {
  margin: 8px 12px 10px; font-size: 18px; font-weight: 700; letter-spacing: -.03em;
}
.dash-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
}
.dash-row:hover { background: #f6f9ff; }
.dash-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.dash-row em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--blue); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }
.dash-empty { padding: 18px 14px; color: var(--muted); font-weight: 600; }
.detail-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; margin-bottom: 18px;
}
.detail-fact {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0;
}
.detail-fact span {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.detail-fact b { font-size: 16px; font-weight: 800; word-break: break-word; }
.detail-section { margin-top: 8px; }
.detail-section h3 { font-size: 20px; margin: 8px 0 10px; letter-spacing: -.03em; }
.page-title a.muted { display: inline-block; margin-bottom: 6px; font-weight: 700; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar > * { flex: 1 1 160px; min-width: 0; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f7f9fd; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions .btn { padding: 8px 10px; font-size: 12px; }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tag.ok { background: #e7f8ee; color: #067647; }
.tag.warn { background: #fffaeb; color: #b54708; }
.tag.danger { background: #fee4e2; color: #b42318; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.alert { padding: 12px 14px; border-radius: 12px; background: #eef4ff; margin: 10px 0; }
.alert.error { background: #fee4e2; color: #b42318; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.modal {
  position: fixed; inset: 0; background: rgba(7,20,51,.48); display: grid; place-items: end center;
  z-index: 40; padding: 12px; animation: fade .25s var(--ease);
}
.modal .sheet {
  width: min(760px, 100%); max-height: min(92vh, 92dvh); overflow: auto; background: #fff;
  border-radius: 20px 20px 16px 16px; padding: 22px 18px 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: rise .4s var(--ease);
}
.hidden { display: none !important; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 16px; width: auto; max-width: 420px; margin: 0 auto;
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; z-index: 50;
  animation: rise .28s var(--ease);
}
.palette {
  position: fixed; inset: 0; background: rgba(7,20,51,.45); display: grid; place-items: start center;
  padding: 10vh 12px 12px; z-index: 55;
}
.palette .sheet { width: min(560px, 100%); }
.loader {
  position: fixed; inset: 0; background: rgba(244,247,252,.45); display: grid; place-items: center;
  z-index: 25; backdrop-filter: blur(4px); pointer-events: none;
}
.loader p { margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid #dbe7ff; border-top-color: var(--blue);
  animation: spin .75s linear infinite;
}
.collapsed .sidebar { width: 0; flex-basis: 0; padding: 0; overflow: hidden; }
.pos { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .72fr); gap: 14px; align-items: start; }
.pos-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.pos-head h2 { margin: 0; }
.pos-main { padding: 14px; }
.scan-box { position: relative; margin-bottom: 8px; }
.scan-box .scan {
  font-size: 18px; padding: 16px 16px; font-weight: 600;
  background: #f3f6fb; border: 1.5px solid #c9d6ee;
}
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 8;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(7,20,51,.14); max-height: 280px; overflow: auto;
}
.suggest button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; text-align: left; cursor: pointer;
}
.suggest button:last-child { border-bottom: 0; }
.suggest b { display: block; }
.suggest small, .suggest em { color: var(--muted); font-style: normal; }
.cart { min-height: 180px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-info { display: grid; gap: 2px; }
.cart-info span { color: var(--muted); font-size: 13px; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: #f7f9fd; font-size: 18px; cursor: pointer;
}
.qty input { width: 48px; text-align: center; padding: 6px 4px; border-radius: 10px; }
.btn.sm { padding: 6px 9px; min-width: 36px; }
.pay-box {
  background: linear-gradient(180deg, #f8fbff, #fff); position: sticky; top: 76px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.pay-ops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 8px; font-weight: 700; cursor: pointer;
}
.pay-chip.on { background: #0b2a5b; color: #fff; border-color: #0b2a5b; }
.pay-total {
  display: flex; flex-direction: column; gap: 2px;
  padding-top: 10px; border-top: 1px solid var(--line); min-width: 0;
}
.pay-total strong {
  font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.03em; line-height: 1.1; color: var(--navy);
  white-space: nowrap;
}
#btn-fin { flex-shrink: 0; }
#btn-fin small { opacity: .75; font-weight: 600; margin-left: 6px; }
.stock-low td { background: #fff7ed; }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--blue); font-weight: 700; }

@media (hover: hover) {
  .nav-link:hover, .nav-group summary:hover { background: rgba(255,255,255,.1); }
  .btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
  .hero:hover, .dash-go:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(7,20,51,.16); }
  .dash-metric:hover { transform: translateY(-2px); }
  .icon-btn:hover { background: #f7f9fd; }
  tr:hover td { background: #f8fbff; }
}

@media (max-width: 1100px) {
  .who { display: none; }
}

@media (max-width: 960px) {
  .scrim { display: block; pointer-events: none; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; height: 100%; height: 100dvh;
    width: min(280px, 86vw); flex-basis: auto; z-index: 30;
    transform: translateX(-105%); box-shadow: 12px 0 40px rgba(7,20,51,.18);
  }
  .nav-open .sidebar { transform: translateX(0); }
  .collapsed .sidebar { width: min(280px, 86vw); padding: 16px 12px; }
  .pos { grid-template-columns: 1fr; }
  .pay-box { position: static; }
  .cart-line { grid-template-columns: minmax(0, 1fr) auto; }
  .cart-line .qty { grid-column: 1; }
  .content { padding-bottom: 80px; }
  .dash-metrics, .dash-shortcuts, .dash-boards { grid-template-columns: 1fr 1fr; }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero-stat { margin-left: 0; }
}

@media (max-width: 720px) {
  .topbar { padding: 10px 12px; }
  .btn.sell { padding: 10px 12px; }
  .hero { min-height: 96px; }
  .dash-metrics, .dash-shortcuts, .dash-boards { grid-template-columns: 1fr; }
  .dash-hero h1 { font-size: 40px; }
  thead { display: none; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr {
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    margin-bottom: 10px; padding: 6px 4px; box-shadow: var(--shadow);
  }
  td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border: 0; padding: 10px 12px;
  }
  td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; flex: 0 0 38%;
  }
  td:last-child { justify-content: flex-end; }
  td:last-child::before { content: none; }
  .stock-low { background: #fff7ed; }
  .modal { place-items: end stretch; padding: 0; }
  .modal .sheet { width: 100%; border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .toast { bottom: 12px; }
}

@media print {
  .sidebar, .topbar, .scrim, .loader, .toast, .row-actions, .btn { display: none !important; }
  .app-body { display: block; background: #fff; }
  .content { padding: 0; overflow: visible; }
}

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

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-in { animation: rise .5s var(--ease); }
