:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #64748b;
  --line: #d9e2ec;
  --brand: #174a7c;
  --brand-2: #0f766e;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 24px;
}

.topbar strong {
  color: var(--brand);
  font-size: 18px;
  margin-right: 10px;
}

.topbar span {
  color: var(--muted);
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 14px;
  white-space: nowrap;
}

.logout-form {
  margin: 0;
}

.logout-button {
  background: none;
  border: 0;
  color: var(--brand);
  cursor: pointer;
  display: inline;
  min-height: auto;
  padding: 0;
}

.page {
  padding: 24px;
}

.page-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
  margin: 6px 0 0;
}

.note {
  margin-bottom: 18px;
}

.muted {
  color: var(--muted);
}

.filters,
.form-grid {
  display: flex;
  gap: 10px;
}

.form-grid {
  align-items: stretch;
  flex-direction: column;
}

input,
select,
button,
.button {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 36px;
  padding: 7px 10px;
}

button,
.button {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.kpis div,
.panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.kpis div {
  padding: 14px;
}

.kpis span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

.kpis strong {
  font-size: 20px;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.panel {
  overflow-x: auto;
  padding: 16px;
}

.panel.narrow {
  max-width: 640px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
}

.badge.high {
  background: #d1fae5;
  color: #065f46;
}

.badge.moderate {
  background: #e0f2fe;
  color: #075985;
}

.badge.low {
  background: #fee2e2;
  color: #991b1b;
}

.messages {
  margin-bottom: 16px;
}

.message {
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.pagination {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.login-body {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.login-panel {
  padding: 28px;
  width: min(420px, calc(100vw - 32px));
}

.login-panel h1 {
  color: var(--brand);
}

.login-panel form p {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-panel button {
  justify-content: center;
  width: 100%;
}

@media (max-width: 1000px) {
  .topbar,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav,
  .filters {
    flex-wrap: wrap;
  }

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

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }

  .kpis,
  .grid.two {
    grid-template-columns: 1fr;
  }
}
