:root {
  --paper: #f3eee5;
  --ink: #17212b;
  --muted: #5d6a78;
  --accent-1: #0f766e;
  --accent-2: #c25522;
  --panel: #fffdf8;
  --line: rgba(23, 33, 43, 0.13);
  --shadow: 0 14px 32px rgba(23, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  background: radial-gradient(circle at 7% 8%, #e1f1ed 0%, transparent 35%),
    radial-gradient(circle at 92% 12%, #ffe0cd 0%, transparent 40%),
    linear-gradient(140deg, #f5f1e8 0%, #ede8dd 100%);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(23, 33, 43, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 43, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15));
}

.dashboard-shell {
  position: relative;
  z-index: 1;
  width: min(1150px, 92vw);
  margin: 1.3rem auto 2.4rem;
}

.hero-band {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
  background: linear-gradient(125deg, rgba(15, 118, 110, 0.17), rgba(194, 85, 34, 0.16));
  border: 1px solid rgba(23, 33, 43, 0.15);
  border-radius: 24px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}

.hero-main {
  padding: 0.35rem 0.4rem 0.2rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.brand-logo-image {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(23, 33, 43, 0.25);
}

.brand-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-logo-text strong {
  font-size: 0.95rem;
}

.brand-logo-text span {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

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

h1 {
  margin: 0.32rem 0 0;
  font-family: "Newsreader", serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.98;
}

.subtitle {
  margin: 0.68rem 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-weight: 500;
}

.hero-meta {
  align-self: stretch;
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
}

.hero-meta-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.hero-meta-foot {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.kpi-strip {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
  animation: rise 0.62s ease both;
}

.kpi-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.kpi-card h2 {
  margin: 0.38rem 0 0;
  font-size: clamp(1.2rem, 2vw, 1.74rem);
}

.chart-layout {
  margin-top: 0.95rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.85rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.9rem 0.9rem 0.72rem;
  min-height: 240px;
  animation: rise 0.65s ease both;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel canvas {
  width: 100% !important;
  height: 185px !important;
}

.panel-trend {
  grid-column: span 8;
  min-height: 300px;
}

.panel-trend canvas {
  height: 230px !important;
}

.panel-region,
.panel-status,
.panel-products,
.panel-segment {
  grid-column: span 4;
}

.table-panel {
  margin-top: 0.95rem;
  min-height: 0;
}

.table-wrap {
  overflow-x: auto;
}

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

thead th {
  text-align: left;
  padding: 0.6rem 0.46rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}

tbody td {
  padding: 0.6rem 0.46rem;
  border-bottom: 1px dashed rgba(23, 33, 43, 0.14);
}

tbody tr:hover {
  background: rgba(15, 118, 110, 0.07);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trend-form {
  margin: 0;
}

.trend-select {
  width: 100%;
  border: 1px solid rgba(23, 33, 43, 0.2);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.42rem 0.6rem;
}

.trend-select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.34);
  outline-offset: 2px;
}

.chart-style-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.79rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero-band {
    grid-template-columns: 1fr;
  }

  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-trend {
    grid-column: span 12;
  }

  .panel-region,
  .panel-status,
  .panel-products,
  .panel-segment {
    grid-column: span 6;
  }
}

@media (max-width: 720px) {
  .dashboard-shell {
    width: 95vw;
    margin-top: 1rem;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .panel-region,
  .panel-status,
  .panel-products,
  .panel-segment {
    grid-column: span 12;
  }

  .panel {
    min-height: 220px;
  }

  .panel canvas {
    height: 168px !important;
  }

  .panel-trend canvas {
    height: 180px !important;
  }
}
