* { box-sizing: border-box; }
body { margin: 0; background: #eff4f6; color: #142b2b; font: 1rem/1.55 system-ui, sans-serif; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; background: #032543; border-bottom: .4rem solid #a1d3df; padding: .6rem max(1rem, calc((100% - 73rem) / 2)); }
main { width: min(100% - 2rem, 70rem); margin: clamp(1.4rem, 5vw, 3.5rem) auto; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); margin: 0 0 1.25rem; }
h2 { margin-top: 0; }
a { color: #125457; text-decoration-thickness: .1em; text-underline-offset: .18em; }
button { min-height: 2.75rem; padding: .45rem .85rem; border: 1px solid #154f51; background: #fff; color: #154f51; border-radius: .35rem; font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #914200; outline-offset: 3px; }
.skip:not(:focus) { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { display: inline-block; padding: .75rem; }
.topbar nav { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.25rem; }
.topbar form { margin: 0; }
main > form { padding: 1rem; margin-block: 1rem; background: #fff; border: 1px solid #aabfbc; border-radius: .5rem; }
form label { display: inline-flex; flex-direction: column; gap: .25rem; margin: .25rem .7rem .5rem 0; max-width: 100%; }
input, select { min-height: 2.75rem; padding: .4rem .55rem; border: 1px solid #667f7c; border-radius: .35rem; background: #fff; color: #142b2b; font: inherit; max-width: 100%; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.filters button, .filters a { margin-block: .25rem .5rem; }
.table-scroll { max-width: 100%; overflow-x: auto; background: #fff; border: 1px solid #aabfbc; border-radius: .5rem; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .7rem; border-bottom: 1px solid #d6e1df; vertical-align: top; }
th { background: #dcecea; }
td form { min-width: 12rem; }
@media (max-width: 36rem) { main { margin-block: 1.2rem; } .filters { align-items: start; flex-direction: column; } }
.pagination { display: flex; flex-wrap: wrap; gap: 1rem; padding-block: 1rem; }
.header-logo { display: block; border-radius: .4rem; }
.hub-title { color: #06374c; margin-bottom: .35rem; }
.hub-intro { color: #46616e; margin: 0 0 2rem; }
.hub-workspace { margin-block: 1.5rem 2.5rem; }
.hub-workspace > h2 { font-size: 1.15rem; color: #315262; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.hub-card { padding: clamp(1.2rem, 3vw, 1.6rem); background: #fff; border: 1px solid #d0e1e7; border-radius: 1.1rem; box-shadow: 0 8px 30px #092f4010; }
.hub-grid .hub-card { min-height: 9rem; }
.hub-card h2, .hub-card h3 { color: #06374c; margin: 0 0 .65rem; }
.hub-card a { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; }
.auth-card { max-width: 32rem; }
.auth-card form { display: grid; gap: .75rem; }
.auth-card label { margin: 0; font-weight: 600; }
.auth-card button { justify-self: start; }
.primary-action { background: #07364f; border-color: #07364f; color: #fff; padding-inline: 1.25rem; font-weight: 650; }
.topbar nav a { color: #fff; }
.topbar :focus-visible { outline-color: #a6e0ee; }
@media (max-width: 39rem) { .hub-grid { grid-template-columns: 1fr; } .hub-intro { margin-bottom: 1.25rem; } }
.topbar { flex-wrap: wrap; min-height: 7rem; }
.hub-workspace { margin-block: 2.2rem 0; }
.hub-grid { align-items: start; }
.hub-grid .hub-panel { min-height: 12rem; padding: 0; overflow: hidden; }
.hub-panel:focus-within, .hub-panel:hover { border-color: #79bfc8; }
.hub-panel summary { position: relative; display: flex; flex-direction: column; align-items: start; gap: .85rem; min-height: 11.9rem; padding: 1.55rem; cursor: pointer; list-style: none; }
.hub-panel summary::-webkit-details-marker { display: none; }
.hub-panel summary:focus-visible { outline-offset: -5px; border-radius: 1rem; }
.hub-icon { display: grid; width: 3.7rem; height: 3.7rem; place-items: center; border-radius: 1rem; background: #e1f1f2; color: #073a4a; }
.hub-name { color: #07384b; font-size: clamp(1.15rem, 2.5vw, 1.45rem); font-weight: 750; }
.hub-chevron { position: absolute; top: 3.45rem; right: 1.8rem; width: .45rem; height: .45rem; border-right: 2px solid #296677; border-bottom: 2px solid #296677; transform: rotate(45deg); }
.hub-panel[open] .hub-chevron { transform: rotate(225deg); }
.hub-panel[open] summary { min-height: auto; padding-bottom: .7rem; }
.hub-panel-content { margin-inline: 1.55rem; padding: .45rem 0 .9rem; border-top: 1px solid #dcebed; }
.hub-panel-content p { margin: .65rem 0 .4rem; color: #46616e; }
.hub-footer { margin-top: 1.8rem; color: #46616e; font-size: .8rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 39rem) { .topbar { min-height: 0; } .hub-grid .hub-panel { min-height: 0; } .hub-panel summary { min-height: 9rem; } }

.topbar .hub-home-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .45rem .9rem; border: 1px solid #a1d3df; border-radius: .4rem; background: #15455e; color: #fff; font-weight: 650; text-decoration: none; }
.topbar .hub-home-button:hover, .topbar .hub-home-button[aria-current="page"] { background: #225874; }
.hub-panel[open] summary { min-height: 11.9rem; padding-bottom: 1.55rem; }
.hub-panel-content { margin-inline: 0; padding: 1rem; background: #f8fbfc; }
.hub-module-list { display: grid; gap: .55rem; padding: 0; margin: 0; list-style: none; }
.hub-card .hub-module { display: flex; justify-content: space-between; gap: .75rem; min-height: 3.2rem; padding: .55rem .75rem; border-radius: .55rem; background: #032543; color: #fff; text-decoration: none; font-size: .9rem; }
.hub-module-open { flex-shrink: 0; min-width: 5.6rem; padding: .2rem .6rem; border-radius: 999px; text-align: center; background: #00000026; font-size: .72rem; }
.hub-card .hub-module--teal { background: #087681; }
.hub-card .hub-module--yellow { background: #ffcc24; color: #282000; }
.hub-card .hub-module--purple { background: #582660; }
.hub-card .hub-module--blue { background: #075cab; }
.hub-module--yellow .hub-module-open { background: #fff3b3; }
.hub-card .hub-module:hover { text-decoration: underline; }
.module-hero { background: #15364e; color: #fff; border-radius: .85rem; padding: clamp(1.1rem, 4vw, 1.8rem); margin-bottom: 1rem; }
.module-hero h1 { margin: 0 0 .35rem; }
.module-hero p { color: #deedf4; margin: 0; }
.leave-tabs, .leave-month-links, .leave-decision { display: flex; flex-wrap: wrap; gap: .5rem; }
.leave-tabs { margin-bottom: 1.15rem; }
.leave-tabs a, .leave-month-links a { display: inline-flex; align-items: center; min-height: 2.75rem; border-radius: .5rem; padding: .45rem .8rem; background: #e2edf3; color: #173c52; text-decoration: none; font-weight: 650; }
.leave-tabs a[aria-current="page"] { background: #15364e; color: #fff; }
.leave-tabs a:hover, .leave-month-links a:hover { text-decoration: underline; }
.leave-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .8rem; margin: 0 0 1.1rem; }
.leave-metric, .module-panel { border: 1px solid #d6e2e9; border-radius: .85rem; background: #fff; box-shadow: 0 3px 14px #17334b0a; }
.leave-metric { padding: 1rem; }
.leave-metric dt { color: #46616e; font-size: .85rem; }
.leave-metric dd { color: #15364e; font-size: 1.65rem; font-weight: 750; margin: .15rem 0 0; }
.leave-metric dd span { font-size: .9rem; font-weight: 550; }
.leave-metric-balance { background: #f0f8fb; }
.module-panel { padding: clamp(.75rem, 3vw, 1.25rem); margin-bottom: 1.1rem; }
.module-panel h2 { color: #15364e; margin: 0 0 .85rem; font-size: 1.2rem; }
.module-panel-header { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; }
.module-panel-header h2 { margin: 0; }
.module-panel-header p { margin: .2rem 0; color: #46616e; }
.module-form { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.module-form label { margin: 0; font-weight: 650; }
.leave-register { min-width: 29rem; }
.leave-register td form { min-width: 0; }
.leave-register td { vertical-align: middle; }
.leave-status { border-radius: 999px; padding: .2rem .6rem; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.leave-status--submitted { background: #fff0c2; color: #6e4600; }
.leave-status--approved { background: #e3f4e9; color: #216a43; }
.leave-status--rejected { background: #f9e7e7; color: #923636; }
.leave-decision button { padding-inline: .6rem; }
.leave-errors { color: #8e241f; }
.leave-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.leave-day-name { text-align: center; font-size: .85rem; font-weight: 700; }
.leave-day { padding: .4rem; min-height: 4.5rem; border: 1px solid #d6e2e9; border-radius: .35rem; overflow-wrap: anywhere; }
.leave-day-outside { background: #edf2f6; color: #46616e; }
.leave-day ul { list-style: none; padding: 0; margin: .2rem 0 0; }
.leave-day li { border-radius: .2rem; background: #dcf4e4; color: #1d5738; margin-top: .15rem; padding: .15rem .25rem; font-size: .75rem; }
@media (max-width: 38rem) { .leave-day { min-height: 3.5rem; padding: .2rem; } .leave-day li { font-size: .7rem; } }

.leave-tabs a[aria-current="true"] { background: #15364e; color: #fff; }
.workforce-month { border-top: 1px solid #d6e2e9; }
.workforce-month summary { padding: .65rem 0; cursor: pointer; }

.workforce-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; margin-bottom: 1.1rem; }
.workforce-toolbar .module-form { align-items: center; }
.workforce-actions { margin: 0; }
.workforce-metrics .leave-metric { min-height: 7rem; }
.workforce-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); align-items: end; gap: .7rem; }
.workforce-add label { margin: 0; font-weight: 650; }
.workforce-add input, .workforce-add select { display: block; width: 100%; margin-top: .25rem; }
#workforce-backup { max-width: 100%; }

@media print {
    .topbar, .skip, .leave-tabs, .leave-month-links, .workforce-toolbar, #workforce-import,
    main form, [data-workspace-print] { display: none !important; }
    main { max-width: none; padding: 0; }
    .module-hero, .module-hero p { color: #000; background: #fff; }
    .table-scroll { overflow: visible; }
    .leave-register { min-width: 0; }
}

.register-hero--cqc-notifications { background: #582555; }
.register-hero--continence-assessment { background: #07589f; }
.register-hero--safeguarding { background: #ffce38; color: #352700; }
.register-hero--safeguarding p { color: inherit; }

.mfa-qr { display: block; max-width: 100%; height: auto; margin-block: 1rem; }

.header-logo {
    width: auto;
    height: auto;
    max-width: min(100%, 354px);
    max-height: 5rem;
    object-fit: scale-down;
    object-position: left center;
}
[data-theme="teal"] { --brand: #0c4c50; --brand-accent: #95d2ce; --brand-bg: #edf8f6; --brand-link: #075659; }
[data-theme="plum"] { --brand: #512c55; --brand-accent: #dbafd8; --brand-bg: #f9f1f8; --brand-link: #742660; }
[data-theme="dark"] { --brand: #172d44; --brand-accent: #70b7cf; --brand-bg: #101822; --brand-link: #a1dbf1; color-scheme: dark; }
[data-theme]:not([data-theme="classic"]) body { background: var(--brand-bg); }
[data-theme]:not([data-theme="classic"]) .topbar { background: var(--brand); border-color: var(--brand-accent); }
[data-theme]:not([data-theme="classic"]) .module-hero:not([class*="register-hero--"]),
[data-theme]:not([data-theme="classic"]) .leave-tabs a[aria-current] { background: var(--brand); color: #fff; }
[data-theme]:not([data-theme="classic"]) a { color: var(--brand-link); }
[data-theme]:not([data-theme="classic"]) .hub-card .hub-module:not(.hub-module--yellow, .hub-module--red, .hub-module--violet, .hub-module--ocean, .hub-module--spectrum),
[data-theme]:not([data-theme="classic"]) .hub-home-button { color: #fff; }
[data-theme="dark"] body { color: #eaf1f7; }
[data-theme="dark"] :is(.hub-card, .module-panel, .leave-metric, .table-scroll, .hub-panel-content, main > form, .leave-day-outside) {
    background: #1c2938;
    border-color: #495b70;
}
[data-theme="dark"] :is(h1, h2, h3, .hub-title, .hub-name, .hub-intro, .hub-footer, .hub-panel-content p,
    .leave-metric dt, .leave-metric dd, .module-panel-header p, .leave-day-outside) { color: #eaf1f7; }
[data-theme="dark"] :is(input, select, button, th, .leave-tabs a:not([aria-current]), .leave-month-links a) {
    background: #263b50;
    color: #edf6ff;
    border-color: #71869c;
}
[data-theme="dark"] .register-hero--safeguarding h1 { color: #352700; }
[data-theme="dark"] :is(td, .leave-day, .workforce-month, .hub-panel-content) { border-color: #495b70; }
[data-theme="dark"] :is(.leave-errors, [role="alert"]) { color: #ffb7ac; }
[data-theme="dark"] :focus-visible { outline-color: #9bd9f0; }

.module-form .admin-confirm { flex-direction: row; align-items: center; gap: .5rem; }
.module-form .admin-confirm input { min-height: auto; width: 1.25rem; height: 1.25rem; }

.prototype-confirm { flex-direction: row; align-items: center; }
.prototype-confirm input { min-height: auto; width: 1.25rem; height: 1.25rem; }
.prototype-checksum, .workforce-month li { overflow-wrap: anywhere; }

.referral-dashboard > .referral-filters { padding: 0; background: transparent; border: 0; }
.referral-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; border-left: .22rem solid #ffca24; }
.referral-heading h1 { margin: 0; font-size: clamp(1.2rem, 3vw, 1.6rem); }
.referral-heading p, .referral-dashboard section > p { margin: .25rem 0 .8rem; }
.referral-metrics .leave-metric { border-left: .18rem solid #ffca24; }
.referral-metrics .referral-open { background: #087530; border-color: #087530; }
.referral-metrics .referral-open :is(dt, dd) { color: #fff; }
.referral-dashboard .table-scroll thead th { background: #ffca24; color: #241b00; }
.referral-dashboard .table-scroll th, .referral-dashboard .table-scroll td { font-size: .84rem; }
.referral-primary { display: inline-flex; align-items: center; min-height: 2.75rem; border: 1px solid #a16b00; padding: .45rem .8rem; border-radius: .45rem; background: #ffca24; color: #241b00 !important; font-weight: 650; }
.referral-filters .referral-primary { margin-bottom: .5rem; }
.referral-dashboard [hidden] { display: none; }
textarea { max-width: 100%; min-width: min(16rem, 100%); font: inherit; }

.compliance-tab {
    position: fixed;
    left: 0;
    top: 50%;
    z-index: 5;
    transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    padding: .85rem .55rem;
    border: 0;
    border-radius: 0 .75rem .75rem 0;
    background: linear-gradient(#154666, #347988);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 .35rem 1.25rem #092f403c;
}
.compliance-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    margin: 0;
    box-sizing: border-box;
    width: min(30rem, calc(100% - 1rem));
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 1.2rem;
    border: 0;
    background: #fff;
    color: #123f5a;
    overflow: auto;
}
.compliance-drawer::backdrop { background: #0b27385c; }
.compliance-heading { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.compliance-heading h2 { margin: 0; font-size: clamp(1.2rem, 4vw, 1.75rem); }
.compliance-heading button { font-size: 1.5rem; }
.compliance-tools { margin-top: 1rem; }
.compliance-tools label { display: block; margin-bottom: .5rem; }
.compliance-tools button, .compliance-heading button { background: #e9f2f5; color: #103f62; }
.compliance-summary { display: grid; gap: 1rem; }
.compliance-card {
    display: block;
    padding: 1.15rem;
    border: 2px solid #539da4;
    border-radius: .9rem;
    background: #e4e8eb;
    color: #293e50;
    text-decoration: none;
}
.compliance-card:hover > span, .compliance-card:focus-visible > span { text-decoration: underline; }
.compliance-card h3 { margin: 0; font-size: 1.25rem; }
.compliance-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: 1rem 0; }
.compliance-card dl div { display: flex; flex-direction: column-reverse; text-align: center; padding: .5rem .2rem; }
.compliance-card dd { margin: 0 0 .25rem; font-size: 1.8rem; font-weight: 700; }
[data-theme="dark"] .compliance-drawer { background: #172536; color: #d9e9f3; }
[data-theme="dark"] .compliance-card { background: #25384a; color: #d9e9f3; }

[data-theme] .hub-card .hub-module--red { background: #b8102b; color: #fff; }
[data-theme] .hub-card .hub-module--violet { background: #602886; color: #fff; }
[data-theme] .hub-card .hub-module--ocean {
    background: linear-gradient(102deg, #123e5d, #236686 60%, #387b85);
    color: #fff;
}
[data-theme] .hub-card .hub-module--spectrum {
    background: linear-gradient(102deg, #494fbc, #861199 70%, #006b85);
    color: #fff;
}

.nmc-page { --nmc-panel: #fff; --nmc-accent: #25396a; --nmc-border: #c6d2e2; }
.nmc-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; padding: 0; margin: 1rem 0; }
.nmc-metric { background: var(--nmc-panel); border-radius: .8rem; padding: 1rem; min-height: 6rem; display: flex; flex-direction: column; justify-content: center; }
.nmc-metric-total { grid-row: span 2; }
.nmc-metric dt { font-size: .85rem; }
.nmc-metric dd { margin: .3rem 0 0; font-size: 1.85rem; font-weight: 700; }
.nmc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .7rem; flex-wrap: wrap; }
.nmc-toolbar .leave-tabs, .nmc-toolbar .filters { margin: .4rem 0; }
.nmc-page .leave-tabs a { background: var(--nmc-panel); border: 1px solid var(--nmc-border); }
.nmc-page .leave-tabs a:is([aria-current="page"], .nmc-official) { background: var(--nmc-accent); color: #fff; }
.nmc-page .module-panel { background: var(--nmc-panel); }
.nmc-log thead { background: #eef1f5; }
.nmc-log th { white-space: normal; }
[data-theme="dark"] .nmc-page { --nmc-panel: #25384a; --nmc-border: #60758b; }
[data-theme="dark"] .nmc-log thead { background: #172536; }
@media (max-width: 55rem) { .nmc-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 29rem) { .nmc-metric-total { grid-row: auto; grid-column: span 2; } }

main:has(> .nmc-page) {
    width: min(calc(100% - 1.5rem), 88rem);
    margin-block: 1rem 2rem;
}
body:has(.nmc-page) { background: #eef0f1; }
.nmc-page .nmc-metrics { margin-block: .75rem 1rem; }
.nmc-page .nmc-metric { min-height: 6.5rem; }
.nmc-page .nmc-metric-total { justify-content: center; }
.nmc-page .filters { align-items: center; flex-direction: row; }
.nmc-page .filters label { flex-direction: row; align-items: center; margin: 0; gap: .45rem; font-size: .875rem; }
.nmc-page .filters :is(input, select, button), .nmc-page .filters a, .nmc-page .leave-tabs a {
    min-height: 2.6rem;
    padding: .4rem .8rem;
    border: 1px solid var(--nmc-border);
    border-radius: .45rem;
    font-size: .86rem;
}
.nmc-page .filters a { display: inline-flex; align-items: center; text-decoration: none; }
.nmc-page .filters :is(button, a) { margin: 0; }
.nmc-page .nmc-log { padding: 1rem; }
.nmc-page .nmc-log .table-scroll { margin-top: .85rem; border-color: var(--nmc-border); }
.nmc-log table { min-width: 62rem; font-size: .8rem; }
.nmc-log :is(th, td) { padding: .5rem; }
.nmc-log thead th { background: #eff2f5; vertical-align: bottom; }
[data-theme="dark"] body:has(.nmc-page) { background: var(--brand-bg); }
[data-theme="dark"] .nmc-log thead th { background: #172536; }
