:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #fff8ec;
  --text: #232323;
  --muted: #6e6e6e;
  --line: #e6e3dc;
  --brand: #e99100;
  --brand-strong: #bf7200;
  --brand-soft: #fff0d2;
  --success: #237a4b;
  --danger: #b83b35;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 28, 22, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: #22201c;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #1f1c17;
  font-weight: 900;
}

.nav-section { display: grid; gap: 8px; }
.nav-caption {
  color: #aaa59b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  color: #d9d5cd;
  background: transparent;
  text-align: left;
  transition: .18s ease;
}
.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(255,255,255,.09);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: #aaa59b;
}

.main { padding: 36px clamp(20px, 4vw, 64px) 72px; }
.page {
  max-width: 1180px;
  margin: 0 auto;
  display: none;
}
.page.active { display: block; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
}
.page-head p { margin: 0; color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #815300;
  font-size: 12px;
  font-weight: 700;
}
.badge.success { background: #e8f6ee; color: var(--success); }
.badge.gray { background: #efefec; color: #5f5f5b; }
.badge.danger { background: #fce9e7; color: var(--danger); }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card.soft { background: var(--surface-soft); box-shadow: none; }

.metric {
  display: grid;
  gap: 4px;
}
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { font-size: 28px; font-weight: 800; line-height: 1.15; }
.metric-note { color: var(--muted); font-size: 12px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 700;
  transition: .15s ease;
}
.btn.primary { background: var(--brand); color: #241a08; }
.btn.primary:hover { background: #f3a21a; }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--text); }
.btn.secondary:hover { background: #faf9f6; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: #fff1ef; color: var(--danger); border-color: #f3d2ce; }

.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; gap: 8px; }
.form-row label { font-size: 13px; font-weight: 700; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid #d8d4cb;
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px;
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(233,145,0,.12);
}
.textarea { min-height: 100px; resize: vertical; }

.segmented {
  display: inline-flex;
  padding: 4px;
  background: #ece9e3;
  border-radius: 12px;
  gap: 4px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 700;
}
.segmented button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.list { display: grid; gap: 12px; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.list-item strong { display: block; margin-bottom: 4px; }
.list-item small { color: var(--muted); }

.progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 28px;
}
.progress-step {
  height: 6px;
  border-radius: 999px;
  background: #dfddd7;
}
.progress-step.done { background: var(--brand); }

.profile-card {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f0c36e, #cf7b00);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  font-size: 24px;
}
.profile-meta { color: var(--muted); font-size: 13px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.tag {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f2f0eb;
  color: #55514a;
  font-size: 12px;
}

.price { font-size: 24px; font-weight: 800; white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { font-size: 12px; color: var(--muted); background: #faf9f7; }

.notice {
  border-left: 4px solid var(--brand);
  background: #fff8e9;
  padding: 14px 16px;
  border-radius: 10px;
  color: #66420a;
}

.phone-frame {
  width: min(390px, 100%);
  margin: 0 auto;
  border: 10px solid #232323;
  border-radius: 34px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.phone-top {
  height: 28px;
  background: #232323;
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.phone-body { padding: 18px; min-height: 620px; }

.component-section { margin-bottom: 36px; }
.component-title { margin-bottom: 12px; }
.component-surface {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25,23,20,.45);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 20;
}
.modal-backdrop.open { display: grid; }
.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal h2 { margin-top: 0; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #24221f;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }
  .nav-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-caption { grid-column: 1 / -1; }
  .sidebar-footer { display: none; }
  .main { padding: 24px 16px 56px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .profile-card { grid-template-columns: 56px minmax(0,1fr); }
  .avatar { width: 56px; height: 56px; border-radius: 14px; }
  .profile-card .price { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .nav-section { grid-template-columns: 1fr; }
  .page-head { display: grid; }
  .list-item { display: grid; }
  .actions .btn { flex: 1; }
}
