:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --secondary: #e9f2ff;
  --text: #11213a;
  --muted: #5f6f86;
  --border: #dfeaf7;
  --success: #1ab77d;
  --warning: #f7b955;
  --shadow: 0 20px 45px rgba(15, 62, 120, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(180deg, #edf4ff 0%, #f7f9fc 100%);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(223, 234, 247, 0.9);
  border-radius: 20px;
  padding: 18px 22px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 18px;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(13, 110, 253, 0.15);
  background: white;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  opacity: 0.8;
}

.help-menu {
  position: relative;
  color: var(--text);
  font-weight: 600;
}

.help-menu summary {
  cursor: pointer;
  list-style: none;
}

.help-menu summary::-webkit-details-marker {
  display: none;
}

.help-menu summary::after {
  margin-left: 6px;
  content: "▾";
  font-size: 0.75em;
}

.help-menu summary:focus-visible,
.help-menu-panel a:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.3);
  outline-offset: 3px;
}

.help-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
}

.help-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.help-menu-panel a:hover {
  background: var(--secondary);
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-weight: 700;
  transition: 0.2s ease;
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 10px 20px rgba(13, 110, 253, 0.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: var(--secondary);
  color: var(--primary-dark);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: center;
  padding: 70px 0 40px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.intro {
  margin: 18px 0 0;
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 650px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.hero-panel {
  display: flex;
  justify-content: center;
}

.panel-card {
  width: min(100%, 430px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
}

.panel-header {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2f; }
.dot.green { background: #28c840; }

.request-summary {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(135deg, #f1f7ff, #ebf9ff);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.request-summary small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.request-summary strong {
  font-size: 2rem;
  color: var(--text);
}

.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.status-list li {
  background: #f9fbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.78rem;
}

.status-tag.in-progress {
  background: rgba(247, 185, 85, 0.15);
  color: #a96a00;
}

.status-tag.approved {
  background: rgba(26, 183, 125, 0.12);
  color: #0f7a59;
}

.status-tag.paid {
  background: rgba(13, 110, 253, 0.12);
  color: var(--primary-dark);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.workflow {
  margin-top: 64px;
}

.workflow h2 {
  margin-bottom: 26px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 18px;
  box-shadow: var(--shadow);
}

.step span {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--secondary);
  color: var(--primary-dark);
  font-weight: 800;
  margin-bottom: 14px;
}

.step h4 {
  margin: 0;
  font-size: 1.04rem;
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(26, 183, 125, 0.11), transparent 28rem),
    linear-gradient(145deg, #edf4ff 0%, #f8fbfc 58%, #eef8f3 100%);
}

.auth-shell {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 24px 0 64px;
}

.dashboard-shell {
  width: min(100% - 40px, 1360px);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.dashboard-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(15, 62, 120, 0.08);
}

.dashboard-sidebar-title {
  margin: 0 10px 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-nav {
  display: grid;
  gap: 4px;
}

.dashboard-nav a,
.dashboard-logout .text-button {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 11px 10px;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
}

.dashboard-nav a:hover,
.dashboard-logout .text-button:hover {
  background: var(--secondary);
  color: var(--primary-dark);
}

.dashboard-nav a:focus-visible,
.dashboard-logout .text-button:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.45);
  outline-offset: 2px;
}

.dashboard-sidebar-divider {
  height: 1px;
  margin: 14px 8px;
  background: var(--border);
}

.dashboard-logout {
  margin: 0;
}

.dashboard-logout .text-button {
  background: transparent;
  cursor: pointer;
}

.dashboard {
  min-width: 0;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.auth-brand,
.auth-header nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
}

.auth-brand img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}

.auth-header nav a,
.text-button {
  color: var(--text);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
}

.auth-header nav .help-menu {
  font: inherit;
}

.auth-header nav .help-menu-panel a {
  font-size: 0.9rem;
}

.text-button {
  padding: 4px 0;
  background: transparent;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.auth-panel {
  width: min(100%, 500px);
  margin: 52px auto 0;
  padding: clamp(22px, 5vw, 40px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-panel h1,
.workspace-heading h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.auth-kicker {
  margin: 0 0 10px;
  color: #087653;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-description {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form,
.admin-create-form,
.admin-edit-form {
  display: grid;
  gap: 16px;
}

.auth-form {
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd8e5;
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.field input:focus,
.field select:focus {
  outline: 3px solid rgba(13, 110, 253, 0.2);
  border-color: var(--primary);
}

.field-hint,
.muted-note {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 400;
}

.auth-form > .primary-btn,
.admin-create-form > .primary-btn {
  min-height: 46px;
  border-radius: 7px;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--primary-dark);
  font-weight: 700;
}

.form-error,
.notice {
  padding: 12px 14px;
  border-radius: 7px;
  line-height: 1.5;
}

.form-error,
.notice.error {
  border: 1px solid #efc5c5;
  background: #fff4f3;
  color: #9d2828;
}

.notice.success {
  border: 1px solid #b8e1d0;
  background: #f0fbf5;
  color: #126747;
}

.notice.info {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.workspace-heading {
  margin: 48px 0 24px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
}

.workspace-item {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.workspace-item h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.workspace-item p {
  color: var(--muted);
  line-height: 1.55;
}

.workspace-item .secondary-btn {
  min-height: 42px;
  border-radius: 7px;
}

.admin-create {
  margin-bottom: 18px;
}

.user-list {
  display: grid;
  gap: 14px;
}

.user-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.account-state {
  padding: 5px 9px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-edit-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  align-items: end;
}

.admin-edit-form button,
.danger-btn {
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.remove-form {
  margin-top: 14px;
}

.danger-btn {
  background: #fff0ef;
  color: #a32b2b;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.audit-table th,
.audit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.audit-table th {
  background: #f4f8fc;
  font-size: 0.85rem;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  align-items: end;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.report-filters .primary-btn {
  min-height: 46px;
  border-radius: 7px;
}

.report-paper {
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--text);
}

.report-header h2 {
  margin: 6px 0;
  font-size: 1.65rem;
}

.report-header p {
  margin: 5px 0;
  color: var(--muted);
}

.report-organization {
  color: var(--primary-dark) !important;
  font-size: 1.1rem;
  font-weight: 800;
}

.report-meta {
  display: grid;
  align-content: start;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.report-meta strong {
  color: var(--text);
}

.report-table {
  margin-top: 16px;
}

.report-table td {
  white-space: normal;
}

.report-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.backup-restore-heading {
  margin: 38px 0 18px;
}

.backup-restore-heading h2,
.backup-list-section h2 {
  margin: 0 0 8px;
}

.backup-action-form {
  display: grid;
  gap: 14px;
}

.backup-action-form select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #cbd8e5;
  border-radius: 7px;
  background: #fff;
  font: inherit;
}

.backup-action-form button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.backup-list-section {
  display: grid;
  gap: 14px;
  margin-top: 36px;
}

.backup-list-section .muted-note {
  line-height: 1.5;
}

@media print {
  @page {
    size: landscape;
    margin: 14mm;
  }

  body,
  .auth-body {
    background: #fff !important;
  }

  .auth-shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .auth-header,
  .report-filters,
  .report-actions,
  .workspace-heading,
  .notice,
  .form-error {
    display: none !important;
  }

  .report-paper {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  .report-table {
    width: 100%;
    font-size: 9pt;
  }

  .report-table tr {
    break-inside: avoid;
  }
}

.prd-page {
  padding-bottom: 20px;
}

.prd-hero {
  margin: 42px 0 24px;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.prd-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.prd-hero .auth-description {
  max-width: 760px;
}

.prd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.prd-meta span,
.prd-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f4f8fc;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.prd-status {
  margin-bottom: 14px;
  border-color: #b8e1d0;
  background: #f0fbf5;
  color: #126747;
}

.prd-toc,
.prd-section {
  margin-top: 20px;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.prd-toc h2,
.prd-section h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
}

.prd-toc ul,
.prd-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

.prd-toc ul {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  padding-left: 0;
  list-style: none;
}

.prd-toc a {
  color: var(--primary-dark);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prd-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.prd-section p + p,
.prd-section .prd-list,
.prd-section .table-wrap {
  margin-top: 14px;
}

.prd-section h3 {
  margin: 22px 0 9px;
  font-size: 1rem;
}

.prd-section h3:first-of-type {
  margin-top: 18px;
}

.prd-section .audit-table {
  min-width: 620px;
}

.prd-section .audit-table td {
  color: var(--muted);
  line-height: 1.5;
  white-space: normal;
  vertical-align: top;
}

.prd-section .audit-table th {
  color: var(--text);
}

.prd-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--primary);
  border-radius: 5px;
  background: #f4f8fc;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .auth-shell {
    width: min(100% - 20px, 1080px);
    padding-top: 10px;
  }

  .auth-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-header nav {
    flex-wrap: wrap;
  }

  .auth-header nav .help-menu-panel {
    right: auto;
    left: 0;
  }

  .auth-panel {
    margin-top: 28px;
  }
}

@media (max-width: 820px) {
  .auth-header {
    flex-wrap: wrap;
  }

  .auth-header nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    width: min(100% - 32px, 1080px);
  }

  .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .dashboard-sidebar {
    top: 8px;
    z-index: 40;
    max-height: none;
    padding: 12px;
  }

  .dashboard-sidebar-title,
  .dashboard-sidebar-divider {
    display: none;
  }

  .dashboard-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .dashboard-nav a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 10px 12px;
  }

  .dashboard-logout {
    flex: 0 0 auto;
  }

  .dashboard-logout .text-button {
    width: auto;
    white-space: nowrap;
  }
}

.dashboard {
  padding: 10px 0 20px;
}

.dashboard-heading,
.section-heading,
.panel-heading,
.dashboard-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#dashboard-overview,
#metrics-title,
#charts-title,
#updates-title {
  scroll-margin-top: 110px;
}

.dashboard-heading {
  margin: 36px 0 30px;
}

.dashboard-heading h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.15;
}

.dashboard-heading .auth-description {
  margin-top: 8px;
}

.dashboard-tools {
  flex-shrink: 0;
}

.dashboard-admin-link {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 7px;
  white-space: nowrap;
}

.freshness,
.section-period,
.panel-heading > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid #cbd8e5;
  border-radius: 7px;
  background: white;
  color: var(--text);
  font-weight: 700;
}

.refresh-btn > span:first-child {
  font-size: 1.25rem;
  line-height: 1;
}

.refresh-btn:hover,
.refresh-btn:focus-visible,
.retry-button:hover,
.retry-button:focus-visible {
  border-color: var(--primary);
  outline: 3px solid rgba(13, 110, 253, 0.16);
}

.refresh-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.refresh-btn.is-loading > span:first-child {
  animation: dashboard-spin 0.9s linear infinite;
}

@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}

.dashboard-section {
  margin-top: 30px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 142px;
  padding: 18px 18px 15px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--metric-color, var(--primary));
  border-radius: 8px;
  background: #fff;
}

.metric-card > span {
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 650;
}

.metric-card strong {
  align-self: center;
  margin: 9px 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.9rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.metric-green { --metric-color: #16845b; }
.metric-blue { --metric-color: #1766a6; }
.metric-amber { --metric-color: #c78916; }
.metric-rose { --metric-color: #c24e52; }

.skeleton-value {
  width: 82px;
  color: transparent !important;
  border-radius: 4px;
  background: linear-gradient(90deg, #e8edf2 25%, #f4f6f8 50%, #e8edf2 75%);
  background-size: 200% 100%;
  animation: dashboard-shimmer 1.4s ease-in-out infinite;
}

@keyframes dashboard-shimmer {
  to { background-position: -200% 0; }
}

.region-message {
  margin: 12px 0 0;
  color: #9d2828;
  font-size: 0.85rem;
}

.range-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.range-control select {
  min-height: 38px;
  padding: 6px 28px 6px 9px;
  border: 1px solid #cbd8e5;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.chart-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.chart-panel {
  min-height: 310px;
  padding: 17px 18px 14px;
}

.panel-heading {
  min-height: 28px;
  align-items: baseline;
}

.panel-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.panel-heading > span {
  text-align: right;
}

.chart-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 238px;
  margin-top: 8px;
}

.chart-content > .dashboard-chart-svg {
  display: block;
  width: 100%;
  max-height: 235px;
  overflow: visible;
}

.chart-grid-line {
  stroke: #e7edf2;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #66758a;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 11px;
}

.chart-description {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.chart-loading,
.data-message {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.data-message {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px;
}

.data-message p {
  margin: 0;
  line-height: 1.5;
}

.data-message.error {
  color: #9d2828;
}

.data-message.restricted {
  color: var(--muted);
}

.retry-button {
  min-height: 36px;
  padding: 6px 11px;
  border: 1px solid #cbd8e5;
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 700;
  cursor: pointer;
}

.donut-ring {
  position: relative;
  display: grid;
  width: 154px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
}

.donut-ring::before {
  position: absolute;
  inset: 19px;
  border-radius: inherit;
  background: white;
  content: "";
}

.donut-total {
  position: relative;
  display: grid;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
}

.donut-total small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.donut-legend {
  display: grid;
  gap: 9px;
  margin: 0 0 0 24px;
  padding: 0;
  list-style: none;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 10px minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: capitalize;
}

.donut-legend strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.legend-swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.summary-panel {
  min-height: 220px;
  padding: 17px 18px 15px;
}

.list-content {
  display: grid;
  align-content: start;
  min-height: 124px;
  margin-top: 7px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1f4;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-row-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.summary-row-copy strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: capitalize;
}

.summary-row-copy > span,
.summary-time {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.summary-time {
  flex: 0 0 auto;
  text-align: right;
}

.summary-row.is-unread .summary-row-copy strong::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #1766a6;
  content: "";
  vertical-align: 1px;
}

.count-marker {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 12px;
  background: #e8f2fb;
  color: #1766a6;
  font-size: 0.72rem;
  vertical-align: 2px;
}

.panel-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.account-summary {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.account-summary p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
}

.account-summary .panel-link {
  grid-column: 2;
}

.system-status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 0.88rem;
}

.status-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #16845b;
}

.status-indicator.is-warning {
  background: #c78916;
}

.status-caption {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 900px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .dashboard-shell {
    width: min(100% - 20px, 1080px);
    padding-top: 10px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    margin-top: 26px;
  }

  .dashboard-heading h1 {
    font-size: 1.8rem;
  }

  .dashboard-tools {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .chart-grid,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-panel {
    min-height: 285px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card {
    min-height: 122px;
  }

  .donut-ring {
    width: 126px;
  }

  .donut-legend {
    margin-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-value,
  .refresh-btn.is-loading > span:first-child {
    animation: none;
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero,
  .feature-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}
