:root {
  color-scheme: light;
  --navy: #0a1b43;
  --blue: #164dbb;
  --bright-blue: #2f70ff;
  --red: #e2222b;
  --ink: #101827;
  --muted: #657085;
  --line: #dfe4ed;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --success: #12805c;
  --warning: #a75d00;
  --shadow: 0 18px 55px rgba(13, 30, 69, .11);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 16px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--navy); }
.loader-mark { display: flex; gap: 7px; align-items: end; height: 44px; }
.loader-mark span { width: 12px; background: var(--blue); animation: rise .9s ease-in-out infinite alternate; }
.loader-mark span:nth-child(1) { height: 22px; }
.loader-mark span:nth-child(2) { height: 42px; animation-delay: .15s; background: var(--red); }
.loader-mark span:nth-child(3) { height: 31px; animation-delay: .3s; }
@keyframes rise { to { transform: translateY(-7px); } }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .85fr) 1.15fr; background: #fff; }
.login-panel { padding: clamp(32px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; max-width: 720px; width: 100%; margin-inline: auto; }
.brand-lockup, .compact-brand { display: flex; align-items: center; gap: 13px; color: var(--navy); text-decoration: none; }
.brand-lockup { margin-bottom: clamp(70px, 9vh, 130px); }
.brand-mark, .compact-brand > span { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--navy); font-weight: 900; letter-spacing: -.08em; }
.brand-lockup strong { display: block; font-size: 21px; letter-spacing: .02em; }
.brand-lockup span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.login-copy h1, .page-heading h1 { margin: 0; color: var(--navy); font-size: clamp(34px, 4.1vw, 62px); line-height: 1.01; letter-spacing: -.045em; }
.login-copy > p:last-child { max-width: 540px; color: var(--muted); line-height: 1.65; margin: 22px 0 34px; }
.login-form { display: grid; gap: 17px; max-width: 520px; }
label { display: grid; gap: 8px; color: #33415a; font-size: 14px; font-weight: 700; }
input { width: 100%; min-height: 49px; border: 1px solid #cdd4df; border-radius: 11px; padding: 12px 14px; color: var(--ink); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--bright-blue); box-shadow: 0 0 0 4px rgba(47, 112, 255, .13); }
.button { min-height: 44px; border: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.button.primary { color: #fff; background: var(--blue); box-shadow: 0 8px 22px rgba(22, 77, 187, .22); }
.button.primary:hover { background: #103f9e; }
.button.ghost { background: #edf2fa; color: var(--navy); }
.login-form .button { min-height: 52px; margin-top: 7px; }
.form-message { margin: 0; min-height: 22px; color: var(--muted); font-size: 14px; }
.form-message.error { color: #b4232c; }
.form-message.success { color: var(--success); }
.login-note { color: var(--muted); font-size: 13px; margin-top: 22px; }
.login-art { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 96px); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; background: var(--navy); isolation: isolate; }
.login-art::before { content: ''; position: absolute; inset: 0 0 auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: var(--blue); transform: translate(27%, -38%); z-index: -1; }
.login-art::after { content: ''; position: absolute; left: 11%; top: 30%; width: 26%; height: 9px; background: var(--red); transform: rotate(-38deg); box-shadow: 60px 75px 0 #fff, 130px 150px 0 var(--bright-blue); }
.art-grid { position: absolute; inset: 0; opacity: .09; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 70px 70px; z-index: -1; }
.art-number { font-size: clamp(150px, 23vw, 370px); font-weight: 950; line-height: .75; letter-spacing: -.09em; opacity: .13; position: absolute; right: 3%; bottom: 8%; }
.login-art p { font-size: clamp(25px, 3vw, 48px); line-height: 1.04; font-weight: 850; letter-spacing: -.035em; margin: 0; position: relative; }

.topbar { height: 76px; padding: 0 clamp(20px, 4vw, 64px); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.compact-brand > span { width: 40px; height: 40px; border-radius: 11px; font-size: 14px; }
.compact-brand strong { letter-spacing: .02em; }
.account { display: flex; align-items: center; gap: 18px; }
.account > div { text-align: right; }
.account strong, .account span { display: block; }
.account span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.workspace { width: min(1260px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 110px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 35px; margin-bottom: 34px; }
.page-heading h1 { font-size: clamp(34px, 5vw, 58px); }
.subtitle { margin: 12px 0 0; color: var(--muted); font-size: 17px; }
.privacy-badge { max-width: 290px; display: flex; gap: 10px; align-items: center; padding: 13px 16px; border: 1px solid #b9dfd2; border-radius: 12px; color: #126347; background: #eefaf5; font-size: 14px; font-weight: 750; line-height: 1.35; }
.privacy-badge span { flex: 0 0 auto; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #d3f2e6; }
.progress-card { background: var(--navy); color: #fff; border-radius: 18px; padding: 23px 26px; margin-bottom: 25px; box-shadow: var(--shadow); }
.progress-card > div:first-child { display: flex; justify-content: space-between; align-items: baseline; }
.progress-card strong { font-size: 20px; }
.progress-track { height: 7px; margin-top: 15px; background: rgba(255,255,255,.17); border-radius: 99px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--bright-blue), #7cabff); transition: width .25s; }
.progress-card p { margin: 11px 0 0; color: #c6d2e9; font-size: 13px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.role-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 25px; box-shadow: 0 5px 22px rgba(16, 38, 81, .055); }
.role-card-head { display: flex; align-items: center; gap: 14px; padding-bottom: 19px; margin-bottom: 21px; border-bottom: 1px solid var(--line); }
.role-card-head span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: #eaf0ff; font-size: 13px; font-weight: 900; }
.role-card-head h2 { margin: 0; color: var(--navy); font-size: 21px; letter-spacing: -.02em; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-grid .wide { grid-column: 1 / -1; }
.save-dock { position: sticky; bottom: 16px; z-index: 5; margin-top: 26px; padding: 14px 14px 14px 22px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: flex-end; gap: 18px; }

.admin-heading { align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.metric { min-height: 138px; border: 1px solid var(--line); border-radius: 17px; padding: 22px; background: #fff; position: relative; overflow: hidden; }
.metric::after { content: ''; position: absolute; width: 56px; height: 7px; left: 22px; bottom: 18px; border-radius: 99px; background: var(--bright-blue); }
.metric.green::after { background: #21a276; }
.metric.orange::after { background: #e68a18; }
.metric.gray::after { background: #a9b1bf; }
.metric span { display: block; color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 10px; color: var(--navy); font-size: 42px; letter-spacing: -.05em; }
.registry-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 8px 35px rgba(17, 38, 78, .06); }
.registry-tools { padding: 24px 26px; display: flex; align-items: end; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); }
.registry-tools h2 { margin: 0; color: var(--navy); font-size: 24px; }
.search-field { width: min(360px, 100%); }
.search-field span { font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 25px; text-align: left; border-bottom: 1px solid #e9edf3; white-space: nowrap; }
th { color: var(--muted); background: #f8faff; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
td { font-size: 14px; }
td:first-child { white-space: normal; min-width: 190px; }
tbody tr:hover { background: #fafcff; }
.status { display: inline-flex; min-width: 70px; justify-content: center; padding: 6px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.status.complete { color: #0f6a4b; background: #e7f8f1; }
.status.progress { color: #925308; background: #fff2df; }
.status.empty { color: #596274; background: #edf0f4; }
.table-button { min-height: 36px; padding: 7px 13px; color: var(--blue); background: #eaf0ff; font-size: 13px; }
.empty-state { padding: 45px; color: var(--muted); text-align: center; }

.squad-dialog { width: min(920px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.squad-dialog::backdrop { background: rgba(4, 14, 36, .68); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 20px; padding: 25px 28px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head h2 { margin: 0; color: var(--navy); font-size: 28px; }
.dialog-head p:last-child { margin: 7px 0 0; color: var(--muted); }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 12px; color: var(--navy); background: #eef2f8; cursor: pointer; font-size: 25px; }
.dialog-content { padding: 24px 28px 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; background: var(--canvas); }
.person-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.person-card.person-empty { opacity: .6; }
.person-role { color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.person-card h3 { margin: 8px 0 16px; color: var(--navy); font-size: 19px; }
.person-details { display: grid; gap: 11px; }
.person-details > div { display: grid; grid-template-columns: 115px 1fr; gap: 10px; }
.person-details span { color: var(--muted); font-size: 12px; }
.person-details p { margin: 0; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.person-details a { color: var(--blue); }

@media (max-width: 920px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .brand-lockup { margin-bottom: 70px; }
  .role-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .privacy-badge { max-width: none; }
}

@media (max-width: 620px) {
  .login-panel { padding: 27px 20px 45px; justify-content: flex-start; }
  .brand-lockup { margin: 0 0 65px; }
  .login-copy h1 { font-size: 39px; }
  .topbar { height: 68px; padding: 0 16px; }
  .compact-brand strong { display: none; }
  .account > div { max-width: 145px; }
  .account strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .workspace { width: min(100% - 24px, 1260px); padding: 35px 0 92px; }
  .page-heading h1 { font-size: 38px; }
  .page-heading { margin-bottom: 25px; }
  .progress-card, .role-card { border-radius: 15px; }
  .role-card { padding: 20px 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .save-dock { bottom: 9px; padding: 11px; flex-direction: column; align-items: stretch; gap: 4px; }
  .save-dock .form-message { text-align: center; min-height: 18px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { min-height: 120px; padding: 17px; }
  .metric strong { font-size: 35px; }
  .registry-tools { align-items: stretch; flex-direction: column; padding: 20px; }
  th, td { padding: 14px 17px; }
  .dialog-content { grid-template-columns: 1fr; padding: 15px; }
  .dialog-head { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.portal-nav{display:flex;flex-wrap:wrap;gap:8px;padding:16px 24px;background:#fff;border-bottom:1px solid var(--line)}
.portal-card{padding:24px;background:#fff;border:1px solid var(--line);border-radius:16px;margin:16px 0;display:grid;gap:14px}
select,textarea{font:inherit;border:1px solid #cdd4df;border-radius:9px;padding:12px;width:100%;background:#fff;color:var(--ink)}
textarea{min-height:110px;resize:vertical}summary{cursor:pointer;font-weight:700}#portal-message{color:#164dbb;font-weight:700;white-space:pre-wrap}#portal-selector{max-width:480px;margin-bottom:20px}.portal-card form{display:grid;gap:16px}.portal-card input[type=checkbox]{width:20px;min-height:20px}#admin-members>.button{margin:20px 0}.portal-card h2{font-size:21px}#new-access{overflow-wrap:anywhere}
