:root {
  --bg: #f3efe7;
  --bg-soft: #fbf8f1;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: #fffdfa;
  --line: #ddd3c4;
  --ink: #1f2a32;
  --ink-soft: #5a6772;
  --accent: #b45309;
  --accent-soft: #fff2d9;
  --accent-cool: #1f5c7a;
  --ok: #116149;
  --warn: #9a3412;
  --error: #9f1239;
  --shadow: 0 24px 60px rgba(74, 52, 20, 0.09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(180, 83, 9, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 92, 122, 0.12), transparent 30%),
    linear-gradient(180deg, #f7f2e9 0%, #f2ede4 100%);
  color: var(--ink);
  font: 14px/1.5 "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 26px;
}

.sidebar,
.main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-card,
.panel,
.hero-strip,
.status-panel,
.results-section {
  background: var(--panel);
  border: 1px solid rgba(221, 211, 196, 0.9);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-card {
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(31, 92, 122, 0.96), rgba(20, 33, 61, 0.94)),
    var(--panel);
  color: #fff;
}

.brand-card h1 {
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1.08;
}

.brand-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
}

.brand-card .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.panel {
  padding: 20px;
}

.panel-header,
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-header h2,
.section-title-row h3 {
  margin: 0;
  font-size: 18px;
}

.ghost-btn,
.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ghost-btn {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--ink-soft);
}

.primary-btn,
.secondary-btn {
  width: 100%;
  padding: 14px 18px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, #c56a17, #a64605);
  color: #fff;
}

.secondary-btn {
  background: #e9eef1;
  color: var(--ink);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.drop-zone {
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1.5px dashed #c3b39d;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 247, 232, 0.9), rgba(244, 250, 255, 0.92));
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--accent-cool);
  background: linear-gradient(145deg, rgba(230, 245, 252, 0.98), rgba(255, 248, 236, 0.98));
}

.drop-zone strong {
  font-size: 18px;
}

.drop-zone span {
  color: var(--ink-soft);
}

.file-meta {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.field.compact {
  margin-top: 0;
}

.field span {
  font-weight: 600;
}

.field-help,
.next-step,
.section-caption {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

select,
input[type="number"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: var(--ink);
  font: inherit;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-weight: 600;
}

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

.badge.muted {
  background: #ebe6dc;
  color: #705f45;
}

.badge.accent {
  background: #d9eff7;
  color: var(--accent-cool);
}

.hero-strip {
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  background:
    linear-gradient(145deg, rgba(255, 248, 235, 0.96), rgba(241, 248, 252, 0.98));
}

.hero-strip h2 {
  margin: 8px 0 6px;
  font-size: 34px;
  line-height: 1.08;
}

.hero-strip p {
  margin: 0;
}

.status-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
}

.status-step {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.45);
  display: grid;
  gap: 6px;
}

.status-step strong {
  font-size: 15px;
}

.status-step span {
  color: var(--ink-soft);
  font-size: 13px;
}

.status-step.active {
  background: linear-gradient(145deg, rgba(27, 93, 121, 0.95), rgba(29, 53, 87, 0.96));
  color: #fff;
}

.status-step.active span {
  color: rgba(255, 255, 255, 0.75);
}

.warning-panel,
.inline-alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.warning-panel {
  background: #fff4ea;
  border-color: #f3c89b;
  color: var(--warn);
}

.inline-alert.error {
  background: #fff0f4;
  border-color: #f4b2c6;
  color: var(--error);
}

.results-section {
  padding: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 250, 243, 0.95), rgba(244, 249, 251, 0.98));
  border: 1px solid rgba(226, 218, 204, 0.95);
}

.kpi-card .label {
  color: var(--ink-soft);
  font-size: 13px;
}

.kpi-card .value {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.kpi-card.money-kpi .value {
  font-size: 38px;
  letter-spacing: -0.03em;
}

.kpi-card .foot {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.insight-list,
.issue-list,
.person-week-list {
  display: grid;
  gap: 12px;
}

.insight-item,
.issue-item {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid rgba(222, 213, 199, 0.9);
}

.insight-item strong,
.issue-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(220, 211, 197, 0.9);
  border-radius: 18px;
  background: var(--panel-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f2e9;
  color: #5e5140;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(230, 221, 207, 0.95);
  text-align: left;
  white-space: nowrap;
}

tbody tr:nth-child(2n) {
  background: rgba(251, 248, 241, 0.75);
}

.money {
  font-weight: 800;
  color: var(--accent);
}

.muted-text {
  color: var(--ink-soft);
}

.person-week-card {
  border: 1px solid rgba(222, 213, 199, 0.9);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  overflow: hidden;
}

.person-week-card summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(4, minmax(90px, 0.7fr));
  gap: 12px;
  align-items: center;
}

.person-week-card summary::-webkit-details-marker {
  display: none;
}

.person-week-card[open] summary {
  background: linear-gradient(145deg, rgba(255, 247, 232, 0.96), rgba(241, 248, 252, 0.92));
  border-bottom: 1px solid rgba(222, 213, 199, 0.9);
}

.person-week-name {
  display: grid;
  gap: 4px;
}

.person-week-name strong {
  font-size: 18px;
}

.person-week-meta-label {
  color: var(--ink-soft);
  font-size: 12px;
}

.person-week-meta-value {
  font-weight: 800;
  font-size: 20px;
}

.person-week-body {
  padding: 14px 16px 16px;
}

.person-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.person-day-card {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 218, 204, 0.95);
  padding: 12px 12px 10px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.person-day-card.is-empty {
  background: rgba(245, 240, 232, 0.7);
}

.person-day-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.person-day-title strong {
  font-size: 12px;
  letter-spacing: -0.01em;
}

.person-day-title .muted-text {
  font-size: 11px;
  flex-shrink: 0;
}

.person-day-amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.05;
}

.person-day-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  font-size: 11px;
}

.person-day-subgrid span {
  color: var(--ink-soft);
  min-width: 0;
  white-space: nowrap;
}

.person-day-subgrid strong {
  font-size: 12px;
  text-align: right;
}

.hidden {
  display: none !important;
}

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

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

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .status-panel,
  .kpi-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .person-week-card summary {
    grid-template-columns: 1fr 1fr;
  }

  .person-week-grid {
    grid-template-columns: 1fr;
  }

  .hero-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}
