.dashboard-shell {
  display: grid;
  gap: 14px;
}

.dashboard-topbar {
  margin-bottom: 0;
}

.dashboard-user-link {
  gap: 8px;
}

.dashboard-metrics {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.dashboard-metrics.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-metrics.is-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-metric {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.dashboard-metric:last-child {
  border-right: 0;
}

.dashboard-metric:hover,
.dashboard-metric:focus-visible {
  background: var(--primary-soft);
  outline: none;
}

.dashboard-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-metric strong {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric.is-alert strong {
  color: #c93820;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.dashboard-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 290px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-links-panel {
  grid-column: 1 / -1;
  min-height: 0;
}

.dashboard-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: #faf8f5;
}

.dashboard-panel-heading > div {
  min-width: 0;
}

.dashboard-panel-heading span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.dashboard-panel-heading h2 {
  margin: 4px 0 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.dashboard-panel-heading > a {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.dashboard-panel-heading > a:hover,
.dashboard-panel-heading > a:focus-visible {
  color: var(--primary);
  outline: none;
}

.dashboard-panel-heading > a span {
  margin-left: 3px;
  font-size: 18px;
  line-height: 0;
}

.dashboard-panel-list {
  min-width: 0;
}

.dashboard-list-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.dashboard-list-row:last-child {
  border-bottom: 0;
}

.dashboard-list-row:hover,
.dashboard-list-row:focus-visible {
  background: #fafcfb;
  outline: none;
}

.dashboard-list-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-list-copy strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-list-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #89ab98;
}

.dashboard-status-dot.is-today {
  background: var(--accent);
}

.dashboard-status-dot.is-overdue {
  background: #c93820;
  box-shadow: 0 0 0 4px rgba(201, 56, 32, 0.1);
}

.dashboard-row-arrow {
  color: #aaa198;
  font-size: 22px;
  line-height: 1;
}

.dashboard-calendar-row {
  grid-template-columns: 86px minmax(0, 1fr) auto;
}

.dashboard-calendar-time {
  overflow: hidden;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-subscription-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.dashboard-subscription-row .subscription-service-mark {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.dashboard-list-value {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-note-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.dashboard-note-date {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-link-row {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.dashboard-link-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #c9ded2;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-empty {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 860px) {
  .dashboard-metrics.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metrics.is-four .dashboard-metric:nth-child(2) {
    border-right: 0;
  }

  .dashboard-metrics.is-four .dashboard-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    gap: 12px;
  }

  .dashboard-metrics.is-three,
  .dashboard-metrics.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metric {
    min-height: 78px;
    padding: 14px;
  }

  .dashboard-metric:nth-child(2n) {
    border-right: 0;
  }

  .dashboard-metrics.is-three .dashboard-metric:nth-child(-n + 2),
  .dashboard-metrics.is-four .dashboard-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-metrics.is-three .dashboard-metric:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-metric strong {
    font-size: 17px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-panel {
    min-height: 0;
  }

  .dashboard-panel-heading {
    padding: 16px;
  }

  .dashboard-panel-heading h2 {
    font-size: 19px;
  }

  .dashboard-list-row {
    min-height: 60px;
    padding: 10px 14px;
  }

  .dashboard-calendar-row {
    grid-template-columns: 70px minmax(0, 1fr) auto;
  }

  .dashboard-list-value {
    font-size: 12px;
  }

  .dashboard-empty {
    min-height: 120px;
  }
}

@media (max-width: 380px) {
  .dashboard-calendar-row {
    grid-template-columns: 12px minmax(0, 1fr) auto;
  }

  .dashboard-calendar-time {
    width: 9px;
    height: 9px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary);
    color: transparent;
  }

  .dashboard-subscription-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .dashboard-subscription-row .dashboard-list-value {
    grid-column: 2;
  }
}
