:root {
  --ink: #181614;
  --muted: #77726a;
  --paper: #fbfaf7;
  --line: rgba(31, 28, 23, 0.1);
  --gold: #a4894d;
  --soft: rgba(255, 255, 255, 0.68);
  --shadow: 0 28px 90px rgba(42, 34, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.95), transparent 24rem),
    radial-gradient(circle at 50% 76%, rgba(164, 137, 77, 0.1), transparent 30rem),
    linear-gradient(135deg, #ffffff 0%, #faf8f3 46%, #f1ece2 100%);
}

button,
input,
select,
a {
  font: inherit;
}

.report-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.side {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 30px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 34px;
  line-height: 1;
}

.upload,
.button,
.plain {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(180deg, #24211d, #11100f);
  box-shadow: 0 16px 34px rgba(17, 16, 15, 0.16);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.upload input {
  display: none;
}

.plain {
  min-height: 38px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  border: 1px solid var(--line);
}

.button.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
  border: 1px solid var(--line);
}

.message {
  min-height: 22px;
  margin: 0;
  color: var(--gold);
  font-weight: 700;
}

.history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history button,
.panel,
.kpi,
.categories button,
.empty {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  box-shadow: 0 12px 30px rgba(42, 34, 21, 0.05);
}

.history button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history span,
.history small,
.top span,
.kpi span,
.categories span,
.categories small {
  color: var(--muted);
}

.content {
  min-width: 0;
  padding: 30px;
}

.hidden {
  display: none !important;
}

.empty {
  min-height: calc(100vh - 60px);
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 34px;
  text-align: center;
}

.empty p:last-child {
  max-width: 560px;
  color: var(--muted);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.top h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi,
.panel {
  padding: 16px;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 17px;
}

.panel {
  margin-bottom: 18px;
}

.panel-head,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-note {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.analytics-panel {
  background: rgba(255, 252, 245, 0.78);
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.analytics-card {
  min-height: 92px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.analytics-card span {
  color: var(--muted);
  font-weight: 700;
}

.analytics-card strong {
  font-size: 20px;
  line-height: 1.1;
}

.analytics-card[data-kind="count"] strong {
  color: #9b3830;
}

.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.categories button {
  min-height: 116px;
  display: grid;
  gap: 5px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.categories button.active {
  border-color: rgba(164, 137, 77, 0.42);
  background: rgba(255, 250, 237, 0.92);
}

.categories b {
  font-size: 19px;
}

.toolbar input {
  width: min(460px, 100%);
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.74);
}

.table-wrap {
  max-height: 58vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.64);
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0eadf;
}

td:last-child {
  min-width: 420px;
}

.review-status {
  color: #9b3830;
  font-weight: 800;
}

select {
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px;
  background: #fff;
}

.negative {
  color: #9b3830;
  font-weight: 800;
}

.positive {
  color: #2d6d45;
  font-weight: 800;
}

@media (max-width: 980px) {
  .report-app {
    grid-template-columns: 1fr;
  }

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .top {
    align-items: stretch;
    flex-direction: column;
  }
}
