:root {
  --bg: #f4f7fb;
  --bg-accent: #e8eef8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: #f8fafc;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text-main: #0f172a;
  --text-soft: #475569;
  --text-faint: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --ok: #15803d;
  --danger: #b91c1c;
  --warning: #b45309;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

html {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

body.dashboard-shell {
  min-height: 100vh;
  color: var(--text-main);
  background: transparent;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: -0.01em;
}

body.is-loading {
  overflow: hidden;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 247, 251, 0.86);
  backdrop-filter: blur(12px);
}

.loading-panel {
  min-width: 280px;
  padding: 28px 32px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.loading-title {
  margin-top: 18px;
  font-size: 1.2rem;
  color: var(--text-main);
}

.loading-copy {
  margin-top: 8px;
  color: var(--text-soft);
}

.procmail-trigger {
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-strong);
  font: 700 0.78rem/1 "Manrope", "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}

.procmail-trigger:hover,
.procmail-trigger:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.14);
}

.procmail-popover {
  position: absolute;
  z-index: 1400;
  max-width: min(560px, calc(100vw - 32px));
  max-height: min(60vh, 480px);
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.97);
  color: #f8fafc;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.28);
  white-space: pre-wrap;
  word-break: break-word;
  font: 500 0.82rem/1.45 "IBM Plex Sans", system-ui, sans-serif;
}

.uk-card.glass-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.uk-section {
  padding-top: 40px;
  padding-bottom: 56px;
}

.hero-title,
.section-title {
  color: var(--text-main);
  font-family: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 800;
}

.hero-title {
  line-height: 1;
  max-width: 12ch;
  letter-spacing: -0.04em;
  font-size: clamp(2.7rem, 5vw, 4.9rem);
}

.hero-copy,
.meta-subtext,
.uk-text-muted {
  color: var(--text-soft) !important;
}

.eyebrow,
.section-kicker,
.meta-label {
  margin: 0 0 12px;
  color: var(--accent);
  font: 800 0.74rem/1.2 "Manrope", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.meta-value,
.stat-value {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.05;
  color: var(--text-main);
  font-family: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.stat-card {
  min-height: 160px;
}

.chart {
  height: 360px;
}

.uk-label {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.uk-alert-danger,
.uk-alert-warning {
  border-radius: 16px;
  border: 1px solid transparent;
}

.uk-alert-danger {
  background: rgba(185, 28, 28, 0.08);
  color: #7f1d1d;
  border-color: rgba(185, 28, 28, 0.14);
}

.uk-alert-warning {
  background: rgba(180, 83, 9, 0.08);
  color: #78350f;
  border-color: rgba(180, 83, 9, 0.14);
}

.table-shell {
  overflow: hidden;
}

table.dashboard-table.dataTable {
  width: 100% !important;
  color: var(--text-main);
  font-size: 0.94rem;
}

table.dashboard-table.dataTable thead th {
  color: var(--text-faint);
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

table.dashboard-table.dataTable tbody td {
  color: var(--text-main);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.dashboard-table.dataTable tbody td:nth-child(5) {
  min-width: 132px;
}

table.dashboard-table.dataTable tbody tr.row-error {
  background: rgba(185, 28, 28, 0.04);
}

table.dashboard-table.dataTable tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
  color: var(--text-main);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  min-height: 40px;
}

div.dt-container .dt-info,
div.dt-container .dt-length,
div.dt-container .dt-search,
div.dt-container .dt-paging {
  color: var(--text-soft);
}

div.dt-container .dt-paging .dt-paging-button {
  color: var(--text-main) !important;
  border-radius: 10px;
  border: 1px solid transparent !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
  background: var(--accent-soft) !important;
  color: var(--accent-strong) !important;
  border-color: rgba(37, 99, 235, 0.14) !important;
}

.status-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.status-ok {
  background: rgba(21, 128, 61, 0.1);
  color: var(--ok);
}

.status-error {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

.sparkline-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 32px;
  padding: 3px 6px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
}

.sparkline-chart {
  display: block;
  width: 112px;
  height: 28px;
}

.sparkline-empty {
  color: var(--text-faint);
  font-size: 0.8rem;
  font-weight: 600;
}

.uk-button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.uk-button-primary:hover,
.uk-button-primary:focus {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #fff;
}

.uk-button-text {
  color: var(--text-soft);
  font-weight: 700;
}

.uk-button-text:hover,
.uk-button-text:focus {
  color: var(--accent);
}

.uk-input {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--text-main);
}

.uk-input:focus {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.uk-form-label {
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.login-shell .glass-card {
  max-width: 480px;
  margin: 0 auto;
}

.login-shell .hero-title {
  max-width: none;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.uk-card-title {
  font-family: "Manrope", "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

@media (max-width: 959px) {
  .hero-title {
    max-width: none;
  }
}

@media (max-width: 639px) {
  .chart {
    height: 280px;
  }

  .meta-strip {
    flex-direction: column;
  }

  .uk-section {
    padding-top: 24px;
    padding-bottom: 36px;
  }
}
