﻿:root {
  --bg: #f3efe5;
  --panel: rgba(255, 252, 245, 0.82);
  --panel-strong: #fffaf0;
  --text: #1f2521;
  --muted: #5d645f;
  --line: rgba(42, 52, 46, 0.12);
  --accent: #0b6e4f;
  --accent-strong: #084c38;
  --danger: #a63d40;
  --shadow: 0 22px 50px rgba(45, 49, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(184, 132, 64, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(11, 110, 79, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f7f2e8 100%);
}

.page-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

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

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

h1, h2, p {
  margin-top: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.98;
  max-width: 12ch;
  margin-bottom: 18px;
}

.hero-copy {
  max-width: 62ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-panel,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.upload-card {
  border: 2px dashed rgba(11, 110, 79, 0.28);
  background: linear-gradient(135deg, rgba(11, 110, 79, 0.08), rgba(184, 132, 64, 0.08));
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.upload-card.dragover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(11, 110, 79, 0.12), rgba(184, 132, 64, 0.14));
}

input[type="file"] {
  display: none;
}

.upload-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
}

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

.secondary-button {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--line);
}

.layout,
.controls-panel {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 20px;
}

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

.search-wide {
  grid-column: span 2;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

input[type="date"],
input[type="search"],
input[type="number"],
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.status-card {
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.85);
  border: 1px solid var(--line);
  color: var(--muted);
}

.file-list,
.mini-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.file-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(11, 110, 79, 0.1);
  border: 1px solid rgba(11, 110, 79, 0.16);
  font-size: 13px;
}

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

.kpi-card {
  min-height: 156px;
}

.kpi-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.kpi-value {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 10px;
}

.kpi-note,
.panel-head p,
.product-meta {
  color: var(--muted);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}

.panel-head {
  margin-bottom: 16px;
}

.chart-host {
  min-height: 320px;
}

.empty-chart {
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bar-label,
.axis-label,
.point-label {
  fill: var(--muted);
  font-size: 12px;
}

.line-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.line-area {
  fill: rgba(11, 110, 79, 0.14);
}

.point-dot {
  fill: var(--accent-strong);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1160px;
  background: rgba(255, 255, 255, 0.92);
}

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

th {
  position: sticky;
  top: 0;
  background: #faf3e6;
  font-size: 13px;
  cursor: pointer;
  z-index: 1;
}

th:last-child {
  cursor: default;
}

tbody tr:hover {
  background: rgba(11, 110, 79, 0.04);
}

.product-name {
  font-weight: 600;
}

.product-meta {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.cost-input {
  max-width: 110px;
}

.positive {
  color: var(--accent-strong);
}

.negative {
  color: var(--danger);
}

.placeholder-cell {
  text-align: center;
  color: var(--muted);
  padding: 28px;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 1180px) {
  .hero,
  .charts-grid,
  .kpi-grid,
  .status-row,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .search-wide {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 1400px);
    padding-top: 14px;
  }

  h1 {
    max-width: none;
  }

  .hero-panel,
  .panel {
    padding: 16px;
  }

  .mini-actions,
  .pagination-row {
    justify-content: stretch;
  }

  .mini-actions > *,
  .pagination-row > * {
    flex: 1 1 auto;
  }
}
