:root {
  --bg: #f3ecde;
  --surface: rgba(255, 251, 245, 0.92);
  --surface-strong: #fffdf9;
  --sidebar: linear-gradient(180deg, #203b5d 0%, #15263d 100%);
  --accent: #ba633a;
  --accent-strong: #9f4d2a;
  --text: #1f2b37;
  --muted: #697482;
  --line: rgba(24, 38, 55, 0.1);
  --success: #2f855a;
  --shadow: 0 16px 38px rgba(28, 38, 54, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(240, 179, 93, 0.24), transparent 22%),
    radial-gradient(circle at bottom right, rgba(186, 99, 58, 0.16), transparent 18%),
    var(--bg);
  color: var(--text);
}

a {
  text-decoration: none;
}

.layout {
  height: 100vh;
  max-height: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
}

.sidebar {
  height: 100%;
  min-height: 0;
  padding: 28px 18px;
  background: var(--sidebar);
  color: #edf2fb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar .brand {
  flex-shrink: 0;
}

.sidebar .nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f0b35d, #f6d08d);
  color: #1e2937;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand h1,
.brand p,
.main h2,
.main h3 {
  margin: 0;
}

.brand p {
  margin-top: 4px;
  color: rgba(237, 242, 251, 0.72);
}

.nav-group {
  margin: 18px 12px 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(237, 242, 251, 0.5);
}

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

.nav-link {
  color: inherit;
  padding: 13px 15px;
  border-radius: 16px;
  transition: background-color 180ms ease, transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(3px);
}

.main {
  padding: 28px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.topbar,
.module-header,
.panel-head,
.hero,
.content-grid,
.stats-grid {
  display: grid;
  gap: 20px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-badge,
.summary-box,
.stack-item,
.stat-card,
.flash,
.button,
.status {
  border-radius: 18px;
}

.topbar-badge,
.summary-box {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: var(--shadow);
  padding: 12px 16px;
}

.stat-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  padding: 18px;
}

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

.stat-card.accent {
  background: linear-gradient(135deg, var(--accent), #d49460);
  color: #fff8f1;
  border-color: transparent;
}

.flash {
  padding: 12px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  font-size: 14px;
}

.flash.error {
  background: rgba(197, 48, 48, 0.12);
  color: #c53030;
  border-color: rgba(197, 48, 48, 0.3);
}

.button {
  border: 0;
  border-radius: 18px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 180ms ease;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.secondary {
  background: rgba(24, 38, 55, 0.08);
  color: var(--text);
}

.button.secondary:hover {
  background: rgba(24, 38, 55, 0.14);
}

.panel,
.hero-panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-copy {
  margin-top: 10px;
  color: var(--muted);
  max-width: 520px;
}

.panel-header,
.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.content-grid,
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stats-grid {
  gap: 16px;
}

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

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.tag,
.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.tag.success,
.status.confirmed {
  background: rgba(47, 133, 90, 0.14);
  color: var(--success);
}

.tag.warning,
.status.pending {
  background: rgba(183, 121, 31, 0.14);
  color: #b7791f;
}

.tag.danger {
  background: rgba(197, 48, 48, 0.14);
  color: #c53030;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 48px;
  align-items: center;
  gap: 12px;
}

.bar {
  height: 12px;
  background: rgba(24, 38, 55, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f0b35d);
}

.marketing-grid,
.content-grid.grid-wide {
  grid-template-columns: 1fr;
}

.mini-button,
.danger-button {
  border: 0;
  border-radius: 14px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}

.mini-button {
  background: rgba(24, 38, 55, 0.08);
  color: var(--text);
}

.danger-button {
  background: rgba(197, 48, 48, 0.12);
  color: #c53030;
}

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

.empty-inline {
  color: var(--muted);
  font-size: 14px;
}

.module-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1180px) {
  .layout,
  .content-grid,
  .stats-grid,
  .hero,
  .module-header,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }
}
