:root {
  --sky: #5bbfff;
  --cyan: #43d6e9;
  --blue: #239dec;
  --ink: #102840;
  --muted: #5f7f99;
  --line: rgba(91, 191, 255, 0.22);
  --paper: #ffffff;
  --bg: #f5faff;
  --green: #18b982;
  --red: #e55656;
  --yellow: #f2b84b;
  --shadow: 0 24px 70px rgba(24, 102, 165, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 8%, rgba(67, 214, 233, 0.18), transparent 28%),
    linear-gradient(180deg, #f8fcff, var(--bg));
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 22% 8%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(112deg, #4eb8f6 0%, var(--sky) 48%, var(--cyan) 100%);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 40px;
  align-items: center;
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
}

.login-visual {
  position: relative;
  min-height: 520px;
}

.brand-orbit {
  position: absolute;
  inset: 40px auto auto 20px;
  display: grid;
  width: 360px;
  height: 360px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.brand-orbit img {
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 18px 36px rgba(16, 40, 64, 0.16));
}

.brand-orbit span {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
}

.brand-orbit span:nth-child(2) {
  inset: 54px;
}

.brand-orbit span:nth-child(3) {
  inset: -58px;
}

.brand-orbit span:nth-child(4) {
  inset: 136px;
  background: rgba(255, 255, 255, 0.18);
}

.login-copy {
  position: absolute;
  left: 0;
  bottom: 34px;
  max-width: 600px;
}

.login-copy p,
.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-copy p {
  color: rgba(255, 255, 255, 0.78);
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: 72px;
  line-height: 0.96;
}

.login-copy span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 21px;
  line-height: 1.45;
}

.login-card {
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 28px;
}

.login-card h2 {
  margin: 0 0 28px;
  font-size: 32px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.login-card button,
.toolbar button,
.top-actions button,
.logout-button,
.icon-button,
.action-row button {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: var(--blue);
}

.login-card button {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
}

.form-error {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
}

.panel-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.panel-brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(91, 191, 255, 0.13);
}

.panel-brand img {
  width: 28px;
  height: 28px;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.side-nav button,
.logout-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  background: transparent;
}

.side-nav button.is-active,
.side-nav button:hover {
  color: var(--blue);
  background: rgba(91, 191, 255, 0.13);
}

.logout-button {
  margin-top: auto;
  color: var(--red);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.workspace-top h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1;
}

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

.top-actions span {
  color: var(--muted);
  font-size: 14px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.metric {
  min-height: 118px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 44px rgba(42, 141, 214, 0.08);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 16px;
  font-size: 34px;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.panel-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 44px rgba(42, 141, 214, 0.08);
}

.panel-card {
  padding: 20px;
}

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

.panel-card h2 {
  margin: 0;
  font-size: 20px;
}

.panel-card header span {
  color: var(--muted);
  font-size: 13px;
}

canvas {
  width: 100%;
  max-height: 260px;
}

.status-list,
.risk-list {
  display: grid;
  gap: 10px;
}

.status-item,
.risk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f5faff;
}

.status-pill {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  background: rgba(24, 185, 130, 0.12);
}

.status-pill.bad {
  color: var(--red);
  background: rgba(229, 86, 86, 0.12);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px auto;
  gap: 12px;
  margin-bottom: 14px;
}

.table-card {
  overflow: auto;
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(91, 191, 255, 0.14);
  text-align: left;
  vertical-align: middle;
}

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

tr[data-user-id] {
  cursor: pointer;
}

tr[data-user-id]:hover {
  background: #f8fcff;
}

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

.drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(16, 40, 64, 0.22);
  z-index: 10;
}

.drawer.is-open {
  display: flex;
}

.drawer-panel {
  width: min(720px, 100%);
  height: 100%;
  overflow: auto;
  padding: 26px;
  background: #fff;
  box-shadow: var(--shadow);
}

.drawer-panel > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.drawer-panel h2 {
  margin: 0;
}

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

.detail-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
}

.detail-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-box strong {
  display: block;
  margin-top: 8px;
  word-break: break-word;
}

.config-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.action-row button.secondary {
  color: var(--blue);
  background: rgba(91, 191, 255, 0.13);
}

.action-row button.danger {
  background: var(--red);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: var(--ink);
  box-shadow: var(--shadow);
  z-index: 20;
}

.toast.is-visible {
  display: block;
}

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

  .login-visual {
    display: none;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .metric-grid,
  .metric-grid.compact,
  .detail-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

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