:root {
  --bg: #f5efe4;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: #fffaf1;
  --line: rgba(76, 58, 36, 0.14);
  --line-strong: rgba(185, 95, 45, 0.28);
  --text: #1f1c18;
  --muted: #675b4d;
  --accent: #b95f2d;
  --accent-soft: #f4d7bf;
  --success: #275d4f;
  --success-soft: #d6eee7;
  --shadow: 0 24px 70px rgba(90, 54, 27, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(185, 95, 45, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(39, 93, 79, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf6eb 0%, var(--bg) 100%);
}

.page-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
}

.hero h1,
.panel h2,
.insight-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 4.25rem);
  line-height: 0.95;
  max-width: 10ch;
}

.lede,
.supporting-text {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}

.hero-panel {
  display: grid;
  gap: 12px;
  align-content: center;
}

.metric-pill,
.overview-card,
.sheet-card,
.summary-chip,
.insight-card,
.insight-note {
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.metric-pill {
  padding: 18px;
  border-radius: 20px;
}

.metric-pill span,
.search span,
.summary-label,
.field span,
.file-field span {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
}

.metric-pill strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.dashboard {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.analysis-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.insight-note,
.insight-card {
  border-radius: 22px;
}

.insight-note,
.insight-card,
.overview-card {
  padding: 18px;
}

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

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.92rem;
}

.bar-labels strong {
  color: var(--text);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #ead9c4;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #dd8b4f);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 160px;
}

.day-column {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.day-count,
.day-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.day-bar {
  width: 100%;
  min-height: 20px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, var(--success), #69a694);
}

.note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.overview-card {
  border-radius: 24px;
}

.overview-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
}

.overview-card p,
.insight-note p,
.sheet-card p,
.supporting-text,
.status-text {
  margin: 0;
  color: var(--muted);
}

.panel {
  padding: 24px;
  border-radius: 28px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.explorer-head {
  margin-top: 24px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.9fr);
  gap: 24px;
}

.search input,
.field input,
.field select,
.field textarea,
.file-field input,
#add-sheet-select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  color: var(--text);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.sheet-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.sheet-card {
  position: relative;
  padding: 18px;
  border-radius: 22px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.sheet-card:hover,
.sheet-card.active {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 36px rgba(185, 95, 45, 0.12);
}

.sheet-card h3 {
  margin: 6px 0 8px;
  font-size: 1.05rem;
}

.sheet-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.sheet-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-tag,
.local-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
}

.sheet-tag {
  background: var(--accent-soft);
  color: #6e3619;
}

.local-badge {
  background: var(--success-soft);
  color: #114739;
  font-weight: 700;
}

.summary-chip {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
}

.summary-value {
  display: block;
  margin-top: 6px;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

thead {
  position: sticky;
  top: 0;
  background: #f3e6d5;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.52);
}

.table-row-local {
  background: rgba(214, 238, 231, 0.45) !important;
}

.record-form {
  display: grid;
  gap: 18px;
}

.record-fields {
  display: grid;
  gap: 14px;
}

.field,
.file-field {
  display: grid;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-btn {
  border: none;
  color: white;
  background: linear-gradient(135deg, var(--accent), #dd8b4f);
  box-shadow: 0 14px 30px rgba(185, 95, 45, 0.2);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

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

.status-text {
  min-height: 24px;
}

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

@media (max-width: 1100px) {
  .analysis-notes,
  .overview-grid,
  .insight-grid,
  .workspace-grid,
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .site-footer,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }
}
