:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --ink: #17202a;
  --muted: #667386;
  --line: #d8e0e8;
  --accent: #116466;
  --accent-2: #d6a84f;
  --danger: #b8403a;
  --ok: #21815d;
  --shadow: 0 24px 70px rgba(20, 38, 57, 0.16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 0.9fr);
  background: var(--panel);
}

.login__visual {
  position: relative;
  overflow: hidden;
  background: #1f3340;
}

.login__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.38;
  filter: saturate(0.8) contrast(1.05);
}

.visual-card {
  position: absolute;
  left: clamp(24px, 6vw, 84px);
  bottom: clamp(24px, 6vw, 84px);
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  width: min(360px, calc(100% - 48px));
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(11, 24, 32, 0.62);
  color: #fff;
  backdrop-filter: blur(12px);
}

.visual-card strong {
  font-size: 22px;
}

.visual-card small {
  color: rgba(255, 255, 255, 0.72);
}

.signal {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #54d18a;
  box-shadow: 0 0 0 6px rgba(84, 209, 138, 0.18);
}

.login__form {
  align-self: center;
  justify-self: center;
  width: min(420px, calc(100% - 48px));
  display: grid;
  gap: 18px;
}

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

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 28px;
}

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

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 100, 102, 0.14);
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
}

.primary {
  min-height: 48px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.login__status {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
}

.dashboard {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.is-locked .dashboard {
  display: none;
}

.shell:not(.is-locked) .login {
  display: none;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
  background: #14242f;
  color: white;
}

.brand--compact .brand__mark {
  width: 38px;
  height: 38px;
  background: var(--accent-2);
  color: #1f252b;
}

.brand--compact small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
}

nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

nav a,
.ghost {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
}

nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.ghost {
  justify-content: center;
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
}

.workspace {
  padding: 28px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.topbar,
.panel,
.metrics article {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 92px;
  padding: 20px 22px;
}

.topbar h2,
.eyebrow,
.panel h3 {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
}

.status-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #b9dfce;
  border-radius: 999px;
  color: var(--ok);
  background: #eefaf4;
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ok);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.metrics article {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 18px;
}

.metrics span,
.metrics small {
  color: var(--muted);
}

.metrics strong {
  font-size: 28px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel--wide {
  grid-column: 1 / -1;
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

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

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

th {
  color: var(--muted);
  font-weight: 600;
}

.ok,
.warn {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
}

.ok {
  background: #e8f7ef;
  color: var(--ok);
}

.warn {
  background: #fff6df;
  color: #93691a;
}

.rule-list,
.audit {
  display: grid;
  gap: 10px;
}

.rule-list div,
.audit p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.rule-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

time {
  display: inline-block;
  width: 54px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .login,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .login__visual {
    min-height: 220px;
  }

  .sidebar {
    min-height: auto;
    grid-template-columns: 1fr auto;
  }

  .sidebar nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  th:nth-child(2),
  td:nth-child(2) {
    display: none;
  }
}
