:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #18181b;
    --text-muted: #52525b;
    --text-soft: #71717a;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --accent: #2f2f2f;
    --accent-hover: #1a1a1a;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --tag-bg: #f4f4f5;
    --font: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #09090b;
        --surface: #18181b;
        --text: #fafafa;
        --text-muted: #a1a1aa;
        --text-soft: #a1a1aa;
        --border: #27272a;
        --border-strong: #3f3f46;
        --accent: #fafafa;
        --accent-hover: #e4e4e7;
        --danger-bg: rgba(127, 29, 29, 0.25);
        --danger-border: rgba(185, 28, 28, 0.45);
        --danger-text: #fecaca;
        --tag-bg: #27272a;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Auth (SSO login) */
.auth-layout {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.auth-layout__inner {
    width: 100%;
    max-width: 28rem;
}

.auth-card {
    border-radius: 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.auth-card__header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-card__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
}

.auth-card__subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.alert {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.alert--error {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
}

.alert--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

@media (prefers-color-scheme: dark) {
    .alert--success {
        border-color: rgba(34, 197, 94, 0.45);
        background: rgba(20, 83, 45, 0.25);
        color: #bbf7d0;
    }
}

.btn-microsoft {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 0.5rem;
    background: #2f2f2f;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    transition: background 0.15s ease;
}

.btn-microsoft:hover {
    background: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
    .btn-microsoft {
        background: #fafafa;
        color: #18181b;
    }

    .btn-microsoft:hover {
        background: #e4e4e7;
    }
}

.btn-microsoft svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.auth-footnote {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-soft);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.auth-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}

.auth-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
}

.auth-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.auth-input--error {
    border-color: var(--danger-border);
}

.auth-field__error {
    margin: 0;
    font-size: 0.75rem;
    color: var(--danger-text);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.btn-primary {
    margin-top: 0.25rem;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--accent);
    background: var(--accent);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--surface);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

@media (prefers-color-scheme: dark) {
    .btn-primary {
        color: #18181b;
    }
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-soft);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    flex-shrink: 0;
}

/* Authenticated app shell */
.app-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.shell-main {
    flex: 1 1 auto;
}

.site-nav {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-nav__inner {
    margin: 0 auto;
    display: flex;
    max-width: 64rem;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .site-nav__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
}

.site-nav__link {
    display: inline-block;
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-nav__link:hover {
    background: var(--bg);
    color: var(--text);
}

.site-nav__link--current {
    background: var(--tag-bg);
    color: var(--text);
    font-weight: 600;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.site-footer__inner {
    margin: 0 auto;
    max-width: 64rem;
    padding: 1rem 1rem;
}

@media (min-width: 640px) {
    .site-footer__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.site-footer__text {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-soft);
    text-align: center;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.site-header__inner {
    margin: 0 auto;
    display: flex;
    max-width: 64rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem;
}

@media (min-width: 640px) {
    .site-header__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.site-header__label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.site-header__name {
    margin: 0;
    font-weight: 600;
    color: var(--text);
}

.site-header__name--brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

@media (min-width: 640px) {
    .site-header__name--brand {
        font-size: 1.75rem;
    }
}

/* Header user profile + dropdown */
.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0.375rem 0.5rem 0.375rem 0.375rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    background: transparent;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-menu__trigger::-webkit-details-marker {
    display: none;
}

.user-menu__trigger:hover {
    background: var(--bg);
    border-color: var(--border);
}

.user-menu[open] .user-menu__trigger {
    background: var(--bg);
    border-color: var(--border);
}

.user-menu__avatar {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.user-menu__text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    text-align: left;
}

.user-menu__name {
    max-width: 12rem;
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .user-menu__name {
        max-width: 16rem;
    }
}

.user-menu__role {
    max-width: 12rem;
    overflow: hidden;
    font-size: 0.8125rem;
    line-height: 1.25;
    color: var(--text-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .user-menu__role {
        max-width: 16rem;
    }
}

.user-menu__chevron {
    flex-shrink: 0;
    color: var(--text-soft);
    transition: transform 0.2s ease;
}

.user-menu[open] .user-menu__chevron {
    transform: rotate(180deg);
}

.user-menu__panel {
    position: absolute;
    z-index: 50;
    right: 0;
    margin-top: 0.375rem;
    min-width: 11rem;
    padding: 0.375rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
    .user-menu__panel {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    }
}

.user-menu__logout {
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.user-menu__logout:hover {
    background: var(--bg);
}

@media (prefers-color-scheme: dark) {
    .user-menu__logout:hover {
        background: #27272a;
    }
}

.btn-signout {
    border-radius: 0.5rem;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-signout:hover {
    background: var(--bg);
}

@media (prefers-color-scheme: dark) {
    .btn-signout:hover {
        background: #27272a;
    }
}

.page-main {
    margin: 0 auto;
    width: 100%;
    max-width: 64rem;
    padding: 2.5rem 1rem;
}

@media (min-width: 640px) {
    .page-main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.page-heading__title {
    margin: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
}

.page-heading__desc {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-grid {
    margin-top: 2rem;
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.panel {
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.panel__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.dl-list {
    margin: 1rem 0 0;
}

.dl-list__row + .dl-list__row {
    margin-top: 0.75rem;
}

.dl-list dt {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-soft);
}

.dl-list dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.role-list {
    margin: 1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    list-style: none;
}

.role-tag {
    border-radius: 9999px;
    background: var(--tag-bg);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
}

.panel__empty {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.receipts-panel {
    margin-top: 1.5rem;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.receipts-panel .panel__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
}

.datatable {
    border-radius: 0.75rem;
    border: 1px solid #3f3f46;
    background: #1f2125;
    color: #f3f4f6;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.datatable-controls {
    display: flex;
    justify-content: stretch;
    align-items: center;
    border-bottom: 1px solid #32343a;
    padding: 0.875rem 1.25rem;
}

.datatable-filter-form {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.datatable-toolbar-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    width: 100%;
}

.datatable-search-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 14rem;
    min-width: 0;
    max-width: 28rem;
}

.datatable-filter-group {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.datatable-search-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    background: #111827;
    color: #f9fafb;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
}

.datatable-search-input::placeholder {
    color: #9ca3af;
}

.datatable-search-input:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.datatable-search-btn {
    flex-shrink: 0;
    border: 1px solid #2563eb;
    border-radius: 0.375rem;
    background: #2563eb;
    color: #f9fafb;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.datatable-search-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.datatable-search-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.datatable-empty {
    margin: 0;
    padding: 1.5rem 1.25rem 1.75rem;
    border-bottom: none;
}

.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;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 56rem;
}

.data-table th,
.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #32343a;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #d1d5db;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.datatable-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
}

.datatable-link:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.datatable-link:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
    border-radius: 0.125rem;
}

.datatable-delete-btn {
    border: 1px solid #7f1d1d;
    background: #991b1b;
    color: #fef2f2;
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.datatable-delete-btn:hover {
    background: #b91c1c;
}

.datatable-delete-btn:focus-visible {
    outline: 2px solid #fca5a5;
    outline-offset: 2px;
}

.datatable-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid #32343a;
    padding: 0.875rem 1.25rem;
}

.datatable-size-form {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.datatable-footer__label,
.datatable-footer__range {
    margin: 0;
    font-size: 0.875rem;
    color: #d1d5db;
}

.datatable-select {
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    background: #111827;
    color: #f9fafb;
    padding: 0.25rem 1.75rem 0.25rem 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
}

.datatable-pagination {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.datatable-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    background: #111827;
    color: #f9fafb;
    text-decoration: none;
    line-height: 1;
    font-size: 1.125rem;
}

.datatable-page-btn:hover {
    background: #1f2937;
}

.datatable-page-btn--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.receipt-form-panel {
    margin-top: 1.5rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 36rem;
}

.receipt-form__hint {
    margin: 0.375rem 0 0;
    font-size: 0.75rem;
    color: var(--text-soft);
}

.receipt-form__fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.receipt-form__radios {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.375rem;
}

.receipt-form__radio-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.receipt-form__radio-label input {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    margin: 0;
    border: 1px solid var(--border-strong);
    border-radius: 9999px;
    background: var(--surface);
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

.receipt-form__radio-label input::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    transform: scale(0);
    transition: transform 0.15s ease;
    background: var(--accent);
}

.receipt-form__radio-label input:checked {
    border-color: var(--accent);
}

.receipt-form__radio-label input:checked::before {
    transform: scale(1);
}

.receipt-form__radio-label input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Welcome */
.welcome {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.welcome__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.welcome__text {
    margin: 0.75rem 0 0;
    max-width: 28rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.welcome__actions {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.welcome__link {
    display: inline-block;
    border-radius: 0.375rem;
    border: 1px solid var(--border-strong);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s ease;
}

.welcome__link:hover {
    background: var(--surface);
}

.welcome__link--primary {
    border-color: transparent;
    background: var(--accent);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .welcome__link--primary {
        color: #18181b;
    }
}

.welcome__link--primary:hover {
    background: var(--accent-hover);
}

button.welcome__link--button {
    cursor: pointer;
    font: inherit;
    border: none;
    text-decoration: none;
}

/* Weekly report */
.panel__meta {
    margin: -0.25rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.report-totals {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-totals p {
    margin: 0;
    color: var(--text);
    font-size: 0.9375rem;
}

.report-week-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-strong, #32343a);
}

.report-week-toolbar__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.report-week-toolbar__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
}

.report-week-toolbar__date {
    padding-right: 0.625rem;
    min-height: 2rem;
}

.report-week-toolbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #4b5563;
    background: #111827;
    color: #f9fafb;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.25;
    cursor: pointer;
    transition: background 0.15s ease;
}

.report-week-toolbar__btn:hover:not(.report-week-toolbar__btn--disabled) {
    background: #1f2937;
}

.report-week-toolbar__btn--secondary {
    border-color: #52525b;
    background: transparent;
    color: #e4e4e7;
}

.report-week-toolbar__btn--secondary:hover:not(.report-week-toolbar__btn--disabled) {
    background: rgba(255, 255, 255, 0.06);
}

.report-week-toolbar__btn--submit {
    min-height: 2rem;
}

.report-week-toolbar__btn--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Settings: users & permissions (super admin) */
.settings-access__flash {
    margin-bottom: 1rem;
}

.settings-users-panel {
    margin-bottom: 2rem;
}

.settings-users-table .settings-user-role-form {
    margin: 0;
}

.settings-user-role-form__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.settings-user-role-form__label {
    margin: 0;
}

.settings-user-role-form__select {
    min-width: 10rem;
}

.settings-user-role-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #4b5563;
    background: #111827;
    color: #f9fafb;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.settings-user-role-form__submit:hover {
    background: #1f2937;
}

.settings-user-role-form__error {
    margin: 0.375rem 0 0;
}

.settings-users-table__you {
    margin-left: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Permission matrix (super admin) */
.permission-matrix-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

.permission-matrix .permission-matrix__perm-head {
    min-width: 7.5rem;
    max-width: 10rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    vertical-align: bottom;
    text-transform: none;
}

.permission-matrix__role {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.permission-matrix__cell {
    text-align: center;
    vertical-align: middle;
}

.permission-matrix__check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    min-width: 2rem;
    cursor: pointer;
    margin: 0;
}

.permission-matrix__check-label input {
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent);
}

.permission-matrix__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.permission-matrix__locked {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.permission-matrix__tick {
    color: var(--accent);
    font-weight: 600;
}

.permission-matrix-actions {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
