:root {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --navy: #0b1436;
  --deep-navy: #040c1c;
  --soft-white: #f0f4ff;
  --panel: #ffffff;
  --accent: #0d1a42;
  --muted: #5c637d;
  --border: #dfe7f4;
  --shadow: 0 20px 40px rgba(5, 8, 22, 0.18);
  --shadow-hover: 0 24px 52px rgba(5, 8, 22, 0.24);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--deep-navy) 0%, #06102c 36%, #0b1436 58%, #eef2fb 100%);
  color: #0b1436;
}

button,
input,
select {
  font: inherit;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  flex: 0 0 auto;
}

.page {
  width: 100%;
  min-height: 100dvh;
  padding: clamp(1rem, 2vw, 1.75rem);
  display: grid;
  gap: clamp(1rem, 1.8vw, 1.5rem);
  transition: opacity 0.18s ease, filter 0.18s ease, transform 0.18s ease;
}

.page[data-soft-loading="true"] {
  opacity: 0.82;
  filter: saturate(0.97);
}

.page__header {
  width: 100%;
  padding: clamp(1.2rem, 2vw, 1.6rem) clamp(1.2rem, 2.5vw, 2rem);
  background: linear-gradient(180deg, rgba(11, 20, 54, 0.98), rgba(11, 20, 54, 0.92));
  border-radius: 28px;
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  box-shadow: 0 24px 48px rgba(4, 12, 28, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.header__identity {
  display: grid;
  gap: 0.35rem;
}

.header__eyebrow {
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  color: rgba(255, 255, 255, 0.76);
}

.header__identity h1 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  letter-spacing: 0.16em;
  line-height: 1.05;
}

.header__description {
  max-width: 42rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.5;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.header-export-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 18px rgba(0, 0, 0, 0.25);
}

.header-export-btn .icon {
  width: 1rem;
  height: 1rem;
}


.icon-button,
.filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 18px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.icon-button:hover,
.filter-btn:hover,
.filter-btn[data-open="true"] {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

.refresh-btn {
  width: 3.1rem;
  height: 3.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.filter-control {
  position: relative;
}

.filter-btn {
  min-width: min(21rem, calc(100vw - 4rem));
  padding: 0.8rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  text-align: left;
}

.filter-btn__icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.filter-btn__text {
  display: grid;
  gap: 0.18rem;
}

.filter-btn__text strong {
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.filter-btn__text span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.93rem;
}

.date-popup {
  position: absolute;
  top: calc(100% + 0.85rem);
  right: 0;
  width: min(24rem, calc(100vw - 2rem));
  z-index: 12;
}

.date-popup[hidden] {
  display: none;
}

.date-picker {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 1rem;
  border: 1px solid rgba(13, 26, 66, 0.08);
  box-shadow: 0 24px 48px rgba(3, 8, 22, 0.28);
  color: #0b1436;
}

.date-picker__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.date-picker__nav {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(13, 26, 66, 0.08);
  background: #f7f9ff;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.date-picker__nav:hover {
  background: #eef3ff;
  transform: translateY(-1px);
}

.date-picker__title-wrap {
  display: grid;
  justify-items: center;
  gap: 0.12rem;
}

.date-picker__eyebrow {
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.date-picker__title-wrap strong {
  font-size: 1rem;
}

.date-picker__title-wrap span {
  color: var(--muted);
  font-size: 0.78rem;
}

.date-picker__weekdays,
.date-picker__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
}

.date-picker__weekdays {
  margin-bottom: 0.55rem;
}

.date-picker__weekdays span {
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.calendar-day {
  position: relative;
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #0b1436;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.calendar-day:hover:not([disabled]) {
  background: #eff3ff;
  transform: translateY(-1px);
}

.calendar-day[disabled] {
  cursor: not-allowed;
  opacity: 0.3;
}

.calendar-day--outside {
  color: rgba(92, 99, 125, 0.52);
}

.calendar-day--in-range {
  background: rgba(13, 26, 66, 0.08);
  border-radius: 0;
}

.calendar-day--range-start,
.calendar-day--range-end,
.calendar-day--single {
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
}

.calendar-day--range-start.calendar-day--in-range,
.calendar-day--range-end.calendar-day--in-range {
  border-radius: 14px;
}

.calendar-day--pending {
  border-color: rgba(13, 26, 66, 0.24);
  background: rgba(13, 26, 66, 0.08);
}

.date-picker__footer {
  margin-top: 0.95rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.clear-btn {
  border: 1px solid rgba(13, 26, 66, 0.12);
  background: #fff;
  color: var(--accent);
  padding: 0.62rem 0.9rem;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.clear-btn:hover {
  background: #f5f8ff;
  transform: translateY(-1px);
}

.dashboard-grid {
  display: grid;
  gap: clamp(1rem, 1.8vw, 1.5rem);
  min-height: 0;
}

.top-layout,
.lower-layout {
  width: 100%;
  display: grid;
  gap: clamp(1rem, 1.5vw, 1.25rem);
  align-items: start;
}

.top-layout {
  grid-template-columns: minmax(0, 2.55fr) minmax(22rem, 1.45fr);
}

.lower-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

.key-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.85rem, 1.2vw, 1rem);
}

.card,
.metric-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #ffffff 100%);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(13, 26, 66, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover,
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(13, 26, 66, 0.1);
}

.metric-card {
  min-height: 22rem;
  padding: 1.45rem;
  display: grid;
  gap: 1.05rem;
  align-content: start;
}

.metric-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.metric-card__title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.metric-card__icon {
  width: 3.05rem;
  height: 3.05rem;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(13, 26, 66, 0.06);
  box-shadow: inset 0 0 0 1px rgba(13, 26, 66, 0.06);
}

.metric-card__label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.metric-card__action {
  border: 1px solid rgba(13, 26, 66, 0.1);
  background: #f6f8ff;
  color: var(--accent);
  padding: 0.48rem 0.82rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.metric-card__action:hover {
  background: #eef3ff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(13, 26, 66, 0.12);
}

.metric-card__value {
  font-size: clamp(2.35rem, 3.3vw, 2.85rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.metric-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.metric-card__status::before,
.donut-status::before,
.import-status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #a5a9c7;
}

.metric-card__status[data-status="loading"]::before,
.donut-status[data-status="loading"]::before,
.import-status[data-status="loading"]::before {
  background: #2a5dff;
  animation: pulse 1.1s infinite;
}

.metric-card__status[data-status="success"]::before,
.donut-status[data-status="success"]::before,
.import-status[data-status="ready"]::before {
  background: #1e9b5f;
}

.metric-card__status[data-status="error"]::before,
.donut-status[data-status="error"]::before,
.import-status[data-status="error"]::before {
  background: #e04d4d;
}

@keyframes pulse {
  0% {
    transform: scale(0.88);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(0.88);
    opacity: 0.55;
  }
}

.metric-card__period {
  color: #42507b;
  font-size: 0.9rem;
  line-height: 1.45;
}

.metric-card__details {
  display: grid;
  gap: 0.78rem;
}

.metric-card__detail {
  padding: 1rem 1rem;
  border-radius: 20px;
  background: #f7f9ff;
  display: grid;
  gap: 0.26rem;
}

.metric-card__detail-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.metric-card__detail strong {
  font-size: 1.18rem;
  color: #0f1d46;
}

.card {
  padding: 1.25rem;
  min-height: 21rem;
  display: flex;
  flex-direction: column;
}

.card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card__title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card__icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 26, 66, 0.06);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(13, 26, 66, 0.05);
}

.card__heading {
  display: grid;
  gap: 0.22rem;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.64rem;
}

.card h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #111b34;
}

.muted-text {
  color: var(--muted);
  font-size: 0.8rem;
}

.card--donut {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(13, 26, 66, 0.06), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), #ffffff 100%);
  min-height: 0;
}

.card--donut::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1px solid rgba(13, 26, 66, 0.06);
  pointer-events: none;
}

.donut-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.import-btn,
.chip {
  border-radius: 999px;
  white-space: nowrap;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(13, 26, 66, 0.1);
  background: rgba(13, 26, 66, 0.05);
  color: var(--accent);
  padding: 0.55rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.import-btn:hover {
  background: rgba(13, 26, 66, 0.09);
  box-shadow: 0 10px 18px rgba(13, 26, 66, 0.08);
  transform: translateY(-1px);
}

.chip {
  padding: 0.5rem 0.85rem;
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(13, 26, 66, 0.08);
}

.donut-highlight {
  padding: 1.1rem 1rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 26, 66, 0.04), rgba(13, 26, 66, 0.015));
  border: 1px solid rgba(13, 26, 66, 0.06);
  display: grid;
  justify-items: center;
  gap: 0.9rem;
}

.donut-chart {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--accent) 0deg var(--neutral-angle, 360deg), #e04d4d var(--neutral-angle, 360deg) 360deg);
  box-shadow: inset 0 0 0 1px rgba(13, 26, 66, 0.05);
}

.donut-chart[data-empty="true"] {
  background: conic-gradient(rgba(13, 26, 66, 0.18) 0deg 360deg);
}

.donut-chart::after {
  content: "";
  position: absolute;
  width: 5.05rem;
  height: 5.05rem;
  border-radius: 50%;
  background: #f6f7fb;
  box-shadow: inset 0 0 0 1px rgba(13, 26, 66, 0.04);
}

.donut-chart__value {
  position: relative;
  z-index: 1;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
}

.donut-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.78rem;
}

.donut-meta p {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.donut-meta p::before {
  content: "";
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: rgba(13, 26, 66, 0.28);
}

.donut-meta p:first-child::before {
  background: var(--accent);
}

.donut-meta p:last-child::before {
  background: #e04d4d;
}

.donut-toolbar {
  margin: 1rem 0 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card--donut__records {
  width: 100%;
  padding-left: calc(2.6rem + 0.75rem);
  min-width: 0;
}

.donut-status,
.import-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: rgba(13, 26, 66, 0.05);
  border: 1px solid rgba(13, 26, 66, 0.08);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}

.record-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-top: 0.1rem;
  flex: 0 0 auto;
  overflow: hidden;
}

.card--donut .record-list {
  width: 100%;
  align-self: stretch;
  margin-top: 0.2rem;
  padding: 0;
  gap: 0.55rem;
}

.record-list li {
  padding: 0.72rem 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(13, 26, 66, 0.08);
  background: linear-gradient(180deg, rgba(240, 244, 255, 0.75), rgba(255, 255, 255, 0.96));
  display: grid;
  gap: 0.3rem;
}

.card--donut .record-list li {
  width: 100%;
  padding: 0.7rem 0.8rem;
  gap: 0.28rem;
  justify-items: start;
  border-radius: 14px;
}

.record-list strong {
  font-size: 0.86rem;
  color: #081333;
}

.card--donut .record-list__title,
.card--donut .record-list strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.record-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.36rem 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(13, 26, 66, 0.08);
  background: rgba(13, 26, 66, 0.05);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.card--donut .record-list a {
  width: 100%;
  justify-content: flex-start;
  min-width: 0;
  padding: 0.34rem 0.5rem;
  border-radius: 11px;
  font-size: 0.72rem;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .card--donut__records {
    padding-left: 0;
  }
}

.record-list a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-modal-trigger {
  margin-top: auto;
  align-self: stretch;
  min-height: 2.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid rgba(13, 26, 66, 0.1);
  background: linear-gradient(180deg, rgba(13, 26, 66, 0.06), rgba(13, 26, 66, 0.03));
  color: var(--accent);
  padding: 0.78rem 1rem;
  border-radius: 16px;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(13, 26, 66, 0.05);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.records-modal-trigger--header {
  margin-top: 0;
  align-self: auto;
  min-height: auto;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  box-shadow: none;
}

.records-modal-trigger:hover {
  background: linear-gradient(180deg, rgba(13, 26, 66, 0.1), rgba(13, 26, 66, 0.05));
  border-color: rgba(13, 26, 66, 0.16);
  box-shadow: 0 14px 24px rgba(13, 26, 66, 0.1);
  transform: translateY(-1px);
}

.records-modal-trigger:focus-visible {
  outline: 2px solid rgba(28, 77, 184, 0.3);
  outline-offset: 2px;
}

.records-modal-trigger .icon {
  width: 1rem;
  height: 1rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 12, 28, 0.26);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.cursor-loader {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: 1.4rem;
  height: 1.4rem;
  pointer-events: none;
  transform: translate3d(-999px, -999px, 0);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.cursor-loader:not([hidden]) {
  opacity: 1;
}

.cursor-loader__ring,
.cursor-loader__dot {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.cursor-loader__ring {
  border: 2px solid rgba(13, 26, 66, 0.16);
  border-top-color: rgba(13, 26, 66, 0.75);
  box-shadow: 0 8px 16px rgba(4, 12, 28, 0.16);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  animation: cursor-loader-spin 0.75s linear infinite;
}

.cursor-loader__dot {
  inset: 0.32rem;
  background: rgba(13, 26, 66, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.78);
}

@keyframes cursor-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-panel {
  width: min(52rem, 100%);
  max-height: min(80dvh, 46rem);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), #ffffff 100%);
  border-radius: 28px;
  box-shadow: 0 26px 60px rgba(4, 12, 28, 0.3);
  border: 1px solid rgba(13, 26, 66, 0.08);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-panel--narrow {
  width: min(44rem, 100%);
}

.modal-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-panel__title-wrap {
  display: grid;
  gap: 0.2rem;
}

.modal-panel__subtitle {
  color: var(--muted);
  font-size: 0.84rem;
}

.modal-record-list__compact {
  display: grid;
  gap: 0.3rem;
}

.modal-filter-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.modal-filter-chip {
  border: 1px solid rgba(13, 26, 66, 0.1);
  background: rgba(13, 26, 66, 0.04);
  color: var(--accent);
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.modal-filter-chip:hover {
  background: rgba(13, 26, 66, 0.08);
  transform: translateY(-1px);
}

.modal-filter-chip--active {
  background: linear-gradient(180deg, rgba(13, 26, 66, 0.12), rgba(13, 26, 66, 0.07));
  border-color: rgba(13, 26, 66, 0.18);
  box-shadow: 0 10px 16px rgba(13, 26, 66, 0.08);
}

.modal-close {
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid rgba(13, 26, 66, 0.08);
  border-radius: 16px;
  background: rgba(13, 26, 66, 0.04);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.modal-close:hover {
  background: rgba(13, 26, 66, 0.08);
  transform: translateY(-1px);
}

.modal-record-list {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  overflow: auto;
  padding-right: 0.25rem;
}

.modal-record-list li {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(13, 26, 66, 0.08);
  background: linear-gradient(180deg, rgba(240, 244, 255, 0.78), rgba(255, 255, 255, 0.98));
  display: grid;
  gap: 0.45rem;
}

.modal-record-list__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-record-list__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: rgba(13, 26, 66, 0.08);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
}

.modal-record-list__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.modal-record-list__meta b {
  color: #0b1436;
}

.modal-record-list strong {
  font-size: 0.9rem;
  color: #081333;
}

.modal-record-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.42rem 0.62rem;
  border-radius: 12px;
  border: 1px solid rgba(13, 26, 66, 0.08);
  background: rgba(13, 26, 66, 0.05);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.modal-record-list a:hover {
  background: rgba(13, 26, 66, 0.08);
  border-color: rgba(13, 26, 66, 0.15);
  transform: translateY(-1px);
}

.modal-record-list a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-record-list__empty {
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed rgba(13, 26, 66, 0.16);
  color: var(--muted);
  text-align: center;
}

.modal-file-list {
  min-height: 12rem;
}

.file-delete-btn {
  border: 1px solid rgba(224, 77, 77, 0.18);
  background: rgba(224, 77, 77, 0.08);
  color: #a5272a;
  padding: 0.42rem 0.7rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.file-delete-btn:hover {
  background: rgba(224, 77, 77, 0.14);
  border-color: rgba(224, 77, 77, 0.26);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .modal-record-list__meta {
    grid-template-columns: 1fr;
  }
}

.record-list a:hover {
  background: rgba(13, 26, 66, 0.08);
  border-color: rgba(13, 26, 66, 0.16);
  transform: translateY(-1px);
}

.card--table {
  min-height: 100%;
}

.table {
  display: grid;
  gap: 0.45rem;
}

.table__row {
  display: grid;
  grid-template-columns: 0.8fr 1.75fr 1fr 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 18px;
  background: #f7f9ff;
  color: #0b1436;
  font-size: 0.8rem;
}

.table__row--header {
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.table__row span {
  line-height: 1.35;
}

.table__row small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.66rem;
  color: var(--muted);
}

.table__row--interactive {
  width: 100%;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.table__row--interactive:hover {
  transform: translateY(-1px);
  border-color: rgba(13, 26, 66, 0.12);
  box-shadow: 0 12px 24px rgba(13, 26, 66, 0.08);
  background: #f1f5ff;
}

.table__row--interactive:focus-visible {
  outline: 2px solid rgba(28, 77, 184, 0.34);
  outline-offset: 2px;
}

.table__row--active {
  background: #eaf0ff;
  border-color: rgba(28, 77, 184, 0.35);
  box-shadow: 0 14px 26px rgba(28, 77, 184, 0.12);
}

.table__row--active small {
  color: #24449c;
}

.chart-stack {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card--chart {
  min-height: 17rem;
}

.chart-plot {
  position: relative;
  flex: 1;
  min-height: 14rem;
  padding: 0.35rem 0.2rem 0 0;
}

.line-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.line-chart path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-chart__point {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 3;
  transition: r 0.18s ease, filter 0.18s ease;
  cursor: pointer;
}

.line-chart__point:hover {
  r: 6.5;
  filter: drop-shadow(0 4px 10px rgba(13, 26, 66, 0.22));
}

.chart-tooltip {
  position: absolute;
  transform: translate(-50%, -110%);
  pointer-events: none;
  padding: 0.55rem 0.7rem;
  border-radius: 14px;
  background: rgba(11, 20, 54, 0.95);
  color: #fff;
  box-shadow: 0 18px 28px rgba(4, 12, 28, 0.28);
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: nowrap;
  z-index: 2;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 1280px) {
  .top-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1024px) {
  .lower-layout {
    grid-template-columns: 1fr;
  }

  .chart-stack {
    grid-template-rows: none;
  }
}

@media (max-width: 720px) {
  .page__header {
    flex-direction: column;
  }

  .header__actions {
    width: 100%;
    justify-content: stretch;
  }

  .filter-control,
  .filter-btn,
  .header-export-btn {
    width: 100%;
  }

  .key-metrics {
    grid-template-columns: 1fr;
  }

  .table__row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .table__row--header {
    display: none;
  }

  .card__header,
  .donut-toolbar,
  .donut-header-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .chart-footer {
    flex-direction: column;
  }
}
