:root {
    color-scheme: light;
    --ink: #17201d;
    --muted: #5f6f69;
    --paper: #fbfaf7;
    --panel: #ffffff;
    --line: #d9e0dc;
    --forest: #12352e;
    --teal: #0f766e;
    --clay: #b4532a;
    --gold: #d8a526;
    --danger: #9f1d1d;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(18, 53, 46, 0.07) 1px, transparent 1px),
        var(--paper);
    background-size: 42px 42px;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.access-panel {
    width: min(980px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 22px 60px rgba(23, 32, 29, 0.14);
}

.identity-side {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 100%;
    padding: 40px;
    overflow: hidden;
    color: #f7fbf9;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.38), transparent 44%),
        linear-gradient(165deg, var(--forest), #0e211d 72%);
}

.identity-side::before {
    content: "";
    position: absolute;
    inset: 26px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.scope-mark {
    position: absolute;
    top: 54px;
    left: 52px;
    width: 210px;
    height: 210px;
}

.scope-mark span {
    position: absolute;
    inset: var(--offset);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
}

.scope-mark span:nth-child(1) {
    --offset: 0;
}

.scope-mark span:nth-child(2) {
    --offset: 24px;
    border-color: rgba(216, 165, 38, 0.56);
}

.scope-mark span:nth-child(3) {
    --offset: 48px;
}

.scope-mark span:nth-child(4) {
    --offset: 72px;
    border-color: rgba(255, 255, 255, 0.42);
}

.identity-copy {
    position: relative;
    max-width: 320px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--teal);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.identity-side .eyebrow {
    color: var(--gold);
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2.6rem, 6vw, 5.4rem);
    line-height: 0.92;
    letter-spacing: 0;
}

.identity-copy p:last-child {
    margin: 20px 0 0;
    color: rgba(247, 251, 249, 0.76);
    font-size: 1.02rem;
    line-height: 1.6;
}

.content-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    padding: 48px;
}

.topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

h2 {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.08;
}

.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--forest);
    font-weight: 800;
    text-decoration: none;
}

.text-button:hover {
    border-color: var(--teal);
}

.notice {
    padding: 14px 16px;
    border-left: 4px solid var(--gold);
    border-radius: 6px;
    background: #fff8df;
    color: #4c3a0d;
    line-height: 1.5;
}

.notice.error {
    border-left-color: var(--danger);
    background: #fff1f1;
    color: var(--danger);
}

.impersonation-banner {
    margin-bottom: 18px;
}

.impersonation-banner .inline-actions {
    margin-top: 10px;
}

.impersonation-banner form {
    display: contents;
}

code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(23, 32, 29, 0.08);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

.login-block {
    display: flex;
    align-items: center;
    min-height: 58px;
}

.profile {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7faf8;
}

.profile img,
.avatar-fallback {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.profile img {
    object-fit: cover;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    background: var(--teal);
    color: white;
    font-size: 1.6rem;
    font-weight: 800;
}

.profile h3,
.workspace h3 {
    margin: 0;
    font-size: 1.15rem;
}

.profile p,
.workspace p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.workspace {
    padding-top: 4px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.resource-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--forest);
    font-weight: 800;
    text-decoration: none;
}

.resource-link:hover {
    border-color: var(--teal);
    background: #f5fbf9;
}

.admin-link {
    border-color: rgba(180, 83, 42, 0.45);
    color: var(--clay);
}

.admin-shell {
    min-height: 100vh;
    padding: 28px;
}

.admin-page {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.admin-header h1 {
    color: var(--forest);
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
    gap: 18px;
}

.admin-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(23, 32, 29, 0.08);
}

.admin-panel h2 {
    margin: 0 0 16px;
    font-size: 1.35rem;
}

.all-users-panel {
    margin-bottom: 18px;
}

.panel-copy {
    margin: -6px 0 16px;
    color: var(--muted);
    line-height: 1.5;
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--forest);
    font-weight: 800;
}

.field input[type="email"] {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.check-list {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    color: var(--ink);
}

.check-row input {
    width: 18px;
    height: 18px;
}

.primary-button,
.danger-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    background: var(--forest);
    color: #fff;
}

.danger-button {
    background: #fff;
    border-color: rgba(159, 29, 29, 0.35);
    color: var(--danger);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.users-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.default-pill-list {
    margin: 0 0 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #edf6f3;
    color: var(--forest);
    font-size: 0.88rem;
    font-weight: 800;
}

.inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .admin-shell {
        padding: 18px;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .shell {
        align-items: start;
        padding: 18px;
    }

    .access-panel {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .identity-side {
        min-height: 320px;
        padding: 30px;
    }

    .content-side {
        padding: 30px;
    }

    .topline {
        flex-direction: column;
    }
}
