:root {
  --bg: #071225;
  --panel: #111f3d;
  --panel-soft: #17284d;
  --border: rgba(131, 159, 255, 0.27);
  --text: #f2f6ff;
  --muted: #adc0eb;
  --accent: #5b6cff;
  --accent-2: #26c1f3;
  --ok: #33cf99;
  --warn: #f2b450;
  --danger: #ee6487;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1a2c52 0%, #09142d 46%, #071225 100%);
  color: var(--text);
}

a {
  color: #8acbff;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(18, 33, 65, 0.94) 0%, rgba(14, 25, 49, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.5rem;
}

.muted {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

label {
  display: grid;
  gap: 0.34rem;
  font-size: 0.83rem;
  color: var(--muted);
}

input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: rgba(11, 19, 38, 0.9);
  border: 1px solid rgba(134, 167, 255, 0.35);
  border-radius: 10px;
  padding: 0.54rem 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(126, 161, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(90, 127, 255, 0.2);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.56rem 0.8rem;
  font-weight: 600;
}

button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}

button.secondary {
  background: rgba(44, 67, 120, 0.6);
  border-color: rgba(140, 165, 255, 0.35);
  color: #fff;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-box {
  margin-top: 0.75rem;
  padding: 0.64rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(125, 161, 255, 0.3);
  background: rgba(21, 35, 69, 0.62);
  min-height: 44px;
  font-size: 0.84rem;
}

.status-box.error {
  border-color: rgba(240, 116, 150, 0.5);
  background: rgba(133, 40, 72, 0.42);
}

.status-box.success {
  border-color: rgba(106, 232, 178, 0.54);
  background: rgba(21, 109, 78, 0.42);
}

.helper-links {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.portal-app {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  width: min(1180px, 100%);
}

.portal-header,
.panel {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 33, 65, 0.92) 0%, rgba(14, 25, 49, 0.95) 100%);
  border-radius: 14px;
  padding: 0.84rem;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ghost-link {
  text-decoration: none;
  border: 1px solid rgba(132, 159, 255, 0.42);
  border-radius: 999px;
  padding: 0.29rem 0.56rem;
  color: #d7e7ff;
}

.kv-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kv {
  border: 1px solid rgba(120, 154, 245, 0.25);
  border-radius: 10px;
  padding: 0.56rem;
  background: rgba(26, 42, 82, 0.45);
}

.kv .label {
  color: var(--muted);
  font-size: 0.78rem;
}

.kv .value {
  font-weight: 650;
  margin-top: 0.18rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead th {
  text-align: left;
  font-size: 0.76rem;
  color: #c9dafd;
  border-bottom: 1px solid rgba(133, 160, 234, 0.24);
  padding: 0.5rem 0.38rem;
}

tbody td {
  border-bottom: 1px solid rgba(89, 115, 187, 0.2);
  padding: 0.47rem 0.38rem;
  font-size: 0.83rem;
}

.badge {
  border-radius: 999px;
  padding: 0.2rem 0.52rem;
  border: 1px solid rgba(131, 158, 238, 0.37);
  background: rgba(42, 66, 120, 0.46);
  font-size: 0.72rem;
}

.badge.alert {
  border-color: rgba(244, 122, 157, 0.57);
  background: rgba(146, 47, 83, 0.42);
  color: #ffd2df;
}

.badge.ok {
  border-color: rgba(112, 231, 182, 0.58);
  background: rgba(21, 113, 82, 0.42);
  color: #ceffee;
}

.activity {
  display: grid;
  gap: 0.3rem;
  min-width: 170px;
}

.activity .meter {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(55, 83, 140, 0.42);
  overflow: hidden;
}

.activity .fill {
  height: 100%;
}

.fill.none { background: #7786aa; }
.fill.low { background: #35d49a; }
.fill.medium { background: #f2b450; }
.fill.high { background: #ee6487; }

@media (max-width: 760px) {
  .auth-card {
    padding: 0.85rem;
  }
}
