:root {
  --bg: #f4efe6;
  --panel: #fffdfa;
  --panel-soft: #f7f1e7;
  --line: #ded1bf;
  --text: #1c2731;
  --muted: #69747d;
  --accent: #b74c2f;
  --accent-dark: #8f371f;
  --navy: #243447;
  --success: #1f8a5b;
  --warning: #cb8b1e;
  --danger: #b64033;
  --shadow: 0 20px 50px rgba(44, 33, 20, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(183, 76, 47, 0.08), transparent 20%),
    radial-gradient(circle at bottom right, rgba(36, 52, 71, 0.08), transparent 20%),
    var(--bg);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #f8f2e8, #f3ece1);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #d17047);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 25px rgba(183, 76, 47, 0.22);
}

.brand h1,
.brand p,
.hero-card h2,
.hero-card p,
.panel-card h3,
.panel-card p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p,
.eyebrow,
.hero-copy,
.metric,
small,
.section-copy,
.inline-hint,
.result-box,
.sidebar-note p,
.meta-box span,
.scenario-item span {
  color: var(--muted);
}

.sidebar-block {
  margin-bottom: 22px;
}

.sidebar-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a6857;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  font-weight: 600;
}

.nav a:hover,
.nav a.active {
  background: linear-gradient(135deg, var(--navy), #2f4c68);
  color: white;
  border-color: transparent;
}

.sidebar-note {
  margin-top: 24px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.68);
  border: 1px solid var(--line);
}

.sidebar-note strong {
  display: block;
  margin-bottom: 8px;
}

.content {
  padding: 28px;
}

.hero-card,
.panel-card,
.compact-box,
.meta-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-card h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1;
  max-width: 14ch;
}

.hero-copy {
  max-width: 68ch;
  margin-top: 12px;
  line-height: 1.65;
  font-size: 15px;
}

.hero-meta-grid,
.stats-grid,
.panel-grid.two,
.card-grid,
.button-row,
.scenario-list,
.insight-list,
.meta-row {
  display: grid;
  gap: 14px;
}

.hero-meta-grid {
  grid-template-columns: 1fr;
  min-width: 260px;
}

.meta-box {
  padding: 18px;
}

.meta-box span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.meta-box strong {
  font-size: 20px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.stat-box {
  background: linear-gradient(180deg, white, #f9f3eb);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.stat-box span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-box strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.panel-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.panel-card {
  padding: 22px;
  margin-bottom: 18px;
}

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

.panel-head h2,
.panel-head h3 {
  font-size: 28px;
  line-height: 1.1;
}

.section-copy {
  margin: 0 0 18px;
  line-height: 1.6;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ece5da;
  color: #5a5148;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.success { background: #d9f0e5; color: var(--success); }
.pill.warning { background: #fff0d3; color: var(--warning); }

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

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
button {
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: white;
}

input:focus {
  outline: none;
  border-color: #ca8e68;
  box-shadow: 0 0 0 4px rgba(183, 76, 47, 0.1);
}

.primary-btn,
.mini-btn {
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--accent), #d16a42);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn:hover,
.mini-btn:hover {
  filter: brightness(0.98);
}

.primary-btn.alt {
  background: linear-gradient(135deg, var(--navy), #365f8b);
}

.mini-btn {
  padding: 9px 11px;
  font-size: 13px;
}

.mini-btn.danger {
  background: linear-gradient(135deg, var(--danger), #de6b63);
}

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

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

.info-card,
.request-item,
.result-box,
.insight-card,
.scenario-item {
  background: linear-gradient(180deg, white, #fbf7f1);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.info-card h3 {
  font-size: 26px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.bonus-card-portal h3,
.bonus-card-admin h3,
.prize-card-admin h3 {
  font-size: 18px;
}

.bonus-card-portal p,
.bonus-card-admin p,
.prize-card-admin p {
  margin-bottom: 12px;
  line-height: 1.5;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.icon-chip {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), #416587);
  color: white;
  font-weight: 800;
}

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

.card-actions {
  margin-top: 14px;
}

.inline-hint {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  line-height: 1.5;
}

.scenario-list,
.insight-list {
  grid-template-columns: 1fr;
}

.scenario-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.scenario-item code {
  padding: 4px 8px;
  background: #f3eee6;
  border-radius: 8px;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-item.enhanced {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.request-main strong {
  display: block;
  margin-bottom: 6px;
}

.request-side {
  text-align: right;
  min-width: 140px;
}

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

.status-pending { background: #fff0d3; color: var(--warning); }
.status-approved { background: #d9f0e5; color: var(--success); }
.status-rejected { background: #f9ddda; color: var(--danger); }

.result-box {
  min-height: 180px;
}

.result-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.result-state p {
  margin: 0 0 10px;
  line-height: 1.6;
}

.result-state.ok strong { color: var(--success); }
.result-state.bad strong { color: var(--danger); }

.wheel-summary {
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.metric {
  padding: 12px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #eadfce;
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #766959;
  background: #faf5ee;
}

.table-type {
  font-weight: 700;
  color: var(--navy);
}

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

code {
  padding: 2px 6px;
  background: #f1ece3;
  border-radius: 8px;
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .panel-grid.two,
  .card-grid,
  .button-row,
  .stats-grid,
  .hero-meta-grid,
  .meta-row {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
  }
}

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

.bonus-card {
  background: linear-gradient(135deg, #1e2a46, var(--accent));
  color: white;
}

.result-box {
  min-height: 120px;
  line-height: 1.5;
}

code {
  padding: 2px 6px;
  background: #f1ece3;
  border-radius: 8px;
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .panel-grid.two, .card-grid, .button-row, .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
  }
}
