:root {
  --bg: #edf1f5;
  --bg-deep: #0b1420;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #ffffff;
  --ink: #17202a;
  --muted: #687789;
  --line: #dbe2ea;
  --line-strong: #c8d2dc;
  --green: #166f5b;
  --green-soft: #e3f2ed;
  --red: #b8463f;
  --red-soft: #f8e5e2;
  --blue: #315f96;
  --blue-soft: #e4edf9;
  --gold: #b7832f;
  --gold-soft: #fff1d6;
  --purple: #5b4ea3;
  --shadow: 0 24px 70px rgba(21, 34, 50, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(49, 95, 150, 0.12), transparent 34rem),
    linear-gradient(135deg, #f4f7fa 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0)),
    #101d2f;
  color: #f8fbff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f5c46d, #bd8734);
  color: #101d2f;
  font-weight: 900;
  letter-spacing: -0.04em;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.22);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand span {
  color: #b9c6d5;
  font-size: 13px;
  margin-top: 3px;
}

.nav-stack {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #d9e3ee;
  border-radius: 14px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  min-height: 46px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(2px);
}

.icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #f3c77a;
}

.sidebar-note {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 16px;
  color: #dce6f1;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #f3c77a;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.sidebar-note strong {
  font-size: 13px;
  line-height: 1.45;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.09em;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

h2 {
  font-size: 18px;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.scope-switch {
  display: inline-flex;
  background: #dde5ee;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px;
  min-width: 285px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.scope-option {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  min-height: 39px;
  padding: 0 14px;
  font-weight: 900;
  color: #5f6d7a;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.scope-option.active {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.14);
}

.global-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(219, 226, 234, 0.9);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
}

.view {
  display: none;
  animation: fadeUp 0.22s ease both;
}

.view.active {
  display: block;
}

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

.metric,
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 226, 234, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
  min-height: 136px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(49, 95, 150, 0.08);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric span {
  font-weight: 800;
}

.metric strong {
  display: block;
  margin: 12px 0 8px;
  font-size: clamp(22px, 3vw, 29px);
  letter-spacing: -0.04em;
}

.metric.positive strong,
.amount-income {
  color: var(--green);
}

.metric.negative strong,
.amount-expense {
  color: var(--red);
}

.metric.warning strong {
  color: var(--gold);
}

.content-grid,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}

.wide {
  grid-column: 1 / -1;
}

.panel {
  padding: 20px;
  min-width: 0;
}

.form-panel {
  max-width: 980px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  align-items: flex-start;
}

.panel-header p {
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.45;
}

.import-meta {
  min-width: 340px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

.bar-list,
.mini-feed,
.entry-form,
.rule-list,
.quality-list,
.audit-list {
  display: grid;
  gap: 12px;
}

.bar-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 116px;
  align-items: center;
  gap: 12px;
}

.bar-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  background: #e6edf3;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #6e8fb8);
  min-width: 4px;
  transition: width 0.28s ease;
}

.compact .bar-item {
  grid-template-columns: 130px minmax(0, 1fr) 110px;
}

.cashflow-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(54px, 1fr));
  gap: 12px;
  min-height: 260px;
  align-items: end;
  overflow-x: auto;
  padding: 12px 4px 2px;
}

.month-column {
  display: grid;
  align-items: end;
  gap: 8px;
  min-height: 220px;
}

.month-bars {
  height: 170px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.month-bar {
  width: 15px;
  border-radius: 999px 999px 4px 4px;
  min-height: 4px;
  transition: height 0.28s ease, transform 0.16s ease;
}

.month-bar:hover {
  transform: translateY(-2px);
}

.month-bar.income {
  background: var(--green);
}

.month-bar.expense {
  background: var(--red);
}

.month-label {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.month-result {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.feed-item,
.rule-card,
.quality-item,
.audit-item,
.preview-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.feed-item strong,
.feed-item span {
  display: block;
}

.feed-item span,
.entry-date,
.meta-text {
  color: var(--muted);
  font-size: 13px;
}

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

.span-2 {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: #3d4650;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  min-height: 42px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 95, 152, 0.12);
  background: #ffffff;
}

.primary-action,
.secondary-action,
.danger-action,
.file-action {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-action:hover,
.secondary-action:hover,
.danger-action:hover,
.file-action:hover {
  transform: translateY(-1px);
}

.primary-action {
  background: linear-gradient(135deg, var(--green), #1f806c);
  color: #ffffff;
  box-shadow: 0 14px 22px rgba(22, 111, 91, 0.18);
}

.secondary-action {
  background: #e4ebf2;
  color: #24313d;
}

.danger-action {
  background: var(--red-soft);
  color: #8f2f2a;
}

.file-action {
  position: relative;
  background: var(--blue-soft);
  color: #243f68;
  overflow: hidden;
}

.file-action input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.icon-button {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
}

.upload-zone {
  position: relative;
  border: 1px dashed #8d9aa8;
  border-radius: var(--radius);
  padding: 34px 18px;
  display: grid;
  place-items: center;
  gap: 8px;
  background: #fbfdff;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone span {
  color: var(--muted);
}

.upload-zone.is-dragging {
  border-color: var(--green);
  background: var(--green-soft);
  transform: scale(1.006);
}

.import-actions,
.filter-row,
.bulk-bar,
.action-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.import-actions {
  margin: 14px 0;
}

.preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.preview-badge {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-soft);
}

.preview-badge strong,
.preview-badge span {
  display: block;
}

.preview-badge span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.filter-row input {
  min-width: 250px;
}

.filter-row select {
  width: 165px;
}

.bulk-bar {
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.bulk-bar input,
.bulk-bar select {
  width: 170px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

.preview-table {
  min-width: 1580px;
}

.transactions-table {
  min-width: 1180px;
}

.data-table th,
.data-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f7f9fb;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table input,
.data-table select {
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 10px;
}

.amount-income,
.amount-expense,
.amount-transfer {
  font-weight: 900;
  white-space: nowrap;
}

.amount-transfer {
  color: var(--purple);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.income,
.pill.new,
.pill.reviewed,
.pill.high,
.pill.pj {
  color: var(--green);
  background: var(--green-soft);
}

.pill.expense,
.pill.error,
.pill.duplicated,
.pill.duplicate-high,
.pill.pf {
  color: var(--red);
  background: var(--red-soft);
}

.pill.transfer,
.pill.pending,
.pill.medium,
.pill.duplicate-medium {
  color: var(--gold);
  background: var(--gold-soft);
}

.pill.low,
.pill.ignored,
.pill.all,
.pill.duplicate-low {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.row-action {
  border: 0;
  background: #eef3f8;
  color: #27465f;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 10px;
  font-weight: 900;
}

.row-action.danger {
  color: #9f342e;
  background: var(--red-soft);
}

.empty-cell,
.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 28px 10px;
}

.rule-card {
  align-items: flex-start;
}

.rule-card > div {
  min-width: 0;
}

.rule-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.rule-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audit-list {
  max-height: 430px;
  overflow: auto;
}

.audit-item,
.quality-item {
  align-items: flex-start;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 21, 0.58);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(860px, 100%);
  max-height: min(880px, calc(100vh - 40px));
  overflow: auto;
  background: var(--surface);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.22s ease both;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  background: #101d2f;
  color: #ffffff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    gap: 16px;
  }

  .nav-stack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .summary-grid,
  .content-grid,
  .split-layout {
    grid-template-columns: 1fr 1fr;
  }

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

  .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .panel-header,
  .admin-header,
  .import-header {
    display: grid;
  }

  .scope-switch {
    width: 100%;
    min-width: 0;
  }

  .summary-grid,
  .content-grid,
  .split-layout,
  .grid-form,
  .global-filters,
  .preview-summary,
  .import-meta {
    grid-template-columns: 1fr;
  }

  .nav-stack {
    grid-template-columns: 1fr 1fr;
  }

  .bar-item,
  .compact .bar-item {
    grid-template-columns: 1fr;
  }

  .cashflow-chart {
    grid-template-columns: repeat(12, 64px);
  }

  .filter-row input,
  .filter-row select,
  .bulk-bar input,
  .bulk-bar select {
    width: 100%;
    min-width: 0;
  }

  .primary-action,
  .secondary-action,
  .danger-action,
  .file-action {
    width: 100%;
  }
}


.money-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.entry-form select#expensePresetInput {
  font-weight: 700;
}

.amount-income,
.amount-expense,
.amount-transfer,
.metric strong,
.preview-badge strong,
.quality-item strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Módulos complementares: recorrências, contas e projeção */
.recurring-header {
  align-items: center;
}

.recurring-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.recurring-tools label {
  min-width: 150px;
}

.recurring-list,
.account-summary-list {
  display: grid;
  gap: 12px;
}

.recurring-card,
.account-summary-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(0, 2fr) auto;
  gap: 14px;
  align-items: center;
}

.recurring-title strong,
.account-summary-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.recurring-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.recurring-fields label {
  font-size: 11px;
}

.recurring-fields input,
.recurring-fields select {
  height: 38px;
  padding: 0 10px;
}

.recurring-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.account-summary-card {
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(120px, 0.7fr));
}

.account-summary-metric {
  display: grid;
  gap: 3px;
}

.account-summary-metric span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.account-summary-metric strong {
  font-size: 14px;
  margin: 0;
}

@media (max-width: 980px) {
  .recurring-card,
  .account-summary-card {
    grid-template-columns: 1fr;
  }

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

  .recurring-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .recurring-fields {
    grid-template-columns: 1fr;
  }
}

/* Dashboard avançado */
.global-filters {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.global-filters .secondary-action {
  min-height: 44px;
}

.dashboard-toolbar {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(219, 226, 234, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 48px rgba(21, 34, 50, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-toolbar strong,
.dashboard-toolbar span {
  display: block;
}

.dashboard-toolbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-period-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e7edf4;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.period-option {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.period-option.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(31, 45, 61, 0.12);
}

.cashflow-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 6px;
}

.cashflow-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.income { background: var(--green); }
.legend-dot.expense { background: var(--red); }
.legend-dot.result { background: var(--blue); }

.month-bars.enhanced {
  gap: 4px;
}

.month-bar.result.positive {
  background: var(--blue);
}

.month-bar.result.negative {
  background: var(--gold);
}

.month-count {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.cashflow-chart.weekly-mode {
  grid-template-columns: repeat(10, minmax(62px, 1fr));
}

.cashflow-chart.annual-mode {
  grid-template-columns: repeat(5, minmax(96px, 1fr));
}

.rank-list,
.health-list {
  display: grid;
  gap: 10px;
}

.rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 14px;
}

.rank-index {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 900;
}

.rank-item strong,
.rank-item span {
  display: block;
}

.rank-item div strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item div span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.health-item {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  background: var(--surface-soft);
}

.health-item span,
.health-item small {
  display: block;
  color: var(--muted);
}

.health-item span {
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.health-item strong {
  display: block;
  margin: 7px 0 4px;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.health-item.good strong { color: var(--green); }
.health-item.warn strong { color: var(--gold); }
.health-item.bad strong { color: var(--red); }

@media (max-width: 980px) {
  .dashboard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-period-switch {
    width: 100%;
  }
  .period-option {
    flex: 1;
  }
  .rank-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .rank-item > strong:last-child {
    grid-column: 2;
  }
}
