:root {
  --bg: #faf7ff;
  --panel: #ffffff;
  --panel-soft: #fbfbff;
  --ink: #1f2937;
  --muted: #667085;
  --muted-strong: #475467;
  --line: #e6e8f0;
  --line-strong: #d7dce7;
  --teal: #14b8a6;
  --teal-ink: #0f766e;
  --teal-soft: #e6fffb;
  --sage: #84cc16;
  --sage-soft: #f1fbe5;
  --gold: #f59e0b;
  --gold-soft: #fff7e6;
  --coral: #f97316;
  --blue: #3b82f6;
  --rose: #f43f5e;
  --pink: #ec4899;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --lime: #65a30d;
  --shadow: 0 22px 60px rgba(31, 41, 55, 0.12);
  --shadow-soft: 0 10px 28px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0, rgba(244, 63, 94, 0) 26%),
    linear-gradient(225deg, rgba(20, 184, 166, 0.16) 0, rgba(20, 184, 166, 0) 30%),
    linear-gradient(180deg, #fff7ed 0, #f8fbff 310px, #fbfbff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--teal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.topbar {
  width: min(1580px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin: 20px auto 0;
  padding: 22px 26px;
  color: var(--ink);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, var(--rose), var(--coral), var(--gold), var(--teal), var(--blue), var(--violet), var(--pink)) border-box;
  border: 2px solid transparent;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(31, 41, 55, 0.12);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--rose), var(--coral), var(--gold));
  border: 0;
  border-radius: 8px;
  font-size: 23px;
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow.small {
  color: var(--gold);
  font-size: 11px;
}

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.3;
}

.source-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.top-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: #be123c;
  background: #fff1f2;
  border: 1px solid #ffe4e6;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.page-shell {
  width: min(1580px, calc(100vw - 40px));
  margin: 16px auto 46px;
}

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

.metric-card,
.cockpit-panel,
.analytics-panel,
.library-panel,
.detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metric-card {
  position: relative;
  min-height: 116px;
  padding: 18px;
  overflow: hidden;
  background: #ffffff;
  border-top: 0;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 4px;
  background: var(--teal);
  border-radius: 999px;
}

.metric-card:nth-child(2)::before {
  background: var(--blue);
}

.metric-card:nth-child(3)::before {
  background: var(--sage);
}

.metric-card:nth-child(4)::before {
  background: var(--gold);
}

.metric-card:nth-child(5)::before {
  background: var(--coral);
}

.metric-card:nth-child(6)::before {
  background: var(--violet);
}

.metric-card:nth-child(1) {
  background: #ecfeff;
  border-color: #bae6fd;
}

.metric-card:nth-child(2) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.metric-card:nth-child(3) {
  background: #f7fee7;
  border-color: #d9f99d;
}

.metric-card:nth-child(4) {
  background: #fff7ed;
  border-color: #fed7aa;
}

.metric-card:nth-child(5) {
  background: #fff1f2;
  border-color: #fecdd3;
}

.metric-card:nth-child(6) {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  overflow-wrap: anywhere;
  font-size: 30px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.metric-card em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.cockpit-panel {
  padding: 20px;
  margin-bottom: 16px;
  color: var(--ink);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(90deg, rgba(244, 63, 94, 0.8), rgba(245, 158, 11, 0.8), rgba(20, 184, 166, 0.8), rgba(59, 130, 246, 0.8)) border-box;
  border: 1px solid transparent;
  box-shadow: var(--shadow);
}

.cockpit-head {
  margin-bottom: 16px;
}

.cockpit-panel .eyebrow.small {
  color: var(--violet);
}

.cockpit-panel h2 {
  color: var(--ink);
}

.cockpit-total {
  display: grid;
  min-width: 140px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  text-align: right;
}

.cockpit-total span {
  color: var(--muted);
  font-size: 11px;
}

.cockpit-total strong {
  margin-top: 3px;
  color: #c2410c;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.monthly-cockpit {
  display: grid;
  grid-auto-columns: minmax(204px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.month-card {
  min-width: 204px;
  padding: 14px;
  color: var(--ink);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  scroll-snap-align: start;
}

.month-card-muted {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.month-card:nth-child(1) {
  background: #ecfeff;
  border-color: #a5f3fc;
}

.month-card:nth-child(2) {
  background: #fff1f2;
  border-color: #fecdd3;
}

.month-card:nth-child(3) {
  background: #f7fee7;
  border-color: #d9f99d;
}

.month-card:nth-child(4) {
  background: #fff7ed;
  border-color: #fed7aa;
}

.month-card:nth-child(5) {
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.month-card:nth-child(6) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.month-card:nth-child(7) {
  background: #fdf2f8;
  border-color: #fbcfe8;
}

.month-card:nth-child(8) {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.month-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.month-card-head strong {
  font-size: 15px;
  line-height: 1.2;
}

.month-card-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.month-spend {
  margin-top: 12px;
}

.month-spend span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.month-spend strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.spend-track {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.spend-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: inherit;
}

.month-card:nth-child(1) .spend-fill {
  background: linear-gradient(90deg, var(--cyan), var(--teal));
}

.month-card:nth-child(2) .spend-fill {
  background: linear-gradient(90deg, var(--rose), var(--pink));
}

.month-card:nth-child(3) .spend-fill {
  background: linear-gradient(90deg, var(--sage), var(--teal));
}

.month-card:nth-child(4) .spend-fill {
  background: linear-gradient(90deg, var(--coral), var(--gold));
}

.month-card:nth-child(5) .spend-fill {
  background: linear-gradient(90deg, var(--violet), var(--blue));
}

.month-card:nth-child(6) .spend-fill {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.month-card:nth-child(7) .spend-fill {
  background: linear-gradient(90deg, var(--pink), var(--rose));
}

.month-card:nth-child(8) .spend-fill {
  background: linear-gradient(90deg, var(--lime), var(--sage));
}

.month-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.month-metric {
  min-width: 0;
  padding: 7px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 6px;
}

.month-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.month-metric strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.library-panel {
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 16px;
  background:
    linear-gradient(90deg, rgba(236, 72, 153, 0.07), rgba(20, 184, 166, 0.07), rgba(245, 158, 11, 0.07)),
    #ffffff;
  border-bottom: 1px solid var(--line);
}

.panel-topline p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel-badge {
  display: grid;
  min-width: 82px;
  padding: 11px 12px;
  place-items: center;
  background: #f5f3ff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-badge strong {
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

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

.filters {
  display: grid;
  grid-template-columns: minmax(250px, 1.45fr) repeat(8, minmax(112px, 1fr)) minmax(166px, auto);
  gap: 12px;
  padding: 16px 22px;
  background: #fbfbff;
  border-bottom: 1px solid var(--line);
}

.field-search {
  grid-column: auto;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
}

.field input::placeholder {
  color: #9aa6a2;
}

.field input:focus,
.field select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.13);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 15px;
  color: #fff;
  background: var(--pink);
  border: 1px solid var(--pink);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
  white-space: nowrap;
}

.button:hover {
  filter: brightness(0.96);
}

.button-muted {
  align-self: end;
  color: #7c2d12;
  background: #fff7ed;
  border-color: #fed7aa;
}

.filter-actions {
  display: flex;
  align-self: end;
  gap: 10px;
  min-width: 0;
}

.filter-actions .button {
  flex: 1 1 74px;
  min-width: 72px;
  padding: 0 12px;
}

.filter-actions .button-muted {
  align-self: auto;
}

.button-ghost {
  color: #ffffff;
  background: linear-gradient(90deg, var(--rose), var(--coral));
  border-color: transparent;
}

.button-small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 22px 14px;
  background: #fff;
}

.list-head p,
.section-head span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 28px;
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.list-tools span {
  padding: 6px 9px;
  background: #f0f9ff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.table-footer span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.table-footer [hidden] {
  display: none;
}

.creator-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
}

.creator-table th,
.creator-table td {
  overflow: hidden;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.creator-table th:nth-child(1),
.creator-table td:nth-child(1) {
  width: 15%;
}

.creator-table th:nth-child(2),
.creator-table td:nth-child(2) {
  width: 17%;
}

.creator-table th:nth-child(3),
.creator-table td:nth-child(3) {
  width: 7%;
}

.creator-table th:nth-child(4),
.creator-table td:nth-child(4) {
  width: 5%;
}

.creator-table th:nth-child(5),
.creator-table td:nth-child(5) {
  width: 9%;
}

.creator-table th:nth-child(6),
.creator-table td:nth-child(6) {
  width: 9%;
}

.creator-table th:nth-child(7),
.creator-table td:nth-child(7) {
  width: 8%;
}

.creator-table th:nth-child(8),
.creator-table td:nth-child(8) {
  width: 7%;
}

.creator-table th:nth-child(9),
.creator-table td:nth-child(9) {
  width: 7%;
}

.creator-table th:nth-child(10),
.creator-table td:nth-child(10) {
  width: 8%;
}

.creator-table th:nth-child(11),
.creator-table td:nth-child(11) {
  width: 8%;
}

.creator-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: #4d5f5b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 1px 0 var(--line);
}

.creator-table tbody tr {
  cursor: pointer;
  background: #fff;
}

.creator-table tbody tr:nth-child(even) {
  background: #fbfdfc;
}

.creator-table tbody tr:hover {
  background: #fff7ed;
}

.creator-table tbody tr.active {
  background: #fdf2f8;
}

.creator-name {
  display: grid;
  gap: 4px;
}

.creator-name strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-name span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.chip {
  max-width: 180px;
  overflow: hidden;
  padding: 4px 7px;
  color: #293633;
  background: #f8fafc;
  border: 1px solid #d7e1de;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-green {
  color: #0f766e;
  background: #ccfbf1;
  border-color: #99f6e4;
}

.chip-amber {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fed7aa;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analytics-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  margin: 16px 0;
}

.analytics-panel {
  padding: 20px;
  min-height: 310px;
  position: relative;
  overflow: hidden;
}

.analytics-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--blue));
}

.analytics-panel:nth-child(2)::before {
  background: linear-gradient(90deg, var(--gold), var(--coral), var(--rose));
}

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

.bar-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.bar-row {
  display: grid;
  grid-template-columns: 104px minmax(120px, 1fr) 96px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.bar-label {
  overflow: hidden;
  color: #273433;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
}

.bar-row:nth-child(2n) .bar-fill {
  background: var(--blue);
}

.bar-row:nth-child(3n) .bar-fill {
  background: var(--sage);
}

.bar-row:nth-child(4n) .bar-fill {
  background: var(--pink);
}

.bar-row:nth-child(5n) .bar-fill {
  background: var(--coral);
}

.bar-row:nth-child(6n) .bar-fill {
  background: var(--violet);
}

.analytics-panel:nth-child(2) .bar-row:nth-child(1n) .bar-fill {
  background: var(--gold);
}

.analytics-panel:nth-child(2) .bar-row:nth-child(2n) .bar-fill {
  background: var(--coral);
}

.analytics-panel:nth-child(2) .bar-row:nth-child(3n) .bar-fill {
  background: var(--rose);
}

.analytics-panel:nth-child(2) .bar-row:nth-child(4n) .bar-fill {
  background: var(--pink);
}

.analytics-panel:nth-child(2) .bar-row:nth-child(5n) .bar-fill {
  background: var(--violet);
}

.analytics-panel:nth-child(2) .bar-row:nth-child(6n) .bar-fill {
  background: var(--blue);
}

.bar-value {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.detail-panel {
  padding: 18px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(9, 24, 24, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 30;
  width: min(820px, calc(100vw - 44px));
  height: 100vh;
  max-height: none;
  overflow: auto;
  padding: 22px;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: -18px 0 42px rgba(16, 32, 30, 0.18);
  transform: translateX(104%);
  transition: transform 180ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.detail-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-title h2 {
  margin: 0;
  font-size: 23px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: #f2f6f5;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  border-color: #c6d3d1;
}

.detail-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.detail-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid #c5e4df;
  border-radius: 6px;
  font-size: 13px;
}

.record-row.pending .link-pill {
  color: #755118;
  background: var(--gold-soft);
  border-color: #ecd09b;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.detail-kpi {
  min-width: 0;
  padding: 10px;
  background: #f6f9f8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-kpi strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-row {
  padding: 12px;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
}

.record-row.pending {
  border-left-color: var(--gold);
}

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

.record-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.38;
}

.record-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.record-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.mini-stat {
  min-width: 0;
  padding: 7px;
  background: #f3f7f6;
  border: 1px solid #e3ebe7;
  border-radius: 6px;
}

.mini-stat span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-stat strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.record-copy {
  margin: 10px 0 0;
  color: #344240;
  font-size: 12px;
  line-height: 1.55;
}

.source-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 900px) {
  .filters {
    position: sticky;
    top: 0;
    z-index: 3;
    backdrop-filter: blur(10px);
  }
}

@media (max-width: 1320px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .field-search {
    grid-column: span 3;
  }

  .button-muted {
    align-self: auto;
  }

  .filter-actions {
    grid-column: span 3;
    justify-content: flex-end;
  }

  .filter-actions .button {
    flex: 0 0 96px;
  }

  .detail-kpis,
  .record-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .top-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .analytics-band {
    grid-template-columns: 1fr;
  }

  .cockpit-total {
    width: 100%;
    text-align: left;
  }

  .list-head,
  .panel-topline,
  .cockpit-head {
    flex-direction: column;
  }

  .panel-badge {
    width: 100%;
    min-width: 0;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 8px;
  }

  .panel-badge span {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 18px;
  }

  .page-shell {
    width: min(100vw - 24px, 1500px);
    margin-top: 14px;
  }

  .summary-grid,
  .filters,
  .detail-kpis,
  .record-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .field-search {
    grid-column: span 2;
  }

  .filter-actions {
    grid-column: span 2;
  }

  .filter-actions .button {
    flex: 1 1 0;
  }

  .bar-row {
    grid-template-columns: 82px minmax(86px, 1fr) 74px;
  }

  .detail-drawer {
    width: min(100vw, calc(100vw - 20px));
    padding: 18px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 24px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 19px;
  }

  .summary-grid,
  .filters,
  .detail-kpis,
  .record-metrics {
    grid-template-columns: 1fr;
  }

  .field-search {
    grid-column: span 1;
  }

  .filter-actions {
    grid-column: span 1;
  }

  .record-head,
  .detail-title {
    flex-direction: column;
  }

  .monthly-cockpit {
    grid-auto-columns: minmax(210px, 82vw);
  }

  .list-tools {
    justify-content: flex-start;
    white-space: normal;
  }

  .table-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
