:root {
  --bg: #f4f1ea;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffdfa;
  --line: rgba(88, 67, 42, 0.12);
  --line-strong: rgba(88, 67, 42, 0.18);
  --text: #2f2418;
  --muted: #7d6c58;
  --accent: #b77932;
  --accent-strong: #8f5717;
  --accent-soft: rgba(183, 121, 50, 0.12);
  --success: #2f8f67;
  --success-soft: rgba(47, 143, 103, 0.12);
  --danger: #c14b39;
  --danger-soft: rgba(193, 75, 57, 0.12);
  --warning: #b67d21;
  --warning-soft: rgba(182, 125, 33, 0.14);
  --shadow-lg: 0 30px 80px rgba(86, 63, 35, 0.12);
  --shadow-md: 0 18px 40px rgba(86, 63, 35, 0.09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sidebar-width: 284px;
  --content-width: 1600px;
  --font-display: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(191, 141, 68, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(140, 83, 22, 0.12), transparent 28%),
    linear-gradient(180deg, #fbf8f1 0%, var(--bg) 100%);
  font-family: var(--font-display);
}

body {
  min-width: 320px;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 16px auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 32px);
}

.sidebar,
.content-shell,
.login-panel,
.hero-panel,
.card,
.modal-panel,
.drawer-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-md);
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 22px;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 32px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #c98538, #8f5717);
  box-shadow: 0 18px 28px rgba(143, 87, 23, 0.22);
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.env-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  width: fit-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-strong);
  border: 1px solid rgba(183, 121, 50, 0.18);
}

.env-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.profile-panel {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 245, 236, 0.9));
  border: 1px solid var(--line);
}

.profile-title,
.profile-name,
.profile-subtitle,
.profile-meta,
.section-title,
.section-subtitle,
.hero-eyebrow,
.hero-title,
.hero-subtitle,
.metric-label,
.metric-value,
.status-title,
.status-copy,
.stat-number,
.stat-label,
.empty-title,
.empty-copy,
.form-label,
.hint,
.table-title,
.table-subtitle,
.pill-label,
.modal-title,
.modal-subtitle,
.toast,
.login-eyebrow,
.login-title,
.login-copy,
.login-feature-title,
.login-feature-copy,
.header-title,
.header-subtitle,
.quick-title,
.quick-copy,
.timeline-title,
.timeline-copy,
.list-title,
.list-copy,
.badge {
  display: block;
}

.profile-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-name {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
}

.profile-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profile-meta {
  margin-top: 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-button {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nav-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.72);
}

.nav-button.active {
  background: linear-gradient(135deg, rgba(183, 121, 50, 0.17), rgba(143, 87, 23, 0.12));
  box-shadow: inset 0 0 0 1px rgba(183, 121, 50, 0.16);
}

.nav-button.disabled {
  opacity: 0.46;
}

.nav-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.nav-copy {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sidebar-note {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.sidebar-note strong {
  display: block;
  font-size: 15px;
}

.sidebar-note span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.content-shell {
  border-radius: var(--radius-xl);
  padding: 20px;
}

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

.header-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.header-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 720px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button,
.ghost-button,
.soft-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button {
  color: #fff;
  background: linear-gradient(135deg, #c98538, #8f5717);
  box-shadow: 0 18px 28px rgba(143, 87, 23, 0.18);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line-strong);
}

.soft-button {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.danger-button {
  color: var(--danger);
  background: var(--danger-soft);
}

.button:hover,
.ghost-button:hover,
.soft-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.ghost-button:disabled,
.soft-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.page-grid {
  display: grid;
  gap: 18px;
}

.hero-panel {
  border-radius: var(--radius-xl);
  padding: 26px;
  background:
    radial-gradient(circle at top right, rgba(255, 213, 168, 0.3), transparent 28%),
    linear-gradient(135deg, #2d2011 0%, #5b3816 48%, #9f6321 100%);
  color: #fff6eb;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 246, 235, 0.66);
}

.hero-title {
  margin-top: 14px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  margin-top: 14px;
  max-width: 760px;
  color: rgba(255, 246, 235, 0.84);
  font-size: 15px;
  line-height: 1.8;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.metric-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
}

.metric-label {
  margin-top: 6px;
  color: rgba(255, 246, 235, 0.72);
  font-size: 13px;
}

.card {
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.span-12 {
  grid-column: span 12;
}

.span-8 {
  grid-column: span 8;
}

.span-7 {
  grid-column: span 7;
}

.span-6 {
  grid-column: span 6;
}

.span-5 {
  grid-column: span 5;
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.status-block {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.status-block.success {
  background: var(--success-soft);
  border-color: rgba(47, 143, 103, 0.18);
}

.status-block.warning {
  background: var(--warning-soft);
  border-color: rgba(182, 125, 33, 0.2);
}

.status-block.danger {
  background: var(--danger-soft);
  border-color: rgba(193, 75, 57, 0.18);
}

.status-title {
  font-size: 16px;
  font-weight: 800;
}

.status-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.badge-row,
.quick-grid,
.stats-grid,
.toolbar,
.filter-row,
.delivery-grid,
.form-grid,
.details-grid,
.login-hero-grid,
.login-actions,
.summary-list,
.list-grid,
.timeline-list,
.modal-actions,
.table-actions,
.order-toolbar,
.mini-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.badge.approved,
.pill.approved {
  color: var(--success);
  background: var(--success-soft);
}

.badge.pending,
.pill.pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge.rejected,
.pill.rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.badge.neutral,
.pill.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.84);
}

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

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

.quick-card,
.stat-card,
.timeline-item,
.list-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
}

button.quick-card {
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button.quick-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(86, 63, 35, 0.12);
}

button.quick-card:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.quick-title,
.stat-number,
.timeline-title,
.list-title {
  font-size: 16px;
  font-weight: 800;
}

.quick-copy,
.stat-label,
.timeline-copy,
.list-copy {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.stat-number {
  font-size: 26px;
}

.toolbar {
  align-items: center;
  justify-content: space-between;
}

.toolbar-left,
.toolbar-right,
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(183, 121, 50, 0.4);
  box-shadow: 0 0 0 4px rgba(183, 121, 50, 0.1);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.field {
  display: grid;
  gap: 10px;
}

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

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

.form-label {
  font-size: 13px;
  font-weight: 700;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.tag-chip button {
  border-radius: 999px;
  width: 20px;
  height: 20px;
  background: rgba(47, 36, 24, 0.06);
  color: var(--muted);
}

.delivery-option {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

.delivery-option.active {
  border-color: rgba(183, 121, 50, 0.3);
  background: var(--accent-soft);
}

.table-card {
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(88, 67, 42, 0.08);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table td {
  font-size: 14px;
  line-height: 1.7;
}

.table td strong {
  display: block;
  font-size: 15px;
}

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

.action-text {
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.action-text.danger {
  color: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.list-card-cover {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  object-fit: cover;
  background: #f1ebe2;
}

.list-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed rgba(88, 67, 42, 0.16);
  text-align: center;
}

.empty-title {
  font-size: 20px;
  font-weight: 800;
}

.empty-copy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.login-shell {
  width: min(calc(100% - 32px), 1440px);
  margin: 16px auto;
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.login-hero,
.login-panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.login-hero {
  background:
    radial-gradient(circle at top right, rgba(255, 228, 194, 0.22), transparent 26%),
    linear-gradient(140deg, #2b2012 0%, #5a3816 45%, #9e6322 100%);
  color: #fff4e7;
  box-shadow: var(--shadow-lg);
}

.login-panel {
  align-self: center;
  padding: 30px;
}

.login-eyebrow {
  color: rgba(255, 244, 231, 0.68);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.login-title {
  margin-top: 16px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.login-copy {
  margin-top: 16px;
  max-width: 640px;
  color: rgba(255, 244, 231, 0.84);
  font-size: 15px;
  line-height: 1.9;
}

.login-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.login-feature {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-feature-title {
  font-size: 17px;
  font-weight: 800;
}

.login-feature-copy {
  margin-top: 8px;
  color: rgba(255, 244, 231, 0.76);
  font-size: 13px;
  line-height: 1.75;
}

.auth-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.auth-card + .auth-card {
  margin-top: 14px;
}

.modal-backdrop,
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(41, 29, 15, 0.28);
  backdrop-filter: blur(8px);
  z-index: 80;
}

.modal-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 760px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-xl);
  z-index: 81;
}

.drawer-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(calc(100% - 24px), 720px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-xl);
  z-index: 81;
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.modal-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.modal-actions {
  margin-top: 22px;
  justify-content: flex-end;
}

.toast-layer {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  z-index: 120;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 20px 32px rgba(47, 36, 24, 0.16);
}

.toast.success {
  background: linear-gradient(135deg, #2f8f67, #246f50);
}

.toast.error {
  background: linear-gradient(135deg, #c14b39, #9b3528);
}

.toast.info {
  background: linear-gradient(135deg, #6f6b64, #4f4b45);
}

.loading-screen {
  width: min(calc(100% - 32px), 960px);
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  display: grid;
  place-items: center;
}

.loading-card {
  padding: 40px 44px;
  border-radius: 32px;
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid rgba(183, 121, 50, 0.16);
  border-top-color: var(--accent);
  animation: spin 0.86s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }

  .stats-grid.four,
  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4,
  .span-3 {
    grid-column: span 12;
  }

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

@media (max-width: 820px) {
  .content-header,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .form-grid,
  .quick-grid,
  .stats-grid,
  .list-grid,
  .login-hero-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    overflow-x: auto;
  }

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

  .list-card-cover {
    width: 100%;
    height: 200px;
  }
}
