:root {
  --bg: #f5f1e8;
  --panel: #fffdf7;
  --line: #dbcdb4;
  --text: #231b12;
  --muted: #6a5c4d;
  --accent: #c86432;
  --accent-dark: #8c3f1a;
  --green: #256c53;
  --red: #aa3d2a;
  --amber: #b17b22;
  --shadow: 0 18px 40px rgba(52, 34, 18, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(200,100,50,0.12), transparent 28%),
    linear-gradient(180deg, #f9f4eb 0%, var(--bg) 100%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
}
button, .primary-link, .ghost-link {
  background: var(--accent);
  color: #fff;
  padding: 0.82rem 1.15rem;
  border: none;
  cursor: pointer;
}
.ghost-btn, .ghost-link {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
input, select, textarea {
  width: 100%;
  background: #fff;
  padding: 0.8rem 0.95rem;
}
.shell-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  backdrop-filter: blur(18px);
  background: rgba(249, 244, 235, 0.88);
  border-bottom: 1px solid rgba(219, 205, 180, 0.65);
}
.brand {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}
.nav { display: flex; align-items: center; gap: 0.85rem; }
.user-pill {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: #efe4d2;
  color: var(--muted);
}
.page-shell { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.panel {
  background: var(--panel);
  border: 1px solid rgba(219, 205, 180, 0.8);
  border-radius: 28px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}
.wide-panel { padding: 1.8rem; }
.section-head, .detail-hero, .action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.section-head { margin-bottom: 1rem; }
.detail-hero { margin-bottom: 1rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent-dark);
}
.muted { color: var(--muted); }
.stats-grid, .detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1rem;
}
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card strong { display: block; font-size: 2rem; margin-top: 0.35rem; }
.filter-bar, .form-grid {
  display: grid;
  gap: 0.9rem;
}
.filter-bar { grid-template-columns: 2fr repeat(2, 1fr) auto; margin-bottom: 1rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.style-preset-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: 0.6rem;
}
.preset-card {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: 1rem;
  border: 1px solid rgba(219, 205, 180, 0.8);
  border-radius: 18px;
  background: #fff;
  min-height: 132px;
}
.preset-card input {
  width: auto;
  margin: 0;
}
.form-stack { display: grid; gap: 1rem; }
.task-grid, .asset-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.task-card, .asset-card {
  border: 1px solid rgba(219, 205, 180, 0.8);
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
}
.thumb-wrap {
  aspect-ratio: 1 / 1;
  background: #efe7d7;
}
.thumb-wrap img, .asset-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}
.task-copy, .asset-meta { padding: 1rem; }
.task-meta, .task-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  color: #fff;
}
.status-pending, .status-analyzing, .status-planning, .status-generating, .status-storing { background: var(--amber); }
.status-completed { background: var(--green); }
.status-failed { background: var(--red); }
.kv-list { display: grid; gap: 0.8rem; }
.kv-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #efe4d2;
  padding-bottom: 0.6rem;
}
.insight-box ul { margin-top: 0.4rem; }
.audit-box {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 18px;
  background: #f8f1e5;
}
.generation-list { display: grid; gap: 1rem; margin-top: 1rem; }
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.8rem 0.6rem;
  border-bottom: 1px solid #efe4d2;
}
.login-card {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.5rem;
  align-items: center;
  min-height: 78vh;
}
.hero-copy h1 { font-size: clamp(2.3rem, 4vw, 4.2rem); margin: 0.2rem 0 1rem; }
.error-box {
  background: #fde9e5;
  color: var(--red);
  padding: 0.8rem 1rem;
  border-radius: 14px;
}
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  padding: 1rem;
  border-radius: 14px;
}
@media (max-width: 960px) {
  .stats-grid, .detail-grid, .login-card, .filter-bar, .form-grid {
    grid-template-columns: 1fr;
  }
  .shell-header, .section-head, .detail-hero, .action-row, .nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-shell { padding: 1rem; }
}
