:root {
  --ink: #173e32;
  --ink-deep: #0f2c23;
  --ink-soft: #2b5948;
  --paper: #f5f1e7;
  --card: #fffdf8;
  --line: rgba(23, 62, 50, 0.1);
  --line-soft: rgba(23, 62, 50, 0.06);
  --muted: #8a8c83;
  --muted-light: #aaa69a;
  --accent: #d85b36;
  --accent-soft: #fae7de;
  --gold: #c39a5a;
  --gold-soft: #f7eddc;
  --green-soft: #e7f0e8;
  --blue-soft: #e5eef0;
  --red: #b8482e;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 16px 44px rgba(55, 47, 33, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: #1f2a24;
  background: var(--paper);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(23, 62, 50, 0.07);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: #fffdf8;
  box-shadow: 0 8px 18px rgba(23, 62, 50, 0.16);
}

.btn-primary:hover {
  background: #1d4c3c;
}

.btn-primary:disabled {
  background: #b9c0b8;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  border-color: rgba(23, 62, 50, 0.16);
  background: rgba(255, 253, 248, 0.6);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(23, 62, 50, 0.3);
  background: #fffdf8;
}

.btn-danger {
  background: var(--accent);
  color: #fff;
}

.btn-sm {
  height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
}

.icon-btn:hover {
  background: rgba(23, 62, 50, 0.06);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.link-btn {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.link-btn:hover {
  color: var(--accent);
}

/* ---------------- login ---------------- */
.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  min-height: 100vh;
  background: var(--paper);
}

.login-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 48px 56px;
  background:
    radial-gradient(circle at 80% 10%, rgba(202, 165, 100, 0.14), transparent 36%),
    radial-gradient(circle at 10% 90%, rgba(106, 151, 119, 0.18), transparent 40%),
    linear-gradient(145deg, #1b4739 0%, #14372c 55%, #0e2a21 100%);
  color: #fffdf8;
}

.login-visual::before {
  position: absolute;
  top: 18%;
  right: -180px;
  width: 540px;
  height: 540px;
  border: 1px solid rgba(240, 215, 171, 0.14);
  border-radius: 50%;
  content: "";
}

.login-visual::after {
  position: absolute;
  bottom: -260px;
  left: -140px;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(240, 215, 171, 0.1);
  border-radius: 50%;
  content: "";
}

.login-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(rgba(255, 253, 248, 0.13) 0.7px, transparent 0.7px);
  background-size: 19px 19px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-brand img {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.login-brand strong {
  display: block;
  font-size: 21px;
  letter-spacing: 3px;
}

.login-brand span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 253, 248, 0.45);
  font-size: 9px;
  letter-spacing: 2.4px;
}

.login-copy {
  position: relative;
  z-index: 2;
  margin-top: clamp(60px, 10vh, 110px);
  max-width: 600px;
}

.login-eyebrow {
  color: #d6b985;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
}

.login-copy h1 {
  margin: 20px 0 0;
  font-size: clamp(48px, 5.4vw, 78px);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.12;
}

.login-copy h1 em {
  color: #efd39f;
  font-style: normal;
}

.login-copy p {
  margin: 22px 0 0;
  color: rgba(255, 253, 248, 0.56);
  font-size: 15px;
  letter-spacing: 0.5px;
}

.login-features {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 34px;
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 253, 248, 0.12);
  max-width: 560px;
}

.login-features div {
  color: rgba(255, 253, 248, 0.68);
  font-size: 12px;
}

.login-features span {
  display: block;
  margin-bottom: 4px;
  color: #cfb27d;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
}

.login-art {
  position: absolute;
  right: -10px;
  bottom: 24px;
  z-index: 1;
  width: min(34vw, 430px);
  transform: rotate(-4deg);
}

.login-art img {
  display: block;
  width: 100%;
  border: 8px solid rgba(255, 253, 248, 0.16);
  border-radius: 26px;
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.26);
}

.login-art-tag {
  position: absolute;
  bottom: 22px;
  left: -26px;
  padding: 8px 16px;
  border: 1px solid rgba(239, 211, 159, 0.4);
  border-radius: 8px;
  background: rgba(17, 47, 37, 0.82);
  color: #efd39f;
  font-size: 11px;
  letter-spacing: 1px;
  backdrop-filter: blur(6px);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background:
    radial-gradient(circle at 90% 10%, rgba(195, 154, 90, 0.08), transparent 35%),
    var(--paper);
}

.login-form {
  width: min(100%, 390px);
}

.login-form-head {
  margin-bottom: 30px;
}

.login-form-kicker {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
}

.login-form-head h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
}

.login-form-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: block;
  min-width: 0;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: #5f6a62;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(23, 62, 50, 0.13);
  border-radius: 9px;
  outline: none;
  background: #fffdf8;
  color: #27382f;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(23, 62, 50, 0.55);
  box-shadow: 0 0 0 3px rgba(23, 62, 50, 0.07);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #b7b1a5;
}

.login-form .field input {
  height: 50px;
  font-size: 15px;
}

.login-error {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: 8px;
  background: #fae6df;
  color: #a8482d;
  font-size: 12px;
}

.login-form .btn-block {
  height: 50px;
  margin-top: 18px;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.7;
}

.login-footer {
  margin-top: 56px;
  color: #b5afa2;
  font-size: 10px;
  letter-spacing: 1px;
}

/* ---------------- shell ---------------- */
.app-view {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 26px 16px 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(195, 154, 90, 0.12), transparent 32%),
    linear-gradient(180deg, #173e32 0%, #112f26 100%);
  color: #fffdf8;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.sidebar-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 2px;
}

.sidebar-brand span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 253, 248, 0.42);
  font-size: 9px;
  letter-spacing: 1px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 38px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 253, 248, 0.6);
  font-size: 13px;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  opacity: 0.8;
}

.nav-item:hover {
  background: rgba(255, 253, 248, 0.06);
  color: #fffdf8;
}

.nav-item.is-active {
  background: rgba(255, 253, 248, 0.1);
  color: #fffdf8;
  box-shadow: inset 3px 0 0 #d6b985;
}

.nav-item.is-active svg {
  opacity: 1;
}

.sidebar-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255, 253, 248, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.04);
}

.store-live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e7d2a9;
  font-size: 11px;
  font-weight: 600;
}

.store-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #77b28c;
  box-shadow: 0 0 0 4px rgba(119, 178, 140, 0.13);
}

.sidebar-note p {
  margin: 8px 0 0;
  color: rgba(255, 253, 248, 0.4);
  font-size: 10px;
  line-height: 1.7;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 13px 8px 0;
  border-top: 1px solid rgba(255, 253, 248, 0.09);
}

.sidebar-admin {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-admin > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.1);
  color: #e8d4ac;
  font-size: 11px;
}

.sidebar-admin strong {
  display: block;
  font-size: 10px;
  font-weight: 500;
}

.sidebar-admin small {
  display: block;
  color: rgba(255, 253, 248, 0.35);
  font-size: 8px;
}

.logout-btn {
  padding: 3px 7px;
  border: 0;
  background: transparent;
  color: rgba(255, 253, 248, 0.4);
  font-size: 10px;
}

.logout-btn:hover {
  color: #fffdf8;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(245, 241, 231, 0.9);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-eyebrow {
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
}

.topbar h1 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.topbar-date {
  color: var(--muted);
  font-size: 11px;
}

.topbar-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(23, 62, 50, 0.12);
  border-radius: 50%;
  background: #fffdf8;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

#menu-btn {
  display: none;
}

.sidebar-scrim {
  display: none;
}

.workspace {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 36px 64px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewIn 0.28s ease both;
}

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

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-intro-row {
  align-items: center;
}

.eyebrow {
  color: var(--gold);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.4px;
}

.page-intro h2 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.page-intro p {
  margin: 7px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.intro-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.6);
  color: #5d6d63;
  font-size: 10px;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5e9b72;
  box-shadow: 0 0 0 4px rgba(94, 155, 114, 0.12);
}

/* ---------------- cards / panels ---------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px 20px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-card.stat-dark {
  border-color: transparent;
  background:
    radial-gradient(circle at 100% 0, rgba(211, 177, 113, 0.2), transparent 45%),
    linear-gradient(145deg, #1b483a, #123128);
  color: #fffdf8;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.stat-dark .stat-top {
  color: rgba(255, 253, 248, 0.56);
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-green {
  background: #5d9a72;
}

.dot-gold {
  background: #d5b477;
}

.dot-orange {
  background: #d67b52;
}

.dot-red {
  background: #c45a3f;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-dark strong {
  color: #f2d7a5;
}

.stat-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 10px;
}

.stat-dark small {
  color: rgba(255, 253, 248, 0.4);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.dashboard-grid + .panel,
#view-dashboard > .panel {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h3 {
  margin: 3px 0 0;
  color: #25372e;
  font-size: 17px;
  font-weight: 700;
}

.panel-meta {
  color: var(--muted);
  font-size: 10px;
}

.panel-desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 210px;
  padding: 12px 4px 0;
  border-bottom: 1px solid var(--line-soft);
  background-image: linear-gradient(to top, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 52px;
}

.chart-col {
  display: flex;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chart-bar-wrap {
  display: flex;
  width: 100%;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  position: relative;
  width: min(38px, 72%);
  min-height: 3px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #d8b878, #b88d4b);
  transition: height 0.5s ease;
}

.chart-bar:hover::after {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--ink);
  color: #fffdf8;
  content: attr(data-value);
  font-size: 9px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.chart-label {
  color: var(--muted);
  font-size: 9px;
}

.chart-value {
  color: #5e685f;
  font-size: 9px;
  font-weight: 600;
}

/* stock list */
.stock-list {
  display: flex;
  flex-direction: column;
}

.stock-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.stock-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.stock-thumb {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  background: #eee7da;
}

.stock-copy {
  flex: 1;
  min-width: 0;
}

.stock-name {
  overflow: hidden;
  color: #334239;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-meta {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
}

.stock-count {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.stock-empty {
  padding: 24px 0;
  color: var(--muted-light);
  font-size: 11px;
  text-align: center;
}

/* tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  padding: 0 12px 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: #536057;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(23, 62, 50, 0.025);
}

.data-table tbody tr.is-clickable {
  cursor: pointer;
}

.cell-main {
  color: #29382f;
  font-size: 12px;
  font-weight: 600;
}

.cell-sub {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
}

.cell-money {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-stack {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell-thumb {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: cover;
  background: #eee7da;
}

.cell-strong {
  color: var(--ink);
  font-weight: 600;
}

.table-empty {
  padding: 42px 20px;
  color: var(--muted-light);
  font-size: 12px;
  text-align: center;
}

/* status pills */
.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-orange {
  background: var(--accent-soft);
  color: #aa4a2b;
}

.pill-green {
  background: var(--green-soft);
  color: #2e664b;
}

.pill-blue {
  background: var(--blue-soft);
  color: #2f606a;
}

.pill-grey {
  background: #efede6;
  color: #71766e;
}

.pill-gold {
  background: var(--gold-soft);
  color: #8b6a31;
}

.pill-muted {
  background: #efede6;
  color: #919087;
}

.pill-red {
  background: #fae6df;
  color: #ad4328;
}

/* toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tab {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: #6f776f;
  font-size: 11px;
}

.filter-tab:hover {
  background: rgba(23, 62, 50, 0.04);
}

.filter-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffdf8;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 230px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffdf8;
}

.search-field svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: #a3a093;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.search-field input::placeholder {
  color: #b5afa3;
}

/* product table */
.product-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 280px;
}

.product-cell img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
  background: #eee7da;
}

.product-cell-name {
  color: #29382f;
  font-size: 12px;
  font-weight: 600;
}

.product-cell-spec {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
}

.stock-good {
  color: #3d6a53;
  font-weight: 600;
}

.stock-low {
  color: #c15a34;
  font-weight: 700;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.row-action {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: #5d685f;
  font-size: 10px;
}

.row-action:hover {
  border-color: rgba(23, 62, 50, 0.32);
  background: rgba(23, 62, 50, 0.035);
}

.row-action.danger {
  color: #b05135;
}

/* settings */
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.settings-form {
  padding: 24px;
}

.panel-head-spaced {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

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

.field-hint {
  margin: 6px 0 0;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.6;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

.form-status {
  color: var(--muted);
  font-size: 10px;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.qr-controls {
  display: flex;
  gap: 8px;
}

.qr-controls select {
  flex: 1;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  font-size: 11px;
}

.qr-placeholder {
  display: grid;
  min-height: 190px;
  margin-top: 14px;
  place-items: center;
  padding: 20px;
  border: 1px dashed rgba(23, 62, 50, 0.18);
  border-radius: 12px;
  background: #faf6ed;
  color: var(--muted-light);
  font-size: 10px;
  text-align: center;
}

.qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #faf6ed;
}

.qr-result img {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  background: #fff;
}

.qr-result .btn {
  margin-top: 12px;
}

.status-list {
  display: flex;
  flex-direction: column;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  color: #556159;
  font-size: 11px;
}

.status-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.status-tip {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f7f2e8;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

/* ---------------- drawer ---------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 32, 25, 0.32);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}

.order-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  width: min(520px, 100vw);
  flex-direction: column;
  background: #f7f3ea;
  box-shadow: -24px 0 60px rgba(23, 40, 32, 0.16);
  animation: drawerIn 0.25s ease both;
}

@keyframes drawerIn {
  from {
    transform: translateX(30px);
    opacity: 0.5;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: #fffdf8;
}

.drawer-head h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px 30px;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: #fffdf8;
}

.drawer-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fffdf8;
}

.drawer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.drawer-status-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-amount {
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.drawer-label {
  margin-bottom: 9px;
  color: var(--muted-light);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.drawer-address-name {
  color: #2b3a31;
  font-size: 13px;
  font-weight: 700;
}

.drawer-address-name span {
  margin-left: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.drawer-address-text {
  margin-top: 5px;
  color: #687068;
  font-size: 11px;
  line-height: 1.7;
}

.drawer-address-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.drawer-mini-btn {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: #56645b;
  font-size: 9px;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}

.drawer-item:first-of-type {
  border-top: 0;
}

.drawer-item img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee7da;
}

.drawer-item-copy {
  flex: 1;
  min-width: 0;
}

.drawer-item-name {
  overflow: hidden;
  color: #35453b;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-item-spec {
  color: var(--muted-light);
  font-size: 9px;
}

.drawer-item-price {
  color: #59655c;
  font-size: 10px;
  text-align: right;
}

.drawer-sum {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.drawer-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--muted);
  font-size: 10px;
}

.drawer-sum-row.total {
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.drawer-sum-row.total strong {
  color: var(--accent);
  font-size: 19px;
}

.drawer-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 10px;
}

.drawer-info-row span:last-child {
  color: #4c5a51;
  text-align: right;
  word-break: break-all;
}

.drawer-note {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f8f2e7;
  color: #7b735f;
  font-size: 10px;
  line-height: 1.7;
}

/* ---------------- modals ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 32, 25, 0.4);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 30px 80px rgba(14, 35, 27, 0.25);
  animation: modalIn 0.22s ease both;
}

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

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-head h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
}

.product-modal-card {
  width: min(920px, 100%);
}

.product-form-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
}

.product-image-col {
  min-width: 0;
}

.image-preview {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f3ecdf;
  background-position: center;
  background-size: cover;
  color: var(--muted-light);
  font-size: 10px;
}

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 10px 0 14px;
  border: 1px dashed rgba(23, 62, 50, 0.24);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.upload-btn:hover {
  background: rgba(23, 62, 50, 0.03);
}

.product-fields {
  min-width: 0;
}

.product-fields .form-grid {
  gap: 12px;
}

.product-fields .field input,
.product-fields .field select,
.product-fields .field textarea {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}

.product-fields .field textarea {
  min-height: 82px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: #59655c;
  font-size: 11px;
}

.check-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.confirm-card {
  width: min(400px, 100%);
}

.confirm-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.confirm-card p {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

/* toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 100;
  max-width: min(90vw, 500px);
  padding: 11px 18px;
  border-radius: 9px;
  background: rgba(18, 46, 36, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  color: #fffdf8;
  font-size: 12px;
  transform: translateX(-50%);
  animation: toastIn 0.25s ease;
}

.toast.is-error {
  background: #a8472e;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* print */
.print-area {
  display: none;
}

@media print {
  body {
    background: #fff;
  }

  .login-view,
  .app-view,
  .drawer-backdrop,
  .order-drawer,
  .modal,
  .toast {
    display: none !important;
  }

  .print-area {
    display: block !important;
    padding: 18mm;
    color: #000;
    font-family: var(--font);
  }

  .print-title {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
  }

  .print-sub {
    margin-top: 4px;
    color: #555;
    font-size: 11px;
    text-align: center;
  }

  .print-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 18px;
    margin-top: 16px;
    padding: 12px 0;
    border-top: 1px dashed #999;
    border-bottom: 1px dashed #999;
    font-size: 12px;
  }

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

  .print-table th,
  .print-table td {
    padding: 7px 4px;
    border-bottom: 1px solid #ddd;
    text-align: left;
  }

  .print-table th {
    border-bottom: 1px solid #666;
  }

  .print-total {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
  }

  .print-foot {
    margin-top: 22px;
    padding-top: 10px;
    border-top: 1px dashed #999;
    color: #555;
    font-size: 10px;
    line-height: 1.7;
  }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .login-art {
    width: 340px;
    opacity: 0.82;
  }
}

@media (max-width: 980px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 32px 34px;
  }

  .login-copy {
    margin-top: 36px;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .login-copy p {
    margin-top: 12px;
  }

  .login-features {
    margin-top: 22px;
    padding-top: 18px;
  }

  .login-art {
    display: none;
  }

  .login-panel {
    padding: 38px 24px 54px;
  }

  .login-footer {
    margin-top: 28px;
  }

  .app-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 248px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim.is-open {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    background: rgba(17, 32, 25, 0.35);
  }

  #menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 0 20px;
  }

  .workspace {
    padding: 24px 20px 50px;
  }

  .topbar-date {
    display: none;
  }

  .product-form-layout {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .login-visual {
    min-height: 38vh;
    padding: 26px 22px;
  }

  .login-brand img {
    width: 38px;
    height: 38px;
  }

  .login-copy {
    margin-top: 24px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .login-features {
    gap: 18px;
  }

  .login-features div {
    font-size: 10px;
  }

  .login-panel {
    place-items: start center;
  }

  .page-intro,
  .page-intro-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-intro h2 {
    font-size: 26px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card strong {
    font-size: 27px;
  }

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

  .search-field {
    min-width: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .product-form-layout {
    grid-template-columns: 1fr;
  }

  .product-image-col {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .product-image-col .image-preview {
    grid-row: span 2;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .drawer-head,
  .drawer-body,
  .drawer-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .chart {
    gap: 7px;
    height: 180px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar-right .btn {
    display: none;
  }

  .topbar {
    height: 72px;
  }
}
