body.auth-locked > .topbar,
body.auth-locked > main,
body.auth-locked > .mini-sum,
body.auth-locked > .toasts { visibility: hidden; }

.auth-gate,
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 20% 0%, rgba(34, 211, 238, .14), transparent),
    radial-gradient(900px 520px at 100% 100%, rgba(59, 130, 246, .16), transparent),
    #060d1f;
  overflow: auto;
}

.auth-modal { background: rgba(3, 8, 22, .82); backdrop-filter: blur(8px); }
.auth-gate[hidden], .auth-modal[hidden] { display: none !important; }

.auth-card {
  width: min(100%, 470px);
  border: 1px solid #243968;
  border-radius: 18px;
  padding: 28px;
  color: #e6edf9;
  background: linear-gradient(145deg, #0e1a38, #0a1430);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .52);
}

.auth-card.wide { width: min(100%, 860px); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.auth-brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: #04122b; background: linear-gradient(135deg, #22d3ee, #3b82f6); font-weight: 850; font-size: 17px; }
.auth-brand h2 { margin: 0; font-size: 23px; }
.auth-brand p { margin: 3px 0 0; color: #8fa3c9; font-size: 12px; }
.auth-title { margin: 0 0 5px; font-size: 20px; }
.auth-subtitle { margin: 0 0 20px; color: #9db0d4; font-size: 13px; }

.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; color: #b9c7e2; font-size: 12px; font-weight: 650; }
.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #2b4174;
  border-radius: 10px;
  padding: 10px 12px;
  color: #e6edf9;
  background: #091330;
  outline: none;
}
.auth-form input:focus,
.auth-form select:focus { border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.auth-form option { background: #091330; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-btn {
  min-height: 44px;
  border: 1px solid #31518b;
  border-radius: 10px;
  padding: 9px 14px;
  color: #e6edf9;
  background: #152957;
  cursor: pointer;
  font-weight: 750;
}
.auth-btn:hover { filter: brightness(1.12); }
.auth-btn.primary { border-color: transparent; color: #03142c; background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.auth-btn.danger { border-color: #7f1d1d; color: #fecaca; background: #3f121a; }
.auth-btn.link { min-height: auto; border: 0; padding: 4px; color: #67e8f9; background: transparent; font-weight: 600; }
.auth-btn[disabled] { opacity: .55; cursor: wait; }
.auth-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; }
.auth-actions.end { justify-content: flex-end; }
.auth-msg { min-height: 20px; margin: 10px 0 0; color: #fca5a5; font-size: 12px; }
.auth-msg.ok { color: #86efac; }
.auth-note { padding: 11px 12px; border: 1px solid #2b4174; border-radius: 10px; color: #b9c7e2; background: #0a1735; font-size: 12px; }
.auth-question { padding: 12px; border-left: 3px solid #22d3ee; color: #e6edf9; background: #0a1735; }

.auth-user-tools { display: flex; align-items: center; gap: 7px; }
.auth-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mut); font-size: 12px; }
.auth-top-btn { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; color: var(--txt); background: var(--panel2); cursor: pointer; font-size: 12px; }

.auth-modal-card { position: relative; width: min(100%, 900px); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #2b4174; border-radius: 16px; padding: 24px; color: #e6edf9; background: #0e1a38; box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }
.auth-modal-x { position: absolute; top: 12px; right: 14px; border: 0; color: #cbd5e1; background: transparent; cursor: pointer; font-size: 26px; }
.auth-users { display: grid; gap: 8px; margin-top: 18px; }
.auth-user-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.4fr) auto auto; gap: 8px; align-items: center; border: 1px solid #243968; border-radius: 10px; padding: 10px; background: #0a1430; }
.auth-user-row small { color: #8fa3c9; }
.auth-pill { display: inline-block; border: 1px solid #31518b; border-radius: 99px; padding: 2px 7px; color: #a5dff0; font-size: 10px; text-transform: uppercase; }

@media (max-width: 720px) {
  .auth-gate, .auth-modal { padding: 12px; }
  .auth-card, .auth-modal-card { padding: 20px; border-radius: 14px; }
  .auth-row { grid-template-columns: 1fr; }
  .auth-user-name { display: none; }
  .auth-top-btn { padding: 7px; }
  .auth-user-row { grid-template-columns: 1fr auto; }
  .auth-user-row > :nth-child(2) { grid-column: 1 / -1; }
}

[data-theme="light"] .auth-gate {
  background: radial-gradient(900px 520px at 20% 0%, #cffafe, transparent), #edf3ff;
}
[data-theme="light"] .auth-card,
[data-theme="light"] .auth-modal-card { color: #0f172a; border-color: #cbd5e1; background: #fff; }
[data-theme="light"] .auth-brand p,
[data-theme="light"] .auth-subtitle,
[data-theme="light"] .auth-form label { color: #475569; }
[data-theme="light"] .auth-form input,
[data-theme="light"] .auth-form select { color: #0f172a; border-color: #cbd5e1; background: #f8fafc; }
