:root {
  --bg: #fbf6f4;
  --bg-mobile: #fcf7f5;
  --panel: #fffdfc;
  --panel-strong: #ffffff;
  --panel-soft: #f8efec;
  --text: #241f1f;
  --text-secondary: #514848;
  --muted: #7b7070;
  --weak: #a09494;
  --line: #eedfd9;
  --line-soft: #f4e8e3;
  --brand: #c07a86;
  --brand-soft: #e8c7c0;
  --brand-soft-2: #f1ddd2;
  --success: #7fa27d;
  --warning: #c9965a;
  --danger: #c56b6b;
  --info: #c07a86;
  --shadow-card: 0 8px 20px rgba(192, 122, 134, 0.08);
  --shadow-pop: 0 14px 30px rgba(192, 122, 134, 0.12);
  --radius-input: 10px;
  --radius-card: 14px;
  --radius-block: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(241, 221, 210, 0.7), transparent 26%),
    linear-gradient(180deg, #fffafa 0%, var(--bg) 100%);
  font-family:
    "SF Pro Display",
    "SF Pro Text",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans SC",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.error-text {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(255, 253, 252, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}

.login-intro {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 20px;
  min-height: 520px;
  padding: 24px;
  overflow: hidden;
  border-radius: var(--radius-block);
  border: 1px solid rgba(192, 122, 134, 0.16);
  background:
    radial-gradient(circle at top right, rgba(241, 221, 210, 0.92), transparent 34%),
    linear-gradient(180deg, #fffdfc 0%, #fdf5f2 100%);
}

.login-orb {
  position: absolute;
  right: -40px;
  top: -52px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.88) 0%, rgba(232, 199, 192, 0.82) 55%, rgba(232, 199, 192, 0.08) 100%);
  filter: blur(2px);
}

.login-copy,
.login-highlights {
  position: relative;
  z-index: 1;
}

.login-copy {
  max-width: 430px;
}

.login-copy .muted {
  max-width: 400px;
  font-size: 14px;
  line-height: 1.75;
}

.login-highlights {
  display: grid;
  gap: 12px;
}

.login-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(238, 223, 217, 0.92);
  box-shadow: 0 8px 18px rgba(192, 122, 134, 0.06);
}

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

.login-highlight strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.login-form-wrap {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 520px;
  padding: 24px;
}

.login-form-head h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.login-form-head .muted {
  margin: 0;
  font-size: 12px;
}

.login-card h1,
.brand-block h2,
.topbar h1 {
  margin: 0 0 8px;
  font-family:
    "SF Pro Display",
    "SF Pro Text",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans SC",
    sans-serif;
  color: var(--text);
}

.login-card h1,
.brand-block h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
  background: linear-gradient(180deg, #fff9f8 0%, #fcf1ee 100%);
  border-right: 1px solid var(--line);
}

.brand-block {
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(232, 199, 192, 0.55), rgba(255, 255, 255, 0.78));
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  text-align: center;
}

.brand-block .muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.nav-list {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  position: relative;
  width: min(148px, 100%);
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.nav-btn::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
}

.nav-btn:hover {
  background: rgba(232, 199, 192, 0.32);
  border-color: rgba(192, 122, 134, 0.15);
  color: var(--text);
}

.nav-btn.active {
  background: var(--brand-soft);
  border-color: rgba(192, 122, 134, 0.35);
  color: var(--brand);
}

.nav-btn.active::before {
  background: var(--brand);
}

.main-shell {
  padding: 16px 16px 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: rgba(255, 253, 252, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius-block);
  box-shadow: var(--shadow-card);
}

.topbar .muted {
  font-size: 12px;
}

.topbar #page-title {
  margin-bottom: 6px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-section {
  display: none;
  animation: fade-in 0.24s ease;
}

.content-section.active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.section-grid {
  display: grid;
  gap: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px 14px;
  min-height: 120px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 239, 236, 0.96));
}

.kpi-card.primary {
  border-color: rgba(192, 122, 134, 0.28);
  background:
    radial-gradient(circle at top right, rgba(232, 199, 192, 0.78), transparent 52%),
    linear-gradient(180deg, #fffdfc 0%, #f9efeb 100%);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 38px;
}

.kpi-card strong {
  display: block;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  word-break: keep-all;
}

.dashboard-drilldown {
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.dashboard-drilldown:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(93, 58, 44, 0.08);
  border-color: rgba(192, 122, 134, 0.34);
}

.dashboard-drilldown:focus-visible {
  outline: 2px solid rgba(192, 122, 134, 0.56);
  outline-offset: 2px;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.panel-title {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.panel-subtitle {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.master-section {
  gap: 12px;
}

.master-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.master-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 12px;
  align-items: start;
}

.master-column {
  display: grid;
  gap: 12px;
}

.master-panel {
  padding: 14px;
}

.compact-form {
  gap: 10px;
}

.field-grid.four {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.compact-note-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 1fr);
}

.product-image-uploader {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.upload-field {
  display: grid;
  gap: 6px;
}

.product-image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.product-image-preview img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.product-image-meta {
  display: grid;
  gap: 4px;
}

.product-image-meta strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.product-image-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compact-actions {
  justify-content: flex-start;
}

.compact-stack {
  display: grid;
  gap: 10px;
}

.compact-form-card {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.operations-section {
  gap: 12px;
}

.operations-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operations-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.operations-column {
  display: grid;
  gap: 12px;
}

.operations-panel {
  padding: 12px;
}

.operations-records {
  display: grid;
  gap: 12px;
}

.daily-section,
.orders-section {
  gap: 12px;
}

.sales-section {
  gap: 12px;
}

.sales-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sales-filter-form {
  display: grid;
  gap: 14px;
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.sales-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.sales-panel {
  padding: 12px;
  min-width: 0;
}

.sales-filter-main {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(380px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.sales-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 18px;
}

.sales-product-filter {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sales-filter-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.sales-filter-actions .accent-btn,
.sales-filter-actions .ghost-btn {
  min-width: 124px;
}

@media (max-width: 1240px) {
  .sales-layout,
  .sales-filter-main {
    grid-template-columns: 1fr;
  }

  .sales-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.daily-kpi-grid,
.orders-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.daily-layout,
.orders-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 12px;
  align-items: start;
}

.daily-column,
.orders-column {
  display: grid;
  gap: 12px;
}

.daily-panel,
.orders-panel {
  padding: 12px;
}

.operations-panel .panel-subtitle,
.daily-panel .panel-subtitle,
.orders-panel .panel-subtitle {
  font-size: 11px;
  line-height: 1.45;
}

.operations-panel textarea,
.daily-panel textarea,
.orders-panel textarea {
  min-height: 72px;
}

.align-end {
  align-items: end;
}

.mobile-record-list {
  display: none;
}

.mobile-record-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

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

.mobile-record-head strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.mobile-record-meta {
  color: var(--muted);
  font-size: 12px;
}

.mobile-record-line {
  display: grid;
  gap: 4px;
}

.mobile-record-line span {
  color: var(--muted);
  font-size: 11px;
}

.mobile-record-line strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.master-subtitle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.master-subtitle-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.compact-table th,
.compact-table td {
  padding-top: 9px;
  padding-bottom: 9px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-block);
  border: 1px solid rgba(192, 122, 134, 0.18);
  background:
    radial-gradient(circle at top right, rgba(232, 199, 192, 0.62), transparent 33%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 239, 236, 0.95));
  box-shadow: var(--shadow-card);
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 12px;
}

.hero-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.hero-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-metrics {
  display: grid;
  gap: 12px;
}

.hero-metric-card {
  padding: 16px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(238, 223, 217, 0.9);
  background: rgba(255, 255, 255, 0.82);
}

.hero-metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hero-metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.hero-metric-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-mini {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(238, 223, 217, 0.88);
  background: rgba(255, 255, 255, 0.72);
}

.hero-mini span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hero-mini strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.form-stack,
.field-grid {
  display: grid;
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.field-grid.three {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input,
select {
  height: 36px;
}

input[type="file"] {
  height: auto;
  padding: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  line-height: 1.3;
}

input[type="file"]::file-selector-button {
  height: 30px;
  margin-right: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #fffdfc 0%, #f8efec 100%);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

input[type="file"]::file-selector-button:hover {
  background: linear-gradient(180deg, #fff7f4 0%, #f3dfd9 100%);
  border-color: rgba(192, 122, 134, 0.3);
  color: var(--brand);
}

input[type="file"]::-webkit-file-upload-button {
  height: 30px;
  margin-right: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: linear-gradient(180deg, #fffdfc 0%, #f8efec 100%);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: linear-gradient(180deg, #fff7f4 0%, #f3dfd9 100%);
  border-color: rgba(192, 122, 134, 0.3);
  color: var(--brand);
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--weak);
  font-size: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(192, 122, 134, 0.12);
}

select[multiple] {
  min-height: 124px;
  padding: 8px 10px;
}

.primary-btn,
.ghost-btn,
.accent-btn,
.warn-btn {
  min-width: 72px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-input);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.primary-btn,
.accent-btn {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(192, 122, 134, 0.18);
}

.ghost-btn {
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--line);
}

.warn-btn {
  background: rgba(197, 107, 107, 0.12);
  color: var(--danger);
  border-color: rgba(197, 107, 107, 0.2);
}

.primary-btn:hover,
.ghost-btn:hover,
.accent-btn:hover,
.warn-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.accent-btn:disabled,
.warn-btn:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.table-header-copy {
  display: grid;
  gap: 4px;
}

.table-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.detail-scroll-wrap {
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.detail-scroll-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.detail-scroll-wrap::-webkit-scrollbar-track {
  background: #f7eeea;
  border-radius: 999px;
}

.detail-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(192, 122, 134, 0.45);
  border-radius: 999px;
  border: 2px solid #f7eeea;
}

.detail-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(192, 122, 134, 0.62);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--panel);
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #faf3f1;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

td {
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
}

tr:hover td {
  background: rgba(241, 221, 210, 0.18);
}

tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 500;
}

.status-good {
  color: var(--success);
}

.status-warn {
  color: var(--warning);
}

.status-bad {
  color: var(--danger);
}

.item-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-preview img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--brand-soft-2);
  border: 1px solid var(--line);
}

.zoomable-image {
  cursor: zoom-in;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 31, 31, 0.58);
  backdrop-filter: blur(2px);
}

.image-lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(92vw, 840px);
  max-height: 88vh;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 253, 252, 0.98);
  box-shadow: 0 24px 60px rgba(36, 31, 31, 0.18);
}

.image-lightbox-dialog img {
  width: 100%;
  max-height: calc(88vh - 76px);
  border-radius: 14px;
  object-fit: contain;
  background: #ffffff;
}

.image-lightbox-close {
  justify-self: end;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdfc 0%, #f8efec 100%);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 14px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(232, 199, 192, 0.48);
  color: var(--text-secondary);
  font-size: 12px;
}

.multi-check-panel {
  display: grid;
  gap: 8px;
  max-height: 246px;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
}

.multi-check-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
}

.multi-check-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.multi-check-option span {
  line-height: 1.45;
}

.analysis-summary-row {
  margin-top: 12px;
}

.analysis-summary-row .chip strong {
  font-weight: 600;
  color: var(--text);
}

.demo-list ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.demo-list {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.demo-list strong {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mobile-stack {
  display: grid;
  gap: 16px;
}

pre {
  font-family:
    ui-monospace,
    "SFMono-Regular",
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  font-size: 12px;
}

@media (max-width: 980px) {
  body {
    background: var(--bg-mobile);
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-intro,
  .login-form-wrap {
    min-height: auto;
  }

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

  .master-layout,
  .master-kpi-grid,
  .operations-layout,
  .operations-kpi-grid,
  .daily-layout,
  .daily-kpi-grid,
  .orders-layout,
  .orders-kpi-grid,
  .sales-layout,
  .sales-kpi-grid,
  .sales-filter-main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid;
  }

  .nav-btn {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    text-align: center;
  }

  .nav-btn::before {
    left: 50%;
    top: auto;
    bottom: 6px;
    transform: translateX(-50%);
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  body.store-mobile-mode {
    background:
      radial-gradient(circle at top center, rgba(241, 221, 210, 0.7), transparent 32%),
      var(--bg-mobile);
  }

  .main-shell {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

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

  .panel {
    padding: 12px;
    border-radius: 12px;
  }

  .dashboard-hero,
  .hero-metric-row,
  .compact-note-grid,
  .product-image-uploader {
    grid-template-columns: 1fr;
  }

  .panel-title {
    font-size: 13px;
  }

  .kpi-card span {
    font-size: 13px;
    min-height: 34px;
  }

  .kpi-card strong {
    font-size: 17px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-mobile-mode .sidebar {
    padding: 12px 12px 8px;
    background: transparent;
    border-right: 0;
  }

  .store-mobile-mode .brand-block {
    margin-bottom: 10px;
    padding: 10px 12px;
  }

  .store-mobile-mode .brand-block .eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .store-mobile-mode .brand-block h2 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .store-mobile-mode .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .store-mobile-mode .nav-btn {
    min-height: 46px;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--line);
    color: var(--text-secondary);
  }

  .store-mobile-mode .nav-btn.active {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: rgba(192, 122, 134, 0.35);
  }

  .store-mobile-mode .topbar {
    margin-bottom: 10px;
    padding: 14px 14px 12px;
  }

  .store-mobile-mode .topbar-actions {
    display: flex;
    justify-content: flex-end;
  }

  .store-mobile-mode .topbar .muted {
    font-size: 11px;
    line-height: 1.6;
  }

  .field-grid.two,
  .field-grid.three {
    grid-template-columns: 1fr;
  }

  .sales-date-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sales-filter-actions {
    justify-content: stretch;
  }

  .sales-filter-actions .accent-btn,
  .sales-filter-actions .ghost-btn {
    flex: 1 1 100%;
    min-width: 0;
  }

  input,
  select {
    height: 40px;
  }

  textarea {
    min-height: 96px;
  }

  .primary-btn,
  .ghost-btn,
  .accent-btn,
  .warn-btn {
    height: 40px;
    font-size: 12px;
  }

  .daily-panel .inline-actions,
  .orders-panel .inline-actions {
    width: 100%;
  }

  .daily-panel .inline-actions > *,
  .orders-panel .inline-actions > * {
    flex: 1 1 100%;
  }

  .mobile-record-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }

  .desktop-only-table {
    display: none;
  }

  th {
    font-size: 11px;
  }

  td {
    font-size: 12px;
  }

  table {
    min-width: 560px;
  }
}
