:root {
  color-scheme: dark;
  --ink: #16071f;
  --purple: #301149;
  --purple-mid: #55217a;
  --purple-soft: #9b61bd;
  --gold: #e6b84f;
  --gold-light: #ffe3a1;
  --paper: #fff9ed;
  --muted: #cfbddb;
  --line: rgba(244, 221, 163, .19);
  --danger: #ffb3bc;
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--paper); background: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }

.admin-ambient { position: fixed; pointer-events: none; filter: blur(2px); opacity: .8; }
.admin-ambient-one { inset: -22vw auto auto -18vw; width: 62vw; height: 62vw; border-radius: 50%; background: radial-gradient(circle, #6d2f91 0%, transparent 69%); }
.admin-ambient-two { inset: auto -20vw -30vw auto; width: 70vw; height: 70vw; border-radius: 50%; background: radial-gradient(circle, #3d2067 0%, transparent 66%); }

.admin-page { position: relative; z-index: 1; min-height: 100vh; padding: 30px clamp(17px, 4vw, 64px) 48px; }
.admin-eyebrow { margin: 0 0 11px; color: var(--gold-light); font-size: 10px; font-weight: 700; letter-spacing: .16em; }

.login-view { display: grid; min-height: calc(100vh - 78px); max-width: 580px; align-content: center; justify-items: start; margin: auto; }
.login-mark, .brand-monogram { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid rgba(239, 200, 106, .72); border-radius: 50%; color: var(--gold-light); background: radial-gradient(circle at 32% 25%, #78479c, #301149 70%); box-shadow: 0 0 0 7px rgba(230, 184, 79, .08); font-family: "Playfair Display", Georgia, serif; font-size: 22px; }
.login-view > .login-mark { margin-bottom: 28px; }
.login-view h1, .create-panel h1, .members-heading h2, .dialog h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; letter-spacing: -.04em; }
.login-view h1 { max-width: 550px; margin-top: 21px; font-size: clamp(42px, 8vw, 72px); line-height: .98; }
em { color: var(--gold-light); font-weight: 600; }
.login-view p:not(.admin-eyebrow) { max-width: 440px; margin: 22px 0 29px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.login-form { display: grid; width: min(100%, 440px); gap: 14px; }
.login-form label { display: grid; gap: 6px; }
.login-form label span { color: var(--paper); font-size: 12px; font-weight: 600; }
.login-form .primary-button { margin-top: 3px; }
.login-secondary-link { margin-top: 17px; color: var(--gold-light); font-size: 13px; font-weight: 700; text-decoration: none; }
.login-secondary-link:hover { color: var(--paper); text-decoration: underline; }
.login-help { margin: 15px 0 0 !important; color: #b89cc8 !important; font-size: 12px !important; line-height: 1.5 !important; }

.primary-button, .secondary-button, .text-button, .icon-button { border: 0; border-radius: 12px; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.primary-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 11px; padding: 0 19px; color: #281139; background: linear-gradient(135deg, #ffe1a0, #d69d30); box-shadow: 0 12px 30px rgba(0, 0, 0, .27); font-size: 14px; font-weight: 700; }
.primary-button:hover { transform: translateY(-2px); background: linear-gradient(135deg, #ffebbd, #e7af41); }
.wide { width: 100%; }
.secondary-button { min-height: 39px; padding: 0 13px; border: 1px solid var(--line); color: var(--gold-light); background: rgba(255,255,255,.04); font-size: 12px; font-weight: 700; }
.secondary-button:hover { border-color: rgba(244, 221, 163, .52); background: rgba(255,255,255,.08); }
.text-button { min-height: 38px; padding: 0 8px; color: var(--gold-light); background: transparent; font-size: 13px; }
.text-button:hover { background: rgba(255,255,255,.07); }
.icon-button { display: grid; width: 43px; height: 43px; place-items: center; border: 1px solid var(--line); color: var(--gold-light); background: rgba(255,255,255,.04); }
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover { background: rgba(255,255,255,.1); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.dashboard { max-width: 1320px; margin: 0 auto; }
.dashboard-header { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--paper); text-decoration: none; }
.brand-monogram { width: 39px; height: 39px; box-shadow: none; font-size: 15px; }
.brand-lockup strong { display: block; font-family: "Playfair Display", Georgia, serif; font-size: 17px; }
.brand-lockup small { display: block; margin-top: 2px; color: var(--gold-light); font-size: 7px; font-weight: 700; letter-spacing: .14em; }
.account-actions { display: flex; align-items: center; gap: 10px; }
.account-email { max-width: 220px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.password-link-button { white-space: nowrap; }

.dashboard-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.6fr); gap: clamp(28px, 5vw, 80px); padding-top: clamp(31px, 5vw, 62px); }
.users-panel { margin-top: clamp(32px, 5vw, 66px); padding-top: clamp(27px, 4vw, 44px); border-top: 1px solid var(--line); }
.users-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.users-heading h2 { margin: 0; font-family: "Playfair Display", Georgia, serif; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.04em; }
.users-heading .panel-copy { max-width: 650px; margin-bottom: 0; }
.users-owner-note { max-width: 220px; color: var(--gold-light); font-size: 11px; line-height: 1.5; text-align: right; }
.user-form { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(180px, .7fr) minmax(300px, 1.6fr); align-items: end; gap: 13px; margin-top: 25px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.user-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.user-form legend { margin-bottom: 7px; color: var(--paper); font-size: 12px; font-weight: 600; }
.permission-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.permission-option { display: flex; min-height: 38px; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid rgba(244,221,163,.12); border-radius: 9px; background: rgba(7,1,12,.2); }
.permission-option input { width: 15px; min-height: 15px; margin-top: 2px; accent-color: var(--gold); }
.permission-copy { display: grid; gap: 2px; min-width: 0; }
.permission-copy strong { color: var(--paper); font-size: 10px; }
.permission-copy small { color: var(--muted); font-size: 9px; line-height: 1.25; }
.user-form-actions { display: flex; align-items: center; gap: 9px; grid-column: 1 / -1; }
.user-form-actions .primary-button, .user-form-actions .secondary-button { min-height: 42px; }
.users-list { display: grid; gap: 9px; margin-top: 12px; }
.user-row { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.7fr) auto; align-items: center; gap: 18px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.028); }
.user-identity { display: grid; gap: 3px; min-width: 0; }
.user-identity strong { overflow: hidden; color: var(--paper); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.user-identity small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.user-identity .user-status { color: var(--gold-light); }
.user-permissions { margin: 0; color: #cdb3dd; font-size: 11px; line-height: 1.45; }
.user-actions { display: flex; align-items: center; justify-content: end; gap: 8px; }
.user-delete { color: var(--danger); }
.activation-panel { display: grid; gap: 8px; margin-top: 16px; padding: 18px; border: 1px solid rgba(244, 221, 163, .34); border-radius: 16px; background: linear-gradient(140deg, rgba(89, 35, 127, .45), rgba(45, 13, 69, .5)); }
.activation-panel h3 { margin: 0; color: var(--paper); font-family: "Playfair Display", Georgia, serif; font-size: 23px; letter-spacing: -.02em; }
.activation-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.activation-link-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.activation-link { min-width: 0; overflow-wrap: anywhere; color: var(--gold-light); font-size: 12px; line-height: 1.4; }
.activation-link-row .secondary-button { flex: 0 0 auto; }

.create-panel { position: sticky; top: 28px; align-self: start; padding: clamp(22px, 3vw, 34px); border: 1px solid rgba(245, 218, 145, .21); border-radius: 23px; background: linear-gradient(140deg, rgba(89, 35, 127, .75), rgba(45, 13, 69, .77)); box-shadow: 0 22px 60px rgba(0,0,0,.22); }
.create-panel h1 { max-width: 290px; font-size: clamp(30px, 3.4vw, 45px); line-height: 1.02; }
.panel-copy, .form-note { color: var(--muted); font-size: 13px; line-height: 1.55; }
.panel-copy { margin: 15px 0 23px; }
.form-note { margin: 15px 0 0; font-size: 11px; }
.public-enrollment-panel { display: grid; gap: 10px; margin-top: 24px; padding-top: 22px; border-top: 1px solid rgba(244, 221, 163, .17); }
.public-enrollment-panel h2 { margin: 0; color: var(--paper); font-family: "Playfair Display", Georgia, serif; font-size: 23px; letter-spacing: -.025em; }
.public-enrollment-panel p:not(.admin-eyebrow) { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.public-enrollment-panel a { overflow-wrap: anywhere; color: var(--gold-light); font-size: 11px; line-height: 1.45; }
.public-enrollment-panel .secondary-button { min-height: 39px; }
.member-form, .dialog-card { display: grid; gap: 15px; }
.member-form label, .dialog-card label { display: grid; gap: 6px; }
.member-form label span, .dialog-card label span { color: var(--paper); font-size: 12px; font-weight: 600; }
.member-form i, .dialog-card i { color: #a990b9; font-size: 10px; font-style: normal; font-weight: 400; }
input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid rgba(244, 221, 163, .22); border-radius: 10px; color: var(--paper); background: rgba(8, 2, 13, .33); }
input::placeholder { color: #a992b7; }
input[type="date"] { color-scheme: dark; }

.members-panel { min-width: 0; }
.members-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; }
.members-heading h2 { font-size: clamp(31px, 4vw, 48px); line-height: 1; }
.total-count { color: var(--gold-light); font-size: 12px; font-weight: 600; white-space: nowrap; }
.members-toolbar { display: flex; gap: 10px; margin: 25px 0 12px; }
.search-field { display: flex; min-width: 0; flex: 1; align-items: center; gap: 9px; padding-left: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); color: var(--gold-light); }
.search-field svg { flex: 0 0 auto; width: 19px; height: 19px; }
.search-field input { min-width: 0; border: 0; background: transparent; }
.status-message { min-height: 18px; margin: 0 0 8px; color: var(--gold-light); font-size: 12px; }
.members-list { display: grid; gap: 9px; }
.member-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(130px, .5fr) auto; align-items: center; gap: 18px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(120deg, rgba(78, 28, 110, .6), rgba(30, 9, 45, .57)); }
.member-row:hover { border-color: rgba(245, 218, 145, .37); }
.member-name { display: block; overflow: hidden; color: var(--paper); font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.member-link { display: inline-block; max-width: 100%; margin-top: 5px; overflow: hidden; color: #cdb3dd; font-size: 11px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.member-link:hover { color: var(--gold-light); text-decoration: underline; }
.member-meta { color: #b89cc8; font-size: 11px; line-height: 1.55; }
.member-status { display: inline-flex; width: fit-content; margin-bottom: 5px; padding: 3px 7px; border: 1px solid rgba(244, 221, 163, .27); border-radius: 999px; color: var(--gold-light); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.member-status.blocked { border-color: rgba(255, 179, 188, .38); color: var(--danger); }
.member-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.member-actions button, .member-actions a { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; color: var(--gold-light); background: rgba(255,255,255,.05); font-size: 11px; font-weight: 600; text-decoration: none; }
.member-actions button:hover, .member-actions a:hover { border-color: var(--line); background: rgba(255,255,255,.1); }
.member-actions button.block { color: var(--danger); }
.member-actions button.delete { color: var(--danger); border-color: rgba(255, 179, 188, .22); }
.members-empty { padding: 57px 20px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; }
.members-empty span { color: var(--gold-light); font-size: 28px; }
.members-empty h3 { margin: 10px 0 5px; color: var(--paper); font-family: "Playfair Display", Georgia, serif; font-size: 22px; }
.members-empty p { margin: 0; font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 13px; padding-top: 18px; color: var(--muted); font-size: 12px; }
.common-applications-panel { margin-top: clamp(38px, 6vw, 70px); padding: clamp(22px, 4vw, 34px); border: 1px solid rgba(245, 218, 145, .18); border-radius: 22px; background: rgba(255,255,255,.025); }
.common-applications-panel .members-heading h2 { font-size: clamp(28px, 3.8vw, 43px); }
.common-applications-panel .panel-copy { margin: 9px 0 0; }
.common-applications-list { display: grid; gap: 9px; }
.application-toolbar { align-items: stretch; }
.admin-status-filter { flex: 0 0 172px; }
.admin-status-filter select { width: 100%; min-height: 44px; padding: 0 31px 0 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--paper); background: rgba(255,255,255,.04); font: inherit; font-size: 11px; }
.admin-status-filter select option { color: #261031; background: #fff9ed; }
.application-approval-action { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.application-approval-action input { width: 132px; min-height: 34px; padding: 0 8px; border-radius: 8px; font-size: 10px; }
.application-approval-action input[type="date"] { color-scheme: dark; }

.dialog { width: min(92vw, 430px); padding: 0; border: 1px solid rgba(244, 221, 163, .35); border-radius: 20px; color: var(--paper); background: #31114a; box-shadow: 0 28px 100px rgba(0,0,0,.72); }
.dialog::backdrop { background: rgba(4,0,8,.76); backdrop-filter: blur(6px); }
.dialog-card { position: relative; padding: 28px; }
.dialog h2 { margin-bottom: 3px; font-size: 30px; }
.dialog-close { position: absolute; top: 11px; right: 13px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--gold-light); background: transparent; font-size: 27px; line-height: 1; }
.dialog-close:hover { background: rgba(255,255,255,.1); }
.qr-card { justify-items: center; text-align: center; }
.qr-card > p:not(.admin-eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }
.qr-card img { width: min(100%, 240px); min-height: 180px; padding: 12px; border-radius: 13px; background: var(--paper); }

@media (max-width: 820px) { .dashboard-layout { grid-template-columns: 1fr; } .create-panel { position: static; } .user-form { grid-template-columns: 1fr 1fr; } .user-form fieldset, .user-form-actions { grid-column: 1 / -1; } }
@media (max-width: 590px) { .admin-page { padding: 21px 14px 34px; } .dashboard-header { align-items: flex-start; } .account-actions { align-items: end; flex-direction: column; } .account-email { max-width: 150px; } .member-row { grid-template-columns: 1fr; gap: 10px; } .member-actions { justify-content: start; } .members-heading, .users-heading { align-items: flex-start; flex-direction: column; } .users-owner-note { max-width: none; text-align: left; } .user-form { grid-template-columns: 1fr; } .user-form fieldset, .user-form-actions { grid-column: auto; } .permission-list { grid-template-columns: 1fr; } .user-row { grid-template-columns: 1fr; gap: 10px; } .user-actions { justify-content: start; flex-wrap: wrap; } .activation-link-row { align-items: stretch; flex-direction: column; } .activation-link-row .secondary-button { width: 100%; } .application-toolbar { flex-wrap: wrap; } .application-toolbar .search-field { flex: 1 1 100%; } .admin-status-filter { flex: 1 1 170px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

.companies-nav-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
