:root {
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: #04111f;
  color: #f7fbff;
  --line: rgba(148, 191, 230, 0.2);
  --muted: #98adc2;
  --panel: rgba(11, 31, 51, 0.92);
  --cyan: #14b8f0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% -10%, #12345d 0, #061728 38%, #030c16 100%);
}
a {
  color: inherit;
}
button,
input,
select {
  font: inherit;
}
.portal-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
.auth-card,
.portal-card,
.users-card {
  width: min(100%, 720px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  padding: clamp(24px, 5vw, 44px);
}
.auth-card {
  max-width: 460px;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}
.brand div {
  display: grid;
  gap: 2px;
}
.brand strong {
  font-size: 1.15rem;
}
.brand span,
p,
small,
.user-row span {
  color: var(--muted);
}
.intro {
  margin: 42px 0 24px;
}
h1 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 8vw, 3rem);
  letter-spacing: -0.05em;
}
p {
  margin: 0;
  line-height: 1.5;
}
.eyebrow {
  color: #61cff5;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
form {
  display: grid;
  gap: 16px;
}
label {
  display: grid;
  gap: 8px;
  color: #d9e9f6;
  font-weight: 700;
}
input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #061522;
  color: white;
  padding: 0 14px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(20, 184, 240, 0.13);
}
button,
.secondary {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #18bbed, #0786d5);
  color: white;
  font-weight: 800;
  padding: 0 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}
.legal {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.78rem;
}
.error,
.notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 150, 95, 0.45);
  border-radius: 14px;
  background: rgba(119, 48, 23, 0.25);
  color: #ffd9c5;
}
.portal-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin: 42px 0 28px;
}
.role {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #a9ddf2;
  font-size: 0.78rem;
  font-weight: 800;
}
.application-grid {
  display: grid;
  gap: 14px;
}
.application {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 94px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(13, 43, 70, 0.72);
  text-decoration: none;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease;
}
.application:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 203, 244, 0.6);
}
.application span:nth-child(2) {
  display: grid;
  gap: 4px;
}
.application small {
  line-height: 1.3;
}
.application-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #119ddd;
  font-weight: 900;
  font-size: 1.2rem;
}
.dispatch .application-icon {
  background: #28a374;
}
.portal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 22px;
}
.portal-actions form {
  display: block;
}
.secondary {
  background: #122d44;
  border: 1px solid var(--line);
}
.text-button {
  min-height: auto;
  padding: 10px;
  background: transparent;
  color: var(--muted);
}
.back {
  display: inline-block;
  margin: 24px 0;
  color: #8edcf8;
  font-weight: 800;
  text-decoration: none;
}
.compact h1,
.users-card h1 {
  font-size: 2.2rem;
}
.users-card header {
  margin-bottom: 26px;
}
.user-list {
  display: grid;
  gap: 10px;
}
.user-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(8, 28, 45, 0.66);
}
.user-row > div {
  display: grid;
  gap: 4px;
}
details {
  margin-top: 14px;
}
summary {
  color: #7dd8f6;
  font-weight: 800;
  cursor: pointer;
}
details form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
}
.checkbox input {
  width: 20px;
  min-height: 20px;
}
.secondary-button {
  background: #18334a;
  border: 1px solid var(--line);
}
.create-user {
  margin-top: 18px;
  border: 1px dashed rgba(95, 205, 244, 0.4);
  border-radius: 18px;
  padding: 18px;
}
.notice .secondary {
  margin-top: 14px;
}
@media (max-width: 520px) {
  .portal-shell {
    padding-inline: 0;
    align-items: stretch;
  }
  .auth-card,
  .portal-card,
  .users-card {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding: 24px 18px;
  }
  .portal-header,
  .portal-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .portal-actions .secondary {
    width: 100%;
  }
}
