:root {
    color-scheme: light;
    font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    color: #16233f;
    background: #eef3fb;
    --ink: #16233f;
    --muted: #64748b;
    --primary: #2f66e8;
    --primary-dark: #1f4fca;
    --surface: rgb(255 255 255 / 94%);
    --line: #e4eaf3;
    --soft: #f7f9fd;
    --shadow: 0 24px 70px rgb(24 47 91 / 13%);
}

* { box-sizing: border-box; }
html { min-width: 320px; }

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 28px 18px 56px;
    background:
        radial-gradient(circle at 8% 5%, rgb(81 135 255 / 17%), transparent 29rem),
        radial-gradient(circle at 95% 18%, rgb(118 215 205 / 16%), transparent 25rem),
        linear-gradient(145deg, #f6f9ff 0%, #edf3fb 100%);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: .32;
    background-image: radial-gradient(#b8c8e5 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

main.card {
    position: relative;
    width: min(100%, 470px);
    margin: clamp(16px, 6vh, 68px) 0 0;
    padding: clamp(28px, 5vw, 48px);
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 80%);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / 90%);
    backdrop-filter: blur(18px);
}

main.card::before {
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 4px;
    content: "";
    border-radius: 0 0 8px 8px;
    background: linear-gradient(90deg, #2f66e8, #67c9c0);
}

.wide-card { width: min(100%, 1120px) !important; }

.admin-body { align-items: flex-start; padding: 24px 18px 56px; }
.admin-card { width: min(100%, 1320px) !important; margin: 0 auto; padding: 36px 40px 30px; border-radius: 24px; }
.admin-card > h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 34px); }
.admin-card > .muted { max-width: 920px; margin-bottom: 22px; font-size: 14px; }
.admin-card > .notice { margin-top: 12px; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0 0 14px;
    padding: 5px 11px;
    border: 1px solid #d8e4ff;
    border-radius: 999px;
    color: #2455b7;
    background: #edf3ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
}

h1 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.18;
    letter-spacing: -.035em;
}

h2 { color: var(--ink); letter-spacing: -.02em; }
.muted, .footnote { color: var(--muted); line-height: 1.7; }
.muted { margin-top: 0; }

a {
    color: #2459c7;
    font-weight: 650;
    text-underline-offset: 3px;
    transition: color .18s ease;
}

a:hover { color: var(--primary-dark); }

form {
    display: grid;
    gap: 11px;
    max-width: 640px;
    margin-top: 26px;
}

label {
    display: grid;
    gap: 7px;
    margin-top: 7px;
    color: #33415d;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .01em;
}

input, select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #ccd7e7;
    border-radius: 11px;
    outline: 0;
    color: var(--ink);
    background: #fbfcff;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea { min-height: 92px; resize: vertical; }

input:hover, select:hover, textarea:hover { border-color: #aebfdb; background: #fff; }

input:focus, select:focus, textarea:focus {
    border-color: #4c7cf0;
    background: #fff;
    box-shadow: 0 0 0 4px rgb(47 102 232 / 13%);
}

button {
    min-height: 48px;
    margin-top: 13px;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #3670f1, #285bd4);
    box-shadow: 0 9px 18px rgb(47 102 232 / 20%);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

button:hover {
    filter: brightness(1.04);
    box-shadow: 0 12px 24px rgb(47 102 232 / 26%);
    transform: translateY(-1px);
}

button:active { transform: translateY(0); }
button.secondary { color: #33415d; background: #edf2f8; box-shadow: none; }
button.secondary:hover { background: #e1e9f3; box-shadow: none; }
button.danger { background: linear-gradient(135deg, #d94841, #b42318); box-shadow: 0 8px 18px rgb(180 35 24 / 16%); }

.notice {
    margin: 19px 0;
    padding: 13px 15px;
    border: 1px solid #dbe6fa;
    border-radius: 12px;
    color: #31527e;
    background: #f0f5ff;
    font-size: 14px;
    line-height: 1.6;
}

.notice.error { border-color: #ffd1cf; color: #a22b2b; background: #fff3f2; }
.notice.success { border-color: #c7ead5; color: #17633a; background: #eefaf2; }
.secret-notice code { display: inline-block; max-width: 100%; padding: 4px 7px; overflow-wrap: anywhere; color: #153d83; background: #e8f0ff; border-radius: 6px; }
.field-help { margin: -4px 0 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.footnote { margin: 23px 0 0; font-size: 13px; }

/* The employee portal uses a spacious workbench layout that scales with the platform directory. */
.portal-body {
    align-items: flex-start;
    padding: 0 0 54px;
}

.portal-shell {
    width: 100%;
    margin: 0 auto;
}

.portal-topbar, .portal-hero, .portal-footer, .portal-tools {
    display: flex;
    align-items: center;
}

.portal-topbar { position: sticky; top: 0; z-index: 2; justify-content: space-between; gap: 28px; min-height: 72px; padding: 12px clamp(18px, 5vw, 72px); border-bottom: 1px solid rgb(218 227 239 / 90%); background: rgb(255 255 255 / 88%); box-shadow: 0 8px 24px rgb(24 47 91 / 5%); backdrop-filter: blur(18px); }
.portal-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.portal-brand:hover { color: var(--ink); }
.portal-brand-mark { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #3472f3, #214bbf); box-shadow: 0 8px 18px rgb(47 102 232 / 22%); font-size: 20px; font-weight: 850; }
.portal-brand strong, .portal-brand small { display: block; }
.portal-brand strong { font-size: 17px; letter-spacing: -.02em; }
.portal-brand small { margin-top: 3px; color: #8390a6; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.portal-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.portal-nav a { padding: 10px 15px; border-radius: 10px; color: #65748e; font-size: 13px; font-weight: 700; text-decoration: none; }
.portal-nav a:hover, .portal-nav a.active { color: #244f9c; background: #eaf1ff; }
.portal-nav-logout-form { margin: 0; }
.portal-nav-logout { min-height: 0; margin: 0; padding: 10px 15px; border: 0; border-radius: 10px; color: #65748e; background: transparent; box-shadow: none; font-size: 13px; font-weight: 700; }
.portal-nav-logout:hover { color: #244f9c; background: #eaf1ff; box-shadow: none; filter: none; transform: none; }
.portal-account { display: grid; gap: 3px; text-align: right; }
.portal-account span { color: #8490a5; font-size: 11px; letter-spacing: .08em; }
.portal-account strong { color: var(--ink); font-size: 14px; }

.portal-content { width: min(calc(100% - 32px), 1360px); margin: clamp(28px, 5vw, 60px) auto 0; padding: clamp(28px, 4vw, 48px) clamp(22px, 4vw, 48px) 30px; border: 1px solid rgb(255 255 255 / 90%); border-radius: 28px; background: rgb(255 255 255 / 85%); box-shadow: 0 28px 80px rgb(24 47 91 / 11%), inset 0 1px 0 rgb(255 255 255 / 95%); backdrop-filter: blur(18px); }
.portal-hero { justify-content: space-between; gap: 36px; padding: 12px 0 42px; }
.portal-kicker { margin: 0 0 12px; color: #4774d0; font-size: 11px; font-weight: 850; letter-spacing: .16em; }
.portal-hero h1 { margin-bottom: 12px; font-size: clamp(30px, 3.8vw, 46px); }
.portal-lede { max-width: 620px; margin: 0; color: #667797; font-size: clamp(14px, 1.2vw, 16px); line-height: 1.7; }
.portal-stat { min-width: 150px; padding-left: 34px; border-left: 1px solid #dbe4f1; }
.portal-stat strong, .portal-stat span { display: block; }
.portal-stat strong { color: #275fd7; font-size: clamp(36px, 4.5vw, 56px); line-height: 1; letter-spacing: -.07em; }
.portal-stat span { margin-top: 9px; color: #73809a; font-size: 12px; font-weight: 700; }

.portal-directory { padding: 34px 0 12px; border-top: 1px solid var(--line); }
.portal-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.portal-section-heading h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); }
.portal-section-heading > p { margin: 0 0 4px; color: #8591a7; font-size: 13px; }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 22px; margin-top: 26px; }
.platform-card { display: flex; min-height: 210px; flex-direction: column; padding: 22px 23px 20px; border: 1px solid #dfe7f2; border-radius: 18px; color: var(--ink); background: linear-gradient(150deg, #fff 0%, #f8faff 100%); box-shadow: 0 10px 24px rgb(24 47 91 / 5%); text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.platform-card:hover { border-color: #a8c2f4; color: var(--ink); box-shadow: 0 18px 36px rgb(47 102 232 / 14%); transform: translateY(-4px); }
.platform-card-top { display: flex; align-items: center; justify-content: space-between; }
.platform-index { color: #9aa8bd; font-size: 13px; font-variant-numeric: tabular-nums; }
.platform-arrow { color: #4774d0; font-size: 24px; line-height: 1; }
.platform-copy { min-width: 0; }
.platform-copy strong, .platform-copy small { display: block; }
.platform-copy { margin-top: auto; padding: 28px 0 24px; }
.platform-copy strong { overflow: hidden; color: #1d3768; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.platform-copy small { min-height: 38px; margin-top: 8px; overflow: hidden; color: #8290a5; font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.platform-enter { align-self: flex-start; padding: 9px 17px; border: 1px solid #cfe0ff; border-radius: 9px; color: #2d63d2; background: #eff5ff; font-size: 13px; font-weight: 750; }

.portal-footer { justify-content: space-between; gap: 24px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.portal-tools { flex-wrap: wrap; gap: 15px; }
.portal-tools-label { color: #8b97aa; font-size: 12px; font-weight: 750; }
.portal-tools a { color: #58709d; font-size: 13px; font-weight: 650; }

.admin-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.admin-section h2 { margin: 0 0 6px; font-size: 19px; }
.admin-section > form:not(.compact-form) { max-width: 780px; margin-top: 18px; padding: 20px 22px; border: 1px solid #e1e8f3; border-radius: 16px; background: #fbfcff; }
.admin-card .table-scroll { margin-top: 14px; background: #fff; }
.admin-card th { padding: 11px 14px; }
.admin-card td { padding: 12px 14px; }
.admin-card td code { font-size: 11px; }
.account-action-grid { display: grid; grid-template-columns: minmax(140px, .9fr) minmax(190px, 1.1fr); gap: 10px; align-items: start; }
.account-action-grid .compact-form { min-width: 0; margin: 0; padding: 12px; border: 1px solid #e1e8f3; border-radius: 12px; background: #fbfcff; }
.account-action-grid .compact-form:last-child { grid-column: 1 / -1; }
.account-action-grid .compact-form button { width: 100%; }
.table-action-stack { display: grid; gap: 8px; min-width: 190px; }
.table-action-stack .compact-form { margin: 0; }
.table-action-stack button { width: 100%; }
.platform-actions { min-width: 190px; }
.platform-actions form { margin: 0 0 8px; }
.platform-actions button { width: 100%; }
.table-action-link { display: inline-block; line-height: 1.45; }

.details {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr;
    gap: 0;
    margin: 17px 0 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
}

.details dt, .details dd { min-height: 43px; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.details dt { color: #667797; font-size: 13px; font-weight: 700; }
.details dd { overflow-wrap: anywhere; background: #fff; }
.details dt:last-of-type, .details dd:last-of-type { border-bottom: 0; }

.table-scroll { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }

table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 14px;
}

th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #53627d; background: #f6f8fc; font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
td code { color: #49618e; font-size: 12px; overflow-wrap: anywhere; }
td small { display: block; margin-top: 5px; color: #75839a; overflow-wrap: anywhere; }

.account-actions { min-width: 270px; }
.oidc-client-table { min-width: 1040px; }
.compact-form { gap: 6px; margin: 0 0 12px; }
.compact-form label { margin-top: 0; }
.compact-form input { min-height: 38px; padding: 8px 10px; }
.compact-form button { min-height: 38px; margin-top: 3px; padding: 8px 12px; font-size: 13px; }

@media (max-width: 640px) {
    body { padding: 14px 10px 30px; }
    main.card { margin-top: 10px; padding: 28px 20px; border-radius: 20px; }
    h1 { font-size: 30px; }
    .details { grid-template-columns: 1fr; }
    .details dt { min-height: auto; padding-bottom: 4px; border-bottom: 0; }
    .details dd { padding-top: 4px; }
    button { width: 100%; }
    .admin-body { padding: 12px 10px 30px; }
    .admin-card { padding: 28px 20px 24px; border-radius: 20px; }
    .admin-section > form:not(.compact-form) { padding: 16px; }
    .account-action-grid { grid-template-columns: 1fr; }
    .account-action-grid .compact-form:last-child { grid-column: auto; }
    .table-action-stack { min-width: 160px; }
    .portal-topbar { position: static; padding: 12px 16px; }
    .portal-topbar, .portal-hero, .portal-footer { align-items: flex-start; flex-direction: column; }
    .portal-topbar { gap: 18px; }
    .portal-nav { width: 100%; margin-left: 0; overflow-x: auto; }
    .portal-nav a { white-space: nowrap; }
    .portal-nav-logout { width: auto; white-space: nowrap; }
    .portal-account { text-align: left; }
    .portal-content { width: min(calc(100% - 20px), 1360px); margin-top: 18px; padding: 24px 18px 22px; border-radius: 22px; }
    .portal-hero { gap: 28px; padding: 16px 0 34px; }
    .portal-stat { width: 100%; padding: 16px 0 0; border-top: 1px solid #dbe4f1; border-left: 0; }
    .portal-stat strong { font-size: 52px; }
    .portal-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
    .platform-grid { grid-template-columns: 1fr; gap: 16px; }
    .platform-card { min-height: 200px; }
    .portal-footer { gap: 24px; }
}
