:root {
    color-scheme: light;
    font-family: "Figtree", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    --black: #111111;
    --gray-950: #171717;
    --gray-900: #242424;
    --gray-700: #525252;
    --gray-600: #686868;
    --gray-400: #a3a3a3;
    --gray-300: #d4d4d4;
    --gray-200: #e5e5e5;
    --gray-100: #f1f1f1;
    --gray-50: #f7f7f7;
    --white: #ffffff;
    --sidebar-width: 17rem;
    --topbar-height: 0rem;
    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --shadow-soft: 0 1rem 3rem rgb(0 0 0 / 6%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 20rem;
    background: var(--gray-50);
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--gray-50);
    color: var(--gray-950);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

body:not(.admin-body) {
    display: grid;
    padding: 1rem;
    place-items: center;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid #6b6b6b;
    outline-offset: 3px;
}

svg {
    display: block;
    flex: 0 0 auto;
}

svg path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.auth-card,
.message-card {
    width: min(100%, 28rem);
    padding: clamp(1.5rem, 5vw, 2.25rem);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.auth-card h1,
.message-card h1 {
    margin: 0;
    font-size: clamp(1.75rem, 6vw, 2rem);
    letter-spacing: -0.035em;
}

.auth-logo {
    display: block;
    width: min(100%, 20rem);
    height: auto;
    margin: 0 0 1rem;
}

.public-logo {
    display: block;
    width: min(80vw, 32rem);
    height: auto;
}

.auth-card h2 {
    margin: 0.4rem 0 1.5rem;
    color: var(--gray-700);
    font-size: 1.125rem;
    font-weight: 550;
}

.auth-card > p:not(.form-error) {
    margin: -0.5rem 0 1.5rem;
    color: var(--gray-600);
}

.auth-card form,
.message-card form {
    display: grid;
    gap: 0.75rem;
}

.auth-card label {
    font-size: 0.9rem;
    font-weight: 650;
}

.auth-card input {
    width: 100%;
    min-height: 2.875rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-950);
}

.auth-card input:hover {
    border-color: var(--gray-400);
}

.auth-card input:focus {
    border-color: var(--gray-700);
}

.auth-card button,
.message-card button {
    width: 100%;
    min-height: 2.875rem;
    margin-top: 0.5rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--gray-950);
    border-radius: var(--radius-sm);
    background: var(--gray-950);
    color: var(--white);
    font-weight: 650;
}

.auth-card button:hover,
.message-card button:hover {
    background: var(--gray-900);
}

.auth-password-field {
    position: relative;
}

.auth-password-field input {
    padding-right: 3.5rem;
}

.auth-card .auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.125rem;
    display: grid;
    width: 2.75rem;
    min-height: 2.75rem;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--gray-700);
}

.auth-card .auth-password-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-950);
}

.auth-card .auth-password-toggle[hidden],
.auth-password-toggle [hidden] {
    display: none;
}

.form-error,
.form-success,
.notice {
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    color: var(--gray-900);
}

.form-success,
.notice-success {
    background: var(--white);
}

.secondary-action {
    margin-top: 1rem;
}

.auth-card .button-secondary {
    border-color: var(--gray-400);
    background: var(--white);
    color: var(--gray-900);
}

.auth-card .button-secondary:hover {
    background: var(--gray-100);
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--black);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.admin-layout {
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: hidden;
    border-right: 1px solid var(--gray-200);
    background: #fafafa;
    color: var(--gray-950);
}

.sidebar-header {
    display: flex;
    min-height: 4.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-header .brand { flex: 1 1 auto; }

.brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-950);
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: min(100%, 12.5rem);
    max-height: 2.75rem;
    object-fit: contain;
    object-position: left center;
}

.sidebar-close,
.menu-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
}

.sidebar-compact-toggle {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--gray-700);
    cursor: pointer;
}
.sidebar-compact-toggle:hover { background: var(--gray-100); }
.sidebar-compact-toggle:focus-visible { outline: 2px solid #2975bd; outline-offset: 2px; }
.sidebar-compact-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.sidebar-close {
    background: transparent;
    color: var(--gray-950);
}

.sidebar-close:hover {
    background: var(--gray-100);
}

.sidebar-navigation {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 1.25rem 0.9rem;
}

.sidebar-account { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--gray-200); }
.sidebar-account-identity { display: flex; flex: 1 1 auto; align-items: center; gap: .65rem; padding: .35rem .5rem; min-width: 0; color: var(--gray-700); font-size: .8rem; }
.sidebar-account-identity svg, .sidebar-account .logout-button svg { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account .logout-button { display: flex; width: 40px; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; padding: .5rem; border: 0; background: transparent; font-size: .8rem; }
.sidebar-account .logout-button:hover { background: var(--gray-100); }

.sidebar-list {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-link {
    display: flex;
    min-height: 2.875rem;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    color: var(--gray-700);
    font-size: 0.925rem;
    font-weight: 620;
    text-decoration: none;
}

.sidebar-link:hover {
    background: #efeff2;
    color: var(--gray-950);
}

.sidebar-link.is-active {
    background: #e9eff7;
    color: #1f5e9d;
}

.admin-sidebar :focus-visible {
    outline-color: #2975bd;
}

.sidebar-group-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.sidebar-group-trigger span { flex: 1 1 auto; min-width: 0; }
.sidebar-group-trigger.is-group-active { color: #1f5e9d; font-weight: 700; }
.sidebar-chevron { margin-left: auto; transition: transform 160ms ease; }
.sidebar-group-trigger[aria-expanded="false"] .sidebar-chevron { transform: rotate(-90deg); }
.sidebar-submenu { display: grid; gap: 0.2rem; margin: 0.15rem 0 0.45rem 1.2rem; padding: 0 0 0 0.65rem; border-left: 1px solid var(--gray-200); list-style: none; }
.sidebar-submenu[hidden] { display: none; }
.sidebar-subitem { display: flex; min-height: 2.6rem; align-items: center; padding: 0.5rem 0.75rem; border-radius: 0.6rem; color: var(--gray-700); font-size: 0.88rem; font-weight: 550; text-decoration: none; overflow-wrap: anywhere; }
.sidebar-subitem:hover { background: #efeff2; color: var(--gray-950); }
.sidebar-subitem.is-active { background: #e9eff7; color: #1f5e9d; font-weight: 700; }
.sidebar-submenu .sidebar-submenu { margin-left: .75rem; padding-left: .5rem; }
.sidebar-subitem.sidebar-group-trigger { gap: .4rem; }
.sidebar-subitem.sidebar-group-trigger svg { flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-subitem-row { display: flex; align-items: center; gap: .15rem; border-radius: .6rem; }
.sidebar-subitem-row > .sidebar-subitem { flex: 1 1 auto; min-width: 0; }
.sidebar-subitem-row.is-group-active { background: #e9eff7; }
.sidebar-subitem-row.is-group-active > .sidebar-subitem { color: #1f5e9d; font-weight: 700; }
.sidebar-subitem-label:hover { background: transparent; }
.sidebar-secondary-action { display: inline-flex; flex: 0 0 2.5rem; min-height: 2.6rem; align-items: center; justify-content: center; border-radius: .6rem; color: var(--gray-600); text-decoration: none; }
.sidebar-secondary-action:hover { background: #efeff2; color: var(--gray-950); }
.sidebar-secondary-action.is-active { background: #dce8f5; color: #1f5e9d; }
.sidebar-secondary-action svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-secondary-action:focus-visible, .sidebar-subitem:focus-visible { outline: 2px solid #2975bd; outline-offset: -2px; }

.admin-workspace {
    min-width: 0;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

@media (min-width: 64rem) {
    .admin-sidebar { transition: width 160ms ease; }
    .admin-workspace { transition: margin-left 160ms ease; }
    .admin-layout--sidebar-compact { --sidebar-width: 4.5rem; }
    .admin-layout--sidebar-compact .sidebar-header { flex-direction: column; justify-content: center; gap: .25rem; padding: .5rem .4rem; }
    .admin-layout--sidebar-compact .brand { width: 100%; justify-content: center; }
    .admin-layout--sidebar-compact .brand-logo { width: 3.4rem; max-height: 2.5rem; object-position: center; }
    .admin-layout--sidebar-compact .sidebar-navigation { padding: 0.75rem 0.45rem; }
    .admin-layout--sidebar-compact .sidebar-link { justify-content: center; padding: 0.65rem; }
    .admin-layout--sidebar-compact .sidebar-link > span,
    .admin-layout--sidebar-compact .sidebar-chevron,
    .admin-layout--sidebar-compact .sidebar-submenu { display: none; }
    .admin-layout--sidebar-compact .sidebar-group-trigger.is-group-active { background: #e9eff7; }
    .admin-layout--sidebar-compact .sidebar-account { padding-inline: .25rem; }
    .admin-layout--sidebar-compact .sidebar-account-identity { justify-content: center; gap: 0; padding: 0; }
    .admin-layout--sidebar-compact .sidebar-account-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (prefers-reduced-motion: reduce) {
    .admin-sidebar, .admin-workspace { transition: none; }
}

.logout-form {
    flex: 0 0 auto;
    margin: 0;
}

.logout-button {
    min-height: 2.75rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-900);
    font-size: 0.875rem;
    font-weight: 650;
}

.logout-button:hover {
    border-color: var(--gray-400);
    background: var(--gray-100);
}

.admin-content {
    width: min(100%, 96rem);
    min-width: 0;
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem);
    overflow-wrap: anywhere;
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.page-eyebrow {
    margin: 0 0 0.3rem;
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.75rem);
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.page-description {
    margin: 0.65rem 0 0;
    color: var(--gray-600);
}

.button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 680;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.button-primary {
    border-color: var(--gray-950);
    background: var(--gray-950);
    color: var(--white);
}

.button-primary:hover {
    background: var(--gray-900);
}

.button-secondary {
    border-color: var(--gray-300);
    background: var(--white);
    color: var(--gray-900);
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: var(--gray-400);
    background: var(--gray-100);
}

.button-quiet {
    border-color: transparent;
    background: transparent;
    color: var(--gray-700);
}

.notice-error,
.field-error {
    color: #3f1717;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 13rem) auto auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
}

.field {
    display: grid;
    min-width: 0;
    gap: 0.4rem;
}

.field label,
.roles-fieldset legend {
    font-size: 0.9rem;
    font-weight: 680;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-950);
}

.field textarea {
    min-height: 7rem;
    resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: var(--gray-400);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--gray-700);
}

.field input[aria-invalid="true"] {
    border-color: var(--gray-900);
}

.field textarea[aria-invalid="true"] {
    border-color: var(--gray-900);
}

.field input[readonly],
.field textarea[readonly] {
    background: var(--gray-50);
    color: var(--gray-700);
    cursor: default;
}

.data-panel,
.entity-form {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: 0 0.75rem 2.5rem rgb(0 0 0 / 3%);
}

.data-panel {
    overflow: hidden;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.responsive-table th,
.responsive-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    overflow-wrap: anywhere;
    text-align: left;
    vertical-align: middle;
}

.responsive-table th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.responsive-table tr:last-child td {
    border-bottom: 0;
}

.responsive-table th:first-child {
    width: 17%;
}

.responsive-table th:nth-child(2) {
    width: 21%;
}

.responsive-table th:nth-child(3) {
    width: 20%;
}

.responsive-table th:nth-child(4) {
    width: 10%;
}

.responsive-table th:nth-child(5) {
    width: 14%;
}

.responsive-table th:last-child {
    width: 18%;
}

.roles-table th:first-child {
    width: 19%;
}

.roles-table th:nth-child(2) {
    width: 31%;
}

.roles-table th:nth-child(3),
.roles-table th:nth-child(4) {
    width: 13%;
}

.roles-table th:nth-child(5) {
    width: 15%;
}

.roles-table th:last-child {
    width: 9%;
}

.cell-break {
    overflow-wrap: anywhere;
}

.role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.role-badge,
.status-badge {
    display: inline-flex;
    min-height: 1.75rem;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 650;
}

.status-badge.is-active {
    border-color: var(--gray-900);
    background: var(--gray-900);
    color: var(--white);
}

.status-badge.is-inactive {
    color: var(--gray-600);
}

.role-protected-badge {
    display: inline-flex;
    min-height: 1.75rem;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--gray-900);
    border-radius: 999px;
    background: var(--white);
    color: var(--gray-900);
    font-size: 0.78rem;
    font-weight: 700;
}

.text-muted {
    color: var(--gray-600);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.table-actions form {
    margin: 0;
}

.action-link,
.action-button {
    border: 0;
    background: transparent;
    color: var(--gray-700);
    font-size: 0.85rem;
    font-weight: 680;
    text-decoration: underline;
    text-decoration-color: var(--gray-300);
    text-underline-offset: 0.2rem;
}

.action-button {
    min-height: 2.5rem;
    padding: 0;
}

.action-link:hover,
.action-button:hover {
    color: var(--black);
    text-decoration-color: var(--black);
}

.table-empty {
    padding: clamp(2.5rem, 8vw, 5rem) 1.5rem;
    text-align: center;
}

.table-empty h2 {
    margin: 0;
    font-size: 1.25rem;
}

.table-empty p {
    margin: 0.5rem 0 0;
    color: var(--gray-600);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.pagination-link {
    min-height: 2.75rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
    font-weight: 650;
    text-decoration: none;
}

.pagination-link:hover {
    background: var(--gray-100);
}

.pagination-summary {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.form-page {
    width: min(100%, 68rem);
}

.back-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 650;
    text-decoration: none;
}

.back-link:hover {
    color: var(--black);
}

.entity-form {
    overflow: hidden;
}

.form-section {
    margin: 0;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 0;
    border-bottom: 1px solid var(--gray-200);
}

.form-section-heading {
    margin-bottom: 1.25rem;
}

.form-section-heading h2,
.roles-fieldset legend {
    margin: 0;
    color: var(--gray-950);
    font-size: 1rem;
    font-weight: 720;
}

.form-section-heading p,
.field-help {
    margin: 0.35rem 0 0;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.field-error {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 620;
}

.optional-label {
    color: var(--gray-600);
    font-size: 0.78rem;
    font-weight: 500;
}

.roles-fieldset legend {
    padding: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.checkbox-card,
.switch-field {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
}

.checkbox-card:hover,
.switch-field:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.checkbox-card input,
.switch-field input {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    margin: 0.15rem 0 0;
    accent-color: var(--black);
}

.checkbox-card span,
.switch-field span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    font-weight: 650;
}

.permission-card span {
    display: grid;
    gap: 0.2rem;
}

.permission-card strong {
    font-size: 0.9rem;
}

.permission-card small {
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 450;
    line-height: 1.4;
}

.permission-card.is-readonly {
    background: var(--gray-50);
    cursor: default;
}

.permission-card input:disabled {
    opacity: 1;
}

.permissions-fieldset > .field-error {
    margin-top: 0.8rem;
}

.permissions-empty {
    margin: 1rem 0 0;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    color: var(--gray-600);
}

.protected-notice {
    border-color: var(--gray-400);
    background: var(--white);
}

.switch-field small {
    display: block;
    margin-top: 0.2rem;
    color: var(--gray-600);
    font-size: 0.82rem;
    font-weight: 450;
}

.compact-section {
    padding-block: 1.25rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem clamp(1.25rem, 4vw, 2rem);
    background: var(--gray-50);
}

.empty-state-action {
    margin-top: 1.25rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.notice {
    margin: 0 0 1.5rem;
}

.welcome-panel {
    position: relative;
    min-height: 19rem;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    background: var(--white);
    box-shadow: 0 0.75rem 2.5rem rgb(0 0 0 / 4%);
}

.welcome-panel::after {
    position: absolute;
    inset: auto -5rem -8rem auto;
    width: 20rem;
    height: 20rem;
    border: 4rem solid var(--gray-50);
    border-radius: 50%;
    content: "";
}

.welcome-panel-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 19rem;
    max-width: 48rem;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 4rem);
}

.welcome-label {
    margin: 0 0 0.75rem;
    color: var(--gray-600);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.welcome-panel h2 {
    max-width: 38rem;
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 3rem);
    letter-spacing: -0.045em;
    line-height: 1.12;
}

.welcome-panel-content > p:last-child {
    max-width: 34rem;
    margin: 1rem 0 0;
    color: var(--gray-600);
    font-size: clamp(1rem, 2vw, 1.125rem);
}

.empty-state {
    display: grid;
    min-height: min(32rem, calc(100vh - var(--topbar-height) - 6rem));
    place-content: center;
    padding: 2rem;
    text-align: center;
}

.empty-state h1 {
    margin: 0;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    letter-spacing: -0.04em;
}

.empty-state p:last-child {
    margin: 0.75rem 0 0;
    color: var(--gray-600);
}

.sidebar-backdrop {
    display: none;
}

/* One global notification centre, shared by authorized sources. */
.global-notifications { position:fixed; z-index:25; right:1rem; bottom:calc(1rem + env(safe-area-inset-bottom)); max-width:calc(100vw - 2rem); }
.global-notifications [hidden],.global-notifications[hidden] { display:none; }
.notification-bell { display:flex; align-items:center; gap:.45rem; max-width:100%; border:1px solid #d6dde3; border-radius:100px; background:#fff; color:#334155; padding:.65rem .85rem; font:inherit; font-size:.84rem; font-weight:600; cursor:pointer; }
.notification-bell svg { flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.notification-badge { min-width:1.35rem; padding:.1rem .3rem; border-radius:100px; background:#a44813; color:#fff; text-align:center; font-size:.75rem; }
.notification-panel { position:absolute; right:0; bottom:calc(100% + .5rem); width:min(23rem,calc(100vw - 2rem)); max-height:min(32rem,calc(100dvh - 6rem - env(safe-area-inset-bottom))); overflow:auto; overscroll-behavior:contain; border:1px solid #d6dde3; border-radius:10px; background:#fff; color:#334155; box-shadow:0 3px 12px #1c314014; }
.notification-panel-header { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.55rem .8rem; border-bottom:1px solid #e5e9ed; }
.notification-close { display:grid; place-items:center; width:2.5rem; height:2.5rem; flex:none; border:0; border-radius:6px; background:transparent; color:#475569; cursor:pointer; font-size:1.4rem; }
.notification-content { padding:.25rem .65rem .65rem; overflow-wrap:anywhere; }
.notification-source + .notification-source { border-top:1px solid #e5e9ed; margin-top:.35rem; }
.notification-source-heading { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin:0; padding:.65rem .2rem .35rem; font-size:.8rem; font-weight:700; }
.notification-source-count { color:#64748b; font-size:.75rem; font-weight:500; }
.notification-item { display:grid; gap:.15rem; padding:.55rem .6rem; margin:.2rem 0; border-left:2px solid #d5a94b; border-radius:3px; color:inherit; text-decoration:none; background:#fafbfc; }
.notification-item--urgent { border-left-color:#b94634; }
.notification-item-title { font-size:.82rem; font-weight:600; }
.notification-item-message { font-size:.78rem; color:#596579; }
.notification-item:hover { background:#f1f4f6; }
.notification-view-all { display:inline-block; padding:.55rem .2rem; color:#9b471d; font-size:.78rem; }
.notification-empty { margin:0; padding:.9rem .25rem; font-size:.82rem; color:#64748b; }
.notification-toast { position:absolute; right:0; bottom:calc(100% + .5rem); width:min(20rem,calc(100vw - 2rem)); border:1px solid #e6c780; border-radius:8px; background:#fffaf0; color:#60471a; padding:.7rem .85rem; font-size:.8rem; overflow-wrap:anywhere; }
.notification-bell:focus-visible,.notification-close:focus-visible,.notification-item:focus-visible,.notification-view-all:focus-visible { outline:2px solid #225c97; outline-offset:2px; }

@media (max-width: 63.999rem) {
    .global-notifications { right:.75rem; bottom:calc(.75rem + env(safe-area-inset-bottom)); }
    .notification-panel,.notification-toast { width:min(23rem,calc(100vw - 1.5rem)); }
    .sidebar-compact-toggle { display: none; }
    .admin-sidebar {
        width: min(19rem, calc(100vw - 3.5rem));
        transform: translateX(-101%);
        transition: transform 180ms ease;
    }

    .admin-layout.is-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-workspace {
        margin-left: 2.75rem;
    }


    .menu-toggle,
    .sidebar-close {
        display: inline-flex;
    }

    .menu-toggle {
        position: fixed;
        z-index: 25;
        top: .5rem;
        left: .125rem;
        width: 2.5rem;
        height: 2.75rem;
        background: #fafafa;
        color: var(--gray-950);
    }

    .menu-toggle:hover {
        background: var(--gray-100);
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 35;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: rgb(0 0 0 / 42%);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .admin-layout.is-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .admin-body.is-sidebar-open {
        overflow: hidden;
    }

    .filter-panel {
        grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem) auto;
    }

    .filter-panel .button-quiet {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .responsive-table {
        table-layout: auto;
    }

    .responsive-table th,
    .responsive-table td {
        padding: 0.85rem;
    }
}

@media (max-width: 39.999rem) {
    :root {
        --topbar-height: 0rem;
    }

    .brand-logo {
        max-width: 11rem;
        max-height: 2.5rem;
    }

    .logout-button {
        padding-inline: 0.7rem;
        font-size: 0.8rem;
    }

    .admin-content {
        padding: 1.25rem 1rem 2rem;
    }

    .page-header {
        margin-bottom: 1.25rem;
    }

    .page-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header-actions .button {
        width: 100%;
    }

    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }

    .filter-search,
    .filter-status {
        grid-column: 1 / -1;
    }

    .filter-panel .button-quiet {
        grid-column: auto;
        justify-self: stretch;
    }

    .data-panel {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .responsive-table tbody {
        display: grid;
        gap: 0.85rem;
    }

    .responsive-table tr {
        overflow: hidden;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-md);
        background: var(--white);
        box-shadow: 0 0.5rem 1.75rem rgb(0 0 0 / 3%);
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--gray-200);
        text-align: right;
    }

    .responsive-table td::before {
        color: var(--gray-600);
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 750;
        letter-spacing: 0.04em;
        text-align: left;
        text-transform: uppercase;
    }

    .role-list,
    .table-actions {
        justify-content: flex-end;
    }

    .form-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .welcome-panel,
    .welcome-panel-content {
        min-height: 16rem;
    }

    .welcome-panel::after {
        right: -9rem;
        bottom: -11rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
