:root {
    color-scheme: light;
    --navy: #071d2d;
    --navy-soft: #092e46;
    --ink: #142b51;
    --teal: #087986;
    --teal-dark: #056470;
    --gold: #caa43c;
    --gold-light: #f5d977;
    --line: #d7e5f4;
    --muted: #60718d;
    --surface: #ffffff;
    --canvas: #f5f9ff;
    --shadow: 0 24px 70px rgb(6 29 45 / 28%);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.5 Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.auth-page {
    display: grid;
    place-items: center;
    overflow-x: hidden;
    padding: 32px;
    background:
        radial-gradient(circle at 15% 10%, rgb(202 164 60 / 22%), transparent 30%),
        radial-gradient(circle at 88% 90%, rgb(8 121 134 / 35%), transparent 34%),
        var(--navy);
}
.auth-shell { width: min(100%, 1000px); }
.gateway-shell { position: relative; }
.sig11-gateway {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    min-height: 650px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 15%);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.institution-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: 650px;
    padding: 40px;
    color: white;
    background: var(--navy-soft);
}
.ring {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 256px;
    height: 256px;
    border: 24px solid rgb(202 164 60 / 20%);
    border-radius: 50%;
}
.institution-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; }
.pmpe-crest { width: 64px; height: 64px; object-fit: contain; }
.sig11-pill {
    border: 1px solid rgb(216 187 104 / 50%);
    border-radius: 999px;
    padding: 5px 13px;
    color: var(--gold-light);
    background: rgb(216 187 104 / 10%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
}
.institution-copy { position: relative; margin: 36px 0; }
.institution-copy p { margin: 0; color: var(--gold-light); font-size: 14px; font-weight: 700; letter-spacing: .22em; }
.institution-copy h1 { max-width: 430px; margin: 12px 0 0; font-size: clamp(32px, 4vw, 42px); line-height: 1.16; letter-spacing: -.02em; }
.institution-copy span { display: block; margin-top: 18px; color: #dce7ef; font-size: 14px; line-height: 1.7; }
.bpm-crest { position: relative; width: 82px; height: 100px; object-fit: contain; filter: drop-shadow(0 10px 20px rgb(0 0 0 / 22%)); }
.access-panel { display: flex; align-items: center; padding: 40px; background: white; }
.access-content { width: 100%; max-width: 460px; margin: auto; }
.eyebrow { margin: 0; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .2em; }
.access-panel h2 { margin: 8px 0 0; color: #111827; font-size: 32px; line-height: 1.2; letter-spacing: -.02em; }
.supporting-text { margin: 8px 0 0; color: #6b7280; font-size: 14px; }
.login-form { display: grid; gap: 16px; margin-top: 26px; }
.login-form label > span, .user-form label > span { display: block; margin-bottom: 6px; color: #334155; font-size: 14px; font-weight: 700; }
.login-form input, .user-form input, .user-form select, .user-row select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 12px;
    color: #0f172a;
    background: white;
    outline: none;
}
.login-form input:focus, .user-form input:focus, .user-form select:focus, .user-row select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgb(202 164 60 / 20%);
}
.primary, .outline {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
}
.primary { border-color: var(--teal); color: white; background: var(--teal); }
.primary:hover { border-color: var(--teal-dark); background: var(--teal-dark); }
.login-form .primary { width: 100%; min-height: 48px; }
.operational-links { margin-top: 24px; border-top: 1px solid #e2e8f0; padding-top: 20px; }
.operational-links > p { margin: 0; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.operational-links > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.operational-links a, .back {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid #b9d9df;
    border-radius: 8px;
    padding: 9px 12px;
    color: #075e77;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: background .15s ease, border-color .15s ease;
}
.operational-links a:hover, .back:hover { border-color: #76bdc6; background: #edf9fa; }
.operational-links .wide { grid-column: 1 / -1; }
.back { margin-top: 14px; }
.institution-foot { margin: 28px 0 0; border-top: 1px solid #e2e8f0; padding-top: 16px; color: #94a3b8; font-size: 12px; }
.alert, .success { margin: 16px 0; border: 1px solid #fecaca; border-radius: 8px; padding: 12px 14px; color: #b91c1c; background: #fef2f2; }
.success { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }

.portal-page { min-height: 100vh; color: var(--ink); background: linear-gradient(125deg, #f1f8ff 0%, #fff 47%, #eaf4ff 100%); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid #173d51;
    padding: 14px clamp(20px, 4vw, 56px);
    color: white;
    background: #112c3c;
    box-shadow: 0 3px 12px rgb(35 70 120 / 8%);
}
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand img { width: 58px; height: 66px; object-fit: contain; }
.brand small { display: block; color: #a7c9d6; font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.brand b { display: block; margin-top: 3px; font-size: 22px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav > a:not(.outline) { color: #d7e8ee; font-weight: 700; }
.topbar .outline { border-color: rgb(255 255 255 / 30%); color: white; background: transparent; }
.topbar .outline:hover { background: rgb(255 255 255 / 9%); }
.user-name { color: var(--gold-light); font-weight: 700; }
.page-shell { width: min(1200px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.hub-intro h1, .section-title h1 { margin: 8px 0 0; color: var(--ink); font-size: clamp(32px, 4vw, 44px); line-height: 1.1; letter-spacing: -.02em; }
.hub-intro > p:last-child, .section-title > p { margin: 10px 0 0; color: #53698e; font-size: 18px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.module-card {
    position: relative;
    display: flex;
    min-height: 250px;
    flex-direction: column;
    border: 1px solid #c8dcf0;
    border-radius: 16px;
    padding: 20px;
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 5px 14px rgb(34 67 113 / 9%);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.module-card:hover { transform: translateY(-4px); border-color: #75bfd7; box-shadow: 0 12px 24px rgb(34 67 113 / 15%); }
.module-symbol { display: grid; width: 52px; height: 52px; place-items: center; overflow: hidden; border-radius: 12px; color: #0a4266; background: #d8f7fb; font-size: 14px; font-weight: 800; }
.module-symbol.image img { width: 42px; height: 42px; object-fit: contain; }
.module-card > div { margin-top: 18px; }
.module-card small { color: #006b87; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.module-card h2 { margin: 4px 0 0; color: var(--ink); font-size: 22px; }
.module-card p { margin: 8px 0 0; color: #52698c; font-size: 14px; }
.module-card > b { margin-top: auto; padding-top: 18px; color: var(--teal); font-size: 14px; }
.empty-access { grid-column: 1 / -1; border: 1px dashed #aebfd2; border-radius: 16px; padding: 28px; color: #52698c; background: white; text-align: center; }
.empty-access p { margin-bottom: 0; }

.users-page { max-width: 1300px; }
.section-title > span { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.create-user, .users-list { margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: white; box-shadow: 0 6px 18px rgb(34 67 113 / 9%); }
.user-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.user-form fieldset { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 8px; }
.user-form fieldset label { display: flex; align-items: center; gap: 6px; }
.user-form input[type=checkbox], .user-row input[type=checkbox] { width: auto; min-height: auto; }
.user-form .primary { align-self: end; }
.users-list { overflow: auto; }
.user-row { display: grid; min-width: 900px; grid-template-columns: minmax(200px, 1.6fr) 150px 100px 110px 90px 90px; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding: 15px 0; }
.user-row small { display: block; color: var(--muted); }
.user-row label { white-space: nowrap; }
.users-page .outline { border-color: #b9d9df; color: #075e77; background: white; }

@media (max-width: 900px) {
    .sig11-gateway { grid-template-columns: 1fr; }
    .institution-panel { min-height: 410px; }
    .access-panel { padding: 38px 30px; }
    .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .auth-page { display: block; padding: 20px; }
    .sig11-gateway { border-radius: 20px; }
    .institution-panel { min-height: 418px; padding: 28px; }
    .institution-copy { margin: 28px 0; }
    .institution-copy h1 { font-size: 30px; }
    .access-panel { padding: 30px 28px; }
    .access-panel h2 { font-size: 30px; }
    .operational-links > div { grid-template-columns: 1fr; }
    .operational-links .wide { grid-column: auto; }
    .topbar { align-items: flex-start; padding: 14px 16px; }
    .brand img { width: 46px; height: 54px; }
    .brand small { font-size: 10px; }
    .brand b { font-size: 17px; }
    .topbar nav > a:not(.outline), .user-name { display: none; }
    .topbar .outline { padding-inline: 12px; font-size: 14px; }
    .page-shell { width: min(100% - 28px, 1200px); padding-top: 32px; }
    .module-grid, .user-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
