:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #2a2a2a;
  --muted: #6b6b6b;
  --line: #ebd9dc;
  --primary: #c1121f;
  --primary-dark: #a20f1a;
  --danger-bg: #fff2f4;
  --danger-border: #efbcc4;
  --danger-text: #8b1b28;
  --shadow: 0 10px 28px rgba(193, 18, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, #ffe2e7 0%, transparent 45%),
    radial-gradient(circle at 95% 5%, #ffecee 0%, transparent 34%),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: #ffffff;
  border-bottom: 2px solid #f1d4d9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand__logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.brand__text {
  display: grid;
  line-height: 1.15;
}

.brand__title {
  font-family: "Montserrat", sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.brand__subtitle {
  font-size: 14px;
  color: #777;
}

.container {
  max-width: 1400px;
  margin: 18px auto;
  padding: 0 16px 20px;
  display: grid;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.login-card {
  max-width: 420px;
  margin: 48px auto 0;
}

.guide-card {
  border-left: 6px solid #cf2b3a;
}

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

.kpi-period-note {
  margin-top: -6px;
  margin-bottom: 2px;
  font-size: 13px;
  color: #7a5f63;
}

.kpi-card {
  background: #fff;
  border: 1px solid #efd4d8;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.kpi-card__label {
  font-size: 13px;
  color: #7a676a;
}

.kpi-card__value {
  margin-top: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
}

.quick-card {
  display: grid;
  gap: 10px;
}

.filter-grow {
  flex: 1 1 360px;
}

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

.quick-row__label {
  font-size: 13px;
  color: #725e62;
}

.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid #e2c7cb;
  color: #6b4b4f;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
}

.chip--active {
  background: #c1121f;
  border-color: #a20f1a;
  color: #fff;
}

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

.chart-card {
  min-height: 0;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  max-height: 320px;
  overflow: hidden;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

h1,
h2 {
  margin: 0 0 12px;
  font-family: "Montserrat", sans-serif;
  color: #252525;
}

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

.error {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.form,
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.form--login {
  display: grid;
  gap: 10px;
}

.smart-captcha-box {
  min-height: 100px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input,
select {
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddc5c9;
  background: #fff;
  color: #2d2d2d;
}

input:focus,
select:focus {
  border-color: #cf4b5a;
  outline: none;
  box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.15);
}

.btn {
  padding: 10px 14px;
  border: 1px solid #ddb9bf;
  border-radius: 10px;
  background: #fff;
  color: #422e31;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-weight: 600;
}

.btn--primary {
  border-color: var(--primary-dark);
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-dark);
}

.btn--full {
  width: 100%;
}

.table-wrap {
  overflow: auto;
}

.compact-table {
  max-height: 360px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0dce0;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.row--active td {
  background: #fff6f7;
}

th {
  position: sticky;
  top: 0;
  background: #fff7f8;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.tag--new {
  color: #0d6832;
  background: #daf4e4;
}

.tag--changed {
  color: #7a4a00;
  background: #ffe9c8;
}

.tag--removed {
  color: #8a1f2d;
  background: #ffdce2;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 12px;
}

.pagination__meta {
  font-size: 13px;
  color: #6b5559;
}

.pagination__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn--small {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.btn--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5e484c;
}

.checkbox input[type="checkbox"] {
  min-width: auto;
  margin: 0;
}

@media (max-width: 900px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand__logo {
    width: 74px;
    height: 74px;
  }

  .brand__title {
    font-size: 22px;
  }

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

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card__value {
    font-size: 24px;
  }

  th,
  td {
    font-size: 12px;
  }
}
