:root {
  --ink: #172026;
  --muted: #60717c;
  --line: #d6e0ee;
  --page: #eef2f8;
  --panel: #ffffff;
  --navy: #062f5f;
  --navy-deep: #04244a;
  --gold: #f7c514;
  --accent: #062f5f;
  --risk: #b3261e;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

.icon {
  width: 20px;
  height: 20px;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

select,
textarea {
  font: inherit;
}

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

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  color: var(--ink);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.brand-mark {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

.brand-line h1,
.brand-line p,
.topbar h2,
.topbar p {
  margin: 0;
}

.brand-line h1 {
  font-size: 22px;
  color: var(--navy);
}

.topbar h2,
.panel h3,
.section-head h3,
.profile-head h3 {
  color: var(--navy);
}

.brand-line p {
  color: var(--muted);
}

.brand-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(6, 47, 95, 0.08);
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.brand-tag .icon {
  width: 16px;
  height: 16px;
}

.user-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--page);
}

.user-avatar,
.topbar-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 800;
  flex-shrink: 0;
}

.user-name {
  margin: 0;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}

.user-role {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a,
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 11px 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.nav .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav a:hover,
.nav button:hover {
  color: var(--navy);
  background: rgba(6, 47, 95, 0.06);
}

.nav a.active {
  color: var(--navy-deep);
  background: var(--gold);
}

.policy-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.45;
  font-size: 13px;
  color: var(--muted);
}

.brand-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: white;
}

.brand-footer .icon {
  width: 26px;
  height: 26px;
  color: var(--gold);
  flex-shrink: 0;
}

.brand-footer p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.brand-footer p span {
  color: var(--gold);
}

.topbar {
  min-height: 82px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 47, 95, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--navy);
  text-decoration: none;
  cursor: pointer;
}

.icon-button .icon {
  width: 18px;
  height: 18px;
}

.icon-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--risk);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 0 4px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.view {
  padding: 24px 28px 40px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.space-top {
  margin-top: 16px;
}

.actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.panel,
.stat,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(6, 47, 95, 0.10);
}

.panel {
  border-top: 3px solid var(--gold);
}

.panel,
.stat {
  padding: 16px;
}

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

.stat-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--navy);
  color: white;
  flex-shrink: 0;
}

.stat-icon .icon {
  width: 24px;
  height: 24px;
}

.stat-text {
  display: grid;
  gap: 2px;
}

.stat strong {
  display: block;
  font-size: 28px;
  color: var(--navy);
}

.section-head,
.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-head h3,
.profile-head h3 {
  margin: 0;
}

.section-head a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-bar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 9px 11px;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.attention-card {
  display: grid;
  gap: 5px;
  min-height: 110px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3fa;
  color: var(--ink);
  padding: 14px;
  text-decoration: none;
}

.attention-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(6, 47, 95, 0.08);
  color: var(--navy);
}

.attention-icon .icon {
  width: 19px;
  height: 19px;
}

.attention-card.hot .attention-icon {
  background: rgba(179, 38, 30, 0.12);
  color: var(--risk);
}

.attention-card.warm .attention-icon {
  background: rgba(247, 197, 20, 0.22);
  color: #8a6400;
}

.attention-card strong {
  font-size: 30px;
}

.attention-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.attention-card.hot {
  border-color: #f0aaa4;
  background: #fff4f3;
}

.attention-card.warm {
  border-color: #e8c19c;
  background: #fff9ef;
}

/* Alerts page: same card colors as the dashboard stat tiles, but the title is
   a full sentence (often containing long command names), not a big number. */
.alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.attention-card.alert-card {
  min-height: 0;
  align-content: start;
}

.attention-card.alert-card strong {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.attention-card.alert-card span {
  overflow-wrap: anywhere;
}

.profile-fee {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #eef3fa;
  color: var(--accent);
  font-weight: 900;
}

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

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--gold);
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e7edf6;
  color: #1f3a57;
  font-size: 12px;
  font-weight: 800;
}

.badge.risk {
  background: #ffe2df;
  color: var(--risk);
}

.badge.good {
  background: #dff2e8;
  color: #0d5230;
}

.badge.warn {
  background: #fff0d8;
  color: #704100;
}

.mini {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mini-link {
  display: inline-block;
  margin-left: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.risk-text {
  color: var(--risk);
}

.transcript-box {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3fa;
  padding: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(6, 47, 95, 0.55), rgba(4, 36, 74, 0.78)),
    url("images/report-cover.b574486d7494.jpg") center top / cover no-repeat;
}

.auth-card {
  width: min(430px, 100%);
  padding: 32px;
  border-top: 4px solid var(--gold);
}

.auth-card .brand-line {
  margin-bottom: 18px;
}

.auth-card p.message {
  margin: 0 0 12px;
}

.auth-card > p {
  text-align: center;
  margin: 16px 0 0;
}

.auth-card > p a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack p {
  margin: 0;
  display: grid;
  gap: 6px;
}

.stack label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 12px;
}

.auth-card input:focus {
  outline: 2px solid var(--navy);
  border-color: var(--navy);
}

.auth-card .button.primary {
  width: 100%;
  min-height: 46px;
}

.form-panel {
  max-width: 760px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid > div {
  display: grid;
  gap: 6px;
}

.form-grid label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}

.form-grid .helptext {
  color: var(--muted);
  font-size: 12px;
}

.errorlist {
  margin: 0;
  padding-left: 18px;
  color: var(--risk);
  font-size: 13px;
}

.audit-filter {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.audit-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.audit-filter input {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
}

.inline-form {
  margin: 0;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-action {
  margin-top: 12px;
}

.report-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3fa;
  padding: 16px;
  line-height: 1.55;
}

.report-preview h3,
.report-preview h4,
.report-preview p {
  margin-top: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  min-height: 40px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.button .icon {
  width: 16px;
  height: 16px;
}

.button.primary {
  background: var(--gold);
  color: var(--navy-deep);
}

.button.secondary {
  background: #f4f7fa;
  border: 1px solid var(--line);
  color: var(--navy);
}

.button.ghost {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  border-radius: 6px;
  padding: 10px 12px;
  background: #e7edf6;
  color: #1f3a57;
  font-weight: 700;
}

.message.success {
  background: #dff2e8;
  color: #0d5230;
}

.message.error {
  background: #ffe2df;
  color: var(--risk);
}

@media (max-width: 920px) {
  .app-shell,
  .cols-2,
  .cols-3,
  .cols-4,
  .attention-grid,
  .alert-grid,
  .search-bar {
    grid-template-columns: 1fr;
  }
}
