.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
  font-size: 2rem;
}

.page-header .subtitle {
  color: var(--text-muted, #6b7280);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--card-shadow, 0 10px 25px -20px rgba(59, 130, 246, 0.45));
}

.metric-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: #1f2937;
}

.metric-card .metric {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
}

.metric-card .hint {
  color: var(--text-muted, #6b7280);
  font-size: 0.85rem;
}

.panel {
  margin-bottom: 2rem;
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow, 0 10px 25px -20px rgba(59, 130, 246, 0.45));
}

.chart-container {
  width: 100%;
  min-height: 320px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #475569;
}

.chart-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.chart-legend .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.breakdown-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.breakdown-panel h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.breakdown-item {
  background: #ffffff;
  border-radius: 0.6rem;
  padding: 0.75rem;
  box-shadow: 0 18px 40px -32px rgba(15, 23, 42, 0.45);
}

.breakdown-item h5 {
  margin: 0 0 0.4rem 0;
  font-size: 0.85rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.breakdown-item p {
  margin: 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.headline-figure {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

.mini-table th,
.mini-table td {
  padding: 0.15rem 0;
}

.mini-table th {
  text-align: left;
  font-weight: 500;
  color: #1f2937;
  padding-right: 0.75rem;
}

.mini-table td {
  text-align: right;
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.mini-table td.numeric {
  text-align: right;
}

.mini-table tr:not(:last-child) td,
.mini-table tr:not(:last-child) th {
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.mini-table tr:last-child td,
.mini-table tr:last-child th {
  padding-bottom: 0.35rem;
}

.mini-table + .mini-table {
  margin-top: 0.6rem;
}

.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metrics-strip .metric-card {
  flex: 1 1 180px;
  min-width: 180px;
  padding: 1rem;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.breakdown-item ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: #64748b;
  font-size: 0.85rem;
}

.breakdown-item ul li {
  margin-bottom: 0.25rem;
}

.breakdown-item .micro-detail {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #475569;
}

.micro-detail.muted {
  color: #94a3b8;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle span {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5f5;
  transition: 0.2s;
  border-radius: 20px;
}

.toggle span:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle input:checked + span {
  background-color: #f97316;
}

.toggle input:checked + span:before {
  transform: translateX(18px);
}

.panel header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.data-table thead th {
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #6b7280;
  letter-spacing: 0.05em;
  text-align: left;
  padding-right: 1rem;
}

.data-table thead th.numeric {
  text-align: right;
}

.data-table th.numeric,
.data-table td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table tr.table-total {
  background: #e2e8f0;
  font-weight: 600;
  color: #0f172a;
}

.data-table tr.table-total td {
  border-top: 2px solid #cbd5f5;
}

.tag {
  display: inline-flex;
  align-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag--action {
  border: none;
  cursor: pointer;
  background: #e0f2fe;
  color: #0c4a6e;
  padding: 0.2rem 0.7rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.tag--action:hover,
.tag--action:focus {
  background: #bae6fd;
  color: #075985;
  outline: none;
}

.tag.is-hidden {
  display: none;
}

.tag-input {
  min-width: 8rem;
  max-width: 14rem;
  border: 1px solid #cbd5f5;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tag-input:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  outline-offset: 1px;
}

.data-table td.detail-cell {
  max-width: 22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1f2937;
}

.data-table tr.is-excluded {
  opacity: 0.6;
}

.data-table tr.is-excluded .tag--action {
  background: #f1f5f9;
  color: #475569;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed #cbd5f5;
  border-radius: 0.75rem;
  background: #f8fafc;
}

@media (max-width: 768px) {
  .panel {
    padding: 1.1rem;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.chart--small {
  min-height: 260px;
}

.dividend-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .dividend-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }
}

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

.table-wrapper .data-table {
  min-width: 520px;
}

.decimal-0 {
  width: 120px;
}
