:root {
  --bg: #f4efe3;
  --bg-strong: #efe2ba;
  --panel: rgba(255, 252, 245, 0.88);
  --panel-strong: #fffaf0;
  --ink: #19312d;
  --ink-soft: #46615c;
  --accent: #f0b434;
  --accent-deep: #d48900;
  --teal: #0c7b74;
  --teal-soft: rgba(12, 123, 116, 0.12);
  --rose: #a74f43;
  --border: rgba(25, 49, 45, 0.14);
  --shadow: 0 22px 60px rgba(48, 42, 24, 0.14);
  --radius: 22px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(240, 180, 52, 0.28), transparent 34%),
    radial-gradient(circle at top right, rgba(12, 123, 116, 0.18), transparent 28%),
    linear-gradient(160deg, #f8f3e8 0%, #efe2ba 50%, #f4efe3 100%);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
}

p {
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.topbar h1,
.hero-card h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.04em;
}

.topbar-copy {
  max-width: 720px;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.eyebrow,
.small-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}

.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(25, 49, 45, 0.12);
}

.overview-grid,
.workspace-grid {
  display: grid;
  gap: 20px;
}

.overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.workspace-grid {
  grid-template-columns: minmax(260px, 0.95fr) minmax(420px, 1.4fr) minmax(320px, 1fr);
  align-items: start;
}

.panel,
.overview-card,
.login-card,
.hero-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.overview-card,
.panel,
.login-card,
.hero-card {
  padding: 22px;
}

.accent-card {
  background: linear-gradient(160deg, rgba(240, 180, 52, 0.24), rgba(255, 252, 245, 0.9));
}

.simple-list {
  margin: 12px 0 0 18px;
  padding: 0;
  color: var(--ink-soft);
}

.panel-header,
.subsection-header,
.dropzone-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.split-header {
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.field-search-shell {
  margin: 18px 0 10px;
}

.field-palette {
  display: grid;
  gap: 10px;
  max-height: 66vh;
  overflow: auto;
  padding-right: 4px;
}

.field-chip,
.selected-chip,
.saved-report-card,
.status-banner,
.filter-row,
.dropzone {
  border-radius: var(--radius-sm);
}

.field-chip {
  border: 1px solid rgba(25, 49, 45, 0.12);
  background: linear-gradient(180deg, #fffdf8, #f4f0e4);
  padding: 12px 14px;
  cursor: grab;
}

.field-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(12, 123, 116, 0.35);
}

.field-chip.dragging {
  opacity: 0.55;
}

.field-chip-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.field-chip small,
.saved-report-card small {
  color: var(--ink-soft);
}

.type-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: var(--teal-soft);
  color: var(--teal);
}

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

.dropzone {
  border: 1px dashed rgba(25, 49, 45, 0.18);
  background: rgba(255, 255, 255, 0.52);
  padding: 16px;
}

.dropzone.over {
  border-color: var(--teal);
  background: rgba(12, 123, 116, 0.08);
}

.chip-zone,
.filters-container,
.saved-reports {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.selected-chip,
.saved-report-card,
.filter-row {
  background: var(--panel-strong);
  border: 1px solid rgba(25, 49, 45, 0.12);
  padding: 12px 14px;
}

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

.selected-chip strong {
  display: block;
  font-size: 0.95rem;
}

.selected-chip-actions,
.saved-report-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.builder-subsection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(25, 49, 45, 0.1);
}

.filter-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.text-input,
.select-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(25, 49, 45, 0.14);
  background: rgba(255, 255, 255, 0.86);
  padding: 11px 12px;
  color: var(--ink);
}

.text-input.slim {
  width: 96px;
}

.limit-shell {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.primary-button,
.ghost-button,
.link-button,
.danger-button {
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.primary-button,
.ghost-button,
.danger-button {
  padding: 11px 14px;
}

.primary-button {
  background: linear-gradient(135deg, var(--teal), #0ea89f);
  color: white;
}

.primary-button.secondary-tone {
  background: linear-gradient(135deg, #ca7c08, var(--accent));
}

.ghost-button {
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  border: 1px solid rgba(25, 49, 45, 0.12);
}

.link-button,
.danger-button {
  background: transparent;
  color: var(--rose);
  padding: 0;
}

.primary-button:hover,
.ghost-button:hover,
.link-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.status-banner {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(25, 49, 45, 0.1);
  margin-bottom: 14px;
}

.preview-meta {
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.table-shell {
  overflow: auto;
  max-height: 72vh;
  border-radius: 18px;
  border: 1px solid rgba(25, 49, 45, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--ink-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(25, 49, 45, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f9f4e9;
  font-family: "Manrope", sans-serif;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.login-body {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}

.hero-card {
  padding: 34px;
  background: linear-gradient(155deg, rgba(12, 123, 116, 0.12), rgba(255, 250, 240, 0.94));
}

.hero-copy {
  font-size: 1.08rem;
  max-width: 42ch;
}

.hero-points {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.hero-points span {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(25, 49, 45, 0.1);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
}

.error-banner {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(167, 79, 67, 0.1);
  color: var(--rose);
  border: 1px solid rgba(167, 79, 67, 0.18);
}

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

@media (max-width: 760px) {
  .page-shell {
    padding: 16px;
  }

  .topbar,
  .panel-header,
  .subsection-header,
  .dropzone-grid {
    display: grid;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .selected-chip {
    display: grid;
  }
}
