:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #d8e1ee;
  --text: #17324d;
  --muted: #5f7692;
  --brand: #1f4e79;
  --green: #1f8a70;
  --orange: #dc7c2d;
  --red: #c94949;
  --shadow: 0 18px 35px rgba(20, 44, 70, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(31, 78, 121, 0.12), transparent 30%),
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #10355a 0%, #163f6a 100%);
  color: #f3f7fc;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #e3eefb, #7cc4ff);
  color: #163f6a;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.brand-lockup span {
  display: block;
  color: rgba(243, 247, 252, 0.72);
  font-size: 0.9rem;
}

.nav-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-stack a {
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(243, 247, 252, 0.92);
}

.nav-stack a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(243, 247, 252, 0.8);
  line-height: 1.5;
}

.page-body {
  padding: 34px;
}

.page-hero {
  padding: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.page-hero.compact {
  padding-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.8rem;
}

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

.lede {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.metric-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card,
.report-card {
  border-radius: 22px;
  padding: 22px;
  color: #fff;
  box-shadow: var(--shadow);
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-title,
.metric-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

.metric-value,
.report-value {
  font-size: 2rem;
}

.metric-blue { background: linear-gradient(135deg, #1f4e79, #2768a1); }
.metric-green { background: linear-gradient(135deg, #1f8a70, #2cb59a); }
.metric-orange { background: linear-gradient(135deg, #ca6d2a, #ea9b46); }
.metric-red { background: linear-gradient(135deg, #b64545, #dd6767); }

.content-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 18px;
}

.panel-header span {
  color: var(--muted);
  font-size: 0.92rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.filter-grid label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.activity-list,
.highlight-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-item,
.highlight-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdff;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.activity-item p,
.highlight-item small,
.highlight-item span {
  color: var(--muted);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--text);
}

.data-table thead th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-active {
  color: #0f5f49;
  background: #daf5ec;
}

.status-suspended {
  color: #8c4f12;
  background: #ffe8cc;
}

.status-disabled {
  color: #8e2d2d;
  background: #fde1e1;
}

.alert-success,
.alert-error {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
}

.alert-success {
  background: #daf5ec;
  color: #0f5f49;
}

.alert-error {
  background: #fde1e1;
  color: #8e2d2d;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
}

.primary-button,
.secondary-button,
.table-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.secondary-button,
.table-link {
  background: var(--panel);
  color: var(--brand);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.muted-cell {
  color: var(--muted);
  min-width: 280px;
}

.link-button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.field-error {
  color: #a53030;
  font-size: 0.86rem;
}

input[readonly] {
  background: #f3f6fa;
  color: var(--text);
}

.login-body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #173762, #0b172a 55%, #060c16);
}

.login-shell {
  width: min(480px, calc(100vw - 32px));
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 18px;
  color: #8e2d2d;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 18px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .page-body {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .page-body {
    padding: 14px;
  }

  .page-hero,
  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .metric-grid,
  .summary-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .activity-item {
    flex-direction: column;
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions .secondary-button,
  .filter-actions .primary-button {
    width: 100%;
  }
}
