:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e1ec;
  --line-strong: #c7d2e0;
  --brand: #0f766e;
  --brand-dark: #0b5f59;
  --blue: #2563eb;
  --good: #15803d;
  --warn: #b45309;
  --danger: #c2410c;
  --shadow: 0 18px 45px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, #e9f0f7 0, #f6f8fb 260px, #eef2f7 100%);
  color: var(--ink);
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15, 118, 110, .18); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
button.primary { background: var(--brand); font-weight: 700; }
button.secondary { background: #edf2f7; color: #263445; border: 1px solid var(--line); }
button.ghost { background: transparent; color: #475569; border: 1px solid var(--line); }
button.danger { background: var(--danger); }
button.full { width: 100%; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 24% 18%, rgba(15, 118, 110, .12), transparent 34%),
    linear-gradient(135deg, #f8fafc, #e7edf5);
}
.login-box {
  width: min(430px, 100%);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 30px;
}
.login-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  margin-bottom: 18px;
}
.login-box h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 0; }
.login-box p { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #101828;
  color: #e5edf7;
  padding: 16px 12px;
  border-right: 1px solid rgba(255,255,255,.08);
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  margin-bottom: 12px;
}
.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  font-weight: 800;
}
.side-brand strong { display: block; font-size: 16px; }
.side-brand span { display: block; margin-top: 3px; color: #94a3b8; font-size: 12px; }
.nav {
  display: grid;
  gap: 6px;
}
.nav button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  box-shadow: none;
}
.nav button span {
  width: 22px;
  color: #8fb5b1;
  text-align: center;
}
.nav button:hover,
.nav button.active {
  background: #1e293b;
  color: #fff;
  transform: none;
  box-shadow: none;
}
.nav button.active {
  border-left: 3px solid #2dd4bf;
}

.main { min-width: 0; }
.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}
.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #475569;
  white-space: nowrap;
}
.content {
  padding: 20px 24px 32px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.1;
}
.metric small {
  display: block;
  margin-top: 8px;
  color: #8592a3;
  line-height: 1.35;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .7fr);
  gap: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  padding: 16px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 {
  margin: 0;
  font-size: 17px;
}
.panel-head span {
  color: var(--muted);
  font-size: 13px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-grid button {
  min-height: 58px;
}

.dashboard-flow .table-wrap {
  max-height: 520px;
  overflow: auto;
}

.dashboard-flow thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.report-card {
  min-height: 300px;
}
.bar-list {
  display: grid;
  gap: 12px;
}
.bar-row {
  display: grid;
  gap: 6px;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #344054;
}
.bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-label strong {
  font-variant-numeric: tabular-nums;
}
.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}
.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2563eb);
}
.bar-track i.loss {
  background: linear-gradient(90deg, #dc2626, #f97316);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(260px, 360px) auto 170px auto 180px auto 140px;
  gap: 10px;
  align-items: center;
}

.filter-label {
  color: #526173;
  font-size: 13px;
  white-space: nowrap;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
}
.segmented button {
  background: transparent;
  color: #475569;
  border-radius: 6px;
  padding: 7px 12px;
  box-shadow: none;
}
.segmented button.active {
  background: var(--brand);
  color: white;
}

.status-quick-filter {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-quick-filter button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #edf2f7;
  color: #344054;
  border: 1px solid var(--line);
  box-shadow: none;
}

.status-quick-filter button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field label {
  color: #526173;
  font-size: 13px;
}
input, select, textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.scan-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.scan-input button {
  min-width: 64px;
}
textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.6;
}
.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.grid-form .wide { grid-column: 1 / -1; }
.entry-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.entry-layout.compact-entry {
  grid-template-columns: 180px minmax(0, 1fr);
}
.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-form.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-uploader {
  position: sticky;
  top: 110px;
  display: grid;
  gap: 10px;
}
.photo-preview,
.photo {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, #f8fafc, #eef2f7);
  overflow: hidden;
}
.photo-preview {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}
.photo-preview img,
.photo img,
.thumb img,
.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}
.product-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .05);
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 188px 460px;
}
.product-card .photo {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.card-body {
  padding: 12px;
  min-width: 0;
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.product-card h3 {
  margin: 10px 0;
  font-size: 16px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0 0 12px;
}
.product-card dt,
.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}
.product-card dd,
.detail-list dd {
  margin: 3px 0 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.actions button {
  padding: 7px 10px;
}

.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0f766e;
  box-shadow: none;
  font-weight: 700;
  text-align: left;
  justify-content: flex-start;
}

.link-button:hover {
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

.select-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.select-check input,
td input[type="checkbox"],
th input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

.batch-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.selected-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.selected-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.selected-item strong {
  font-size: 13px;
  line-height: 1.35;
}

.selected-item span {
  color: var(--muted);
  font-size: 12px;
}

.selection-dock {
  position: fixed;
  top: 86px;
  right: 18px;
  z-index: 30;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 120px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .45);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
  backdrop-filter: blur(12px);
}

.selection-dock.collapsed {
  width: auto;
  min-width: 190px;
}

.selection-dock-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.selection-dock-head strong {
  display: block;
  font-size: 15px;
}

.selection-dock-head span {
  color: var(--muted);
  font-size: 12px;
}

.selection-dock-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.selection-dock-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.selection-dock-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.selection-dock-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.selection-dock-actions {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
}

.action-picker {
  display: grid;
  gap: 22px;
  padding: 6px 2px 4px;
}

.action-product {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
}

.thumb.big {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.action-product h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.action-product p {
  margin: 0;
}

.action-picker-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.action-pick-btn {
  min-height: 48px;
  justify-content: center;
  font-size: 15px;
}

.success-modal {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px 8px 8px;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--good);
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(22, 163, 74, .18);
}

.success-modal h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.success-modal p {
  margin: 0 0 8px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1060px;
}
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #526173;
  font-weight: 700;
}
tbody tr:hover { background: #fbfdff; }
tr.clickable-row { cursor: pointer; }
tr.clickable-row:hover { background: #f0fdfa; }
tr:last-child td { border-bottom: 0; }
.compact th, .compact td { padding: 9px 10px; }
.name-cell {
  max-width: 360px;
  line-height: 1.45;
}
.thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #eef2f7;
  border: 1px solid var(--line);
  overflow: hidden;
}
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.badge.good { background: #dcfce7; color: var(--good); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.blue { background: #dbeafe; color: var(--blue); }
.badge.bad { background: #ffedd5; color: var(--danger); }
.badge.muted { background: #e5e7eb; color: #4b5563; }
.badge.prepaid {
  min-width: 58px;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
}

.import-panel {
  max-width: 920px;
}
.import-box {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 150px;
  padding: 18px;
  border: 1px dashed #9fb3c8;
  border-radius: 8px;
  background: #f8fafc;
}
.import-box p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .42);
  z-index: 40;
  padding: 18px;
}
.modal {
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
}
.detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}
.detail-photo {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--muted);
  overflow: hidden;
}
.detail-info h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.4;
}
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.detail-list div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}
.scanner-box {
  display: grid;
  gap: 12px;
}
.scanner-box video {
  width: 100%;
  max-height: 58vh;
  background: #0f172a;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  background: #101828;
  color: white;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 60;
}
.empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    padding: 10px;
  }
  .side-brand { padding-bottom: 10px; margin-bottom: 8px; }
  .nav {
    display: flex;
    overflow-x: auto;
  }
  .nav button {
    width: auto;
    white-space: nowrap;
  }
  .topbar {
    position: static;
    align-items: flex-start;
    padding: 16px;
  }
  .content { padding: 14px; }
  .entry-layout,
  .detail-layout,
  .operation-grid {
    grid-template-columns: 1fr;
  }
  .photo-uploader { position: static; }
  .filters { grid-template-columns: 1fr; width: 100%; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .import-box { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 13px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; }
  .userbar { width: 100%; justify-content: space-between; }
  .grid-form { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 96px minmax(0, 1fr); }
  .product-card dl { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; }
  .action-picker-buttons { grid-template-columns: 1fr; }
  .batch-layout { grid-template-columns: 1fr; }
  .selection-dock {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 55vh;
  }
  .selection-dock.collapsed {
    left: auto;
    width: min(220px, calc(100vw - 20px));
  }
  .selection-dock-actions { grid-template-columns: 1fr; }
}

/* Polished interface layer */
:root {
  --bg: #f3f6fb;
  --surface: rgba(255, 255, 255, .92);
  --line: #e3e9f2;
  --line-strong: #d5deeb;
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
  --soft-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

body {
  background:
    linear-gradient(140deg, rgba(13, 148, 136, .10), transparent 28%),
    linear-gradient(180deg, #f8fbff 0, #eef4fb 100%);
}

button,
input,
select,
textarea,
.panel,
.metric,
.product-card,
.table-wrap,
.import-box,
.login-box,
.photo-preview,
.photo,
.thumb,
.modal {
  border-radius: 16px;
}

button {
  min-height: 40px;
  box-shadow: 0 8px 18px rgba(13, 148, 136, .14);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(13, 148, 136, .18);
}

button:active {
  transform: translateY(0) scale(.98);
}

button.secondary,
button.ghost {
  box-shadow: none;
}

.sidebar {
  background: linear-gradient(180deg, #111827 0%, #172033 100%);
  padding: 18px 14px;
}

.brand-icon {
  border-radius: 14px;
  background: linear-gradient(135deg, #0d9488, #2563eb);
  box-shadow: 0 12px 26px rgba(13, 148, 136, .22);
}

.nav button {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav button::before {
  content: "";
  position: absolute;
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background .18s ease, transform .18s ease;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, .10);
}

.nav button.active {
  border-left: 0;
}

.nav button.active::before {
  background: #2dd4bf;
  transform: translateX(4px);
}

.topbar {
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 28px rgba(15, 23, 42, .04);
}

.content {
  animation: pageFlow .32s ease both;
}

.panel,
.metric,
.product-card {
  box-shadow: var(--soft-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.panel:hover,
.metric:hover,
.product-card:hover {
  border-color: #cdd8e7;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

.product-card:hover {
  transform: translateY(-2px);
}

.segmented {
  border-radius: 14px;
  padding: 4px;
  background: #eef4f8;
}

.segmented button {
  border-radius: 11px;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, .95);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, .12);
}

.toast {
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}

.modal-backdrop {
  backdrop-filter: blur(8px);
}

.modal {
  animation: modalFlow .22s ease both;
}

@keyframes pageFlow {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFlow {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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