:root {
  --bg: #f4f7fb;
  --surface: #fff;
  --text: #172033;
  --muted: #5d6b82;
  --line: #dce3ee;
  --primary: #155eef;
  --success: #087a55;
  --warning: #9a6700;
  --danger: #b42318;
  --radius: 14px;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  line-height: 1.5;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #84adff;
  outline-offset: 2px;
}
.topbar {
  min-height: 64px;
  padding: 0 4vw;
  background: #10213f;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
}
.topbar nav {
  display: flex;
  gap: 20px;
}
.topbar nav a {
  color: #dbe7ff;
}
.readonly {
  margin-left: auto;
  color: #b7f0d8;
  font-size: 0.9rem;
}
.container {
  width: min(1440px, 94vw);
  margin: 0 auto;
  padding: 28px 0 64px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 20px;
}
.page-heading h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.1;
  margin: 0.2rem 0;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary) !important;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpis article,
.panel,
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(16, 33, 63, 0.04);
}
.kpis article {
  padding: 16px;
}
.kpis span,
.kpis strong {
  display: block;
}
.kpis span,
small {
  color: var(--muted);
  font-size: 0.78rem;
}
.kpis strong {
  font-size: 1.22rem;
  margin-top: 7px;
}
.panel {
  padding: 18px;
  margin-bottom: 16px;
}
.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}
.panel h2 {
  margin: 0 0 14px;
}
.panel-heading p {
  color: var(--muted);
  font-size: 0.85rem;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
}
th,
td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
th:first-child,
td:first-child {
  text-align: left;
}
td strong,
td small,
.promo-row small {
  display: block;
}
.status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1849a9;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.empty {
  text-align: center !important;
  color: var(--muted);
  padding: 30px !important;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-grid dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.detail-grid dd {
  font-weight: 700;
}
form label,
form p {
  display: block;
  margin-bottom: 14px;
}
input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px;
  border: 1px solid #98a2b3;
  border-radius: 8px;
  font: inherit;
}
button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.success {
  padding: 10px;
  border-radius: 8px;
  background: #eafaf3;
  color: var(--success);
}
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tabs a {
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.promo-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.promo-row small {
  display: block;
}
.login-card {
  max-width: 420px;
  margin: 8vh auto;
  padding: 28px;
}
.login-card h1 {
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 720px) {
  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .readonly {
    margin-left: 0;
  }
  .container {
    width: min(100% - 24px, 1440px);
    padding-top: 18px;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .table-wrap {
    overflow: visible;
  }
  table {
    min-width: 0;
  }
  thead {
    display: none;
  }
  tbody,
  tr,
  td {
    display: block;
  }
  tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 10px;
  }
  td {
    display: grid;
    grid-template-columns: 42% 58%;
    text-align: right;
    border: 0;
    padding: 7px;
  }
  td:before {
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
    font-size: 0.78rem;
  }
  .promo-row {
    grid-template-columns: 1fr;
  }
  .tabs {
    overflow: auto;
  }
}
input[type="date"],
input[type="search"],
select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px;
  border: 1px solid #98a2b3;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}
.filters label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.mini-chart {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 180px;
  overflow-x: auto;
  padding-top: 16px;
}
.bar-wrap {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  height: 100%;
  min-width: 22px;
}
.bar {
  display: block;
  min-height: 2px;
  background: #528bff;
  border-radius: 4px 4px 0 0;
}
.freshness {
  margin: 0;
}
.freshness div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.freshness dd {
  margin: 0;
  font-weight: 700;
}
.freshness dd,
.freshness dd form {
  display: flex;
  align-items: center;
  gap: 7px;
}
.text-button {
  min-height: auto;
  padding: 2px 5px;
  background: transparent;
  color: var(--primary);
  font-size: 0.74rem;
}
.alert {
  padding: 12px 14px;
  border: 1px solid #f5c26b;
  border-radius: 10px;
  background: #fff8e8;
  color: #6b4700;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.promo-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 3fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.promo-card small {
  display: block;
}
.promo-card dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin: 0;
}
.promo-card dt {
  color: var(--muted);
  font-size: 0.72rem;
}
.promo-card dd {
  margin: 3px 0 0;
  font-weight: 700;
}
.inline-economics {
  display: flex;
  gap: 4px;
  align-items: center;
}
.inline-economics input,
td > input[type="number"] {
  width: 72px;
  margin: 0;
  padding: 7px;
}
.inline-economics button {
  min-height: 34px;
  padding: 5px 9px;
}
@media (max-width: 900px) {
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .promo-card,
  .promo-card dl {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .filters {
    grid-template-columns: 1fr;
  }
  .promo-card,
  .promo-card dl {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
