/* Arizona Support V9 — core UI
 * One source of truth for palette, shell and shared components.
 */
/*
  Arizona Support UI
  Единая компактная тёмно-серая тема для всех страниц проекта.
  Вся визуальная часть хранится здесь: без inline-стилей в PHP.
*/

/* legacy root variables removed; V9 tokens are defined below */


* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    line-height: 1.45;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    padding: 8px 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.026);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: 0;
    padding: 0;
    box-shadow: none;
}

input[type="file"] {
    min-height: 38px;
    padding: 7px;
    font-size: 0.9rem;
}

button:disabled,
select:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

label {
    display: grid;
    gap: 5px;
    color: var(--muted-strong);
    font-size: 0.88rem;
}

small {
    color: var(--muted);
}

/* Auth */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(410px, 100%);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-card h1 {
    margin: 20px 0 8px;
    font-size: 1.45rem;
}

/* Layout */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 226px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: var(--surface);
    padding: 16px;
}

.page {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px;
}

.footer {
    width: fit-content;
    max-width: 100%;
    margin: auto auto 0;
    padding: 7px 13px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: center;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand--center {
    justify-content: center;
}

.brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--surface-raised), var(--surface-raised));
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 0.98rem;
}

.brand small {
    margin-top: -2px;
    color: var(--muted);
    font-size: 0.78rem;
}

/* Navigation */
.main-nav {
    display: grid;
    gap: 12px;
}

.nav-group {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.nav-group__label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 10px 1px;
    color: var(--muted-strong);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.nav-group__label::after {
    content: "";
    display: block;
    min-width: 24px;
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.048), rgba(119,134,143,0));
}

.nav-group__items {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--muted-strong);
    padding: 7px 10px;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-link__icon {
    width: 16px;
    flex: 0 0 16px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1;
    text-align: center;
    transition: color 0.18s ease;
}

.nav-link__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
    border-color: var(--line);
    background: var(--surface-blue);
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-link:hover .nav-link__icon,
.nav-link.is-active .nav-link__icon {
    color: var(--primary-dark);
}

.user-mini {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
    padding: 9px;
}

.user-mini__avatar,
.employee-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
}

.user-mini span:last-child {
    min-width: 0;
}

.user-mini strong,
.user-mini small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-mini strong {
    font-size: 0.88rem;
}

/* Common blocks */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.page-head h1,
.panel h2,
.hero-card h2,
.employee-card h3 {
    margin: 0;
}

.page-head h1 {
    font-size: clamp(1.45rem, 2vw, 1.95rem);
    line-height: 1.15;
}

.page-head p,
.hero-card p,
.panel-head p,
.muted,
.note,
.empty-state p,
.profile-card p,
.role-card p {
    color: var(--muted);
}

.page-head p,
.hero-card p {
    max-width: 850px;
    margin: 5px 0 0;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 5px;
    color: var(--primary-dark);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.alert {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px 13px;
}

.alert--success {
    background: var(--success-bg);
    border-color: var(--success-line);
}

.alert--warning {
    background: var(--warning-bg);
    border-color: var(--warning-line);
}

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

.alert[data-auto-dismiss],
.notification-session-notice[data-auto-dismiss] {
    will-change: opacity, transform, max-height;
    transition: opacity 0.32s ease,
        transform 0.32s ease,
        max-height 0.32s ease,
        margin 0.32s ease,
        padding-top 0.32s ease,
        padding-bottom 0.32s ease,
        border-color 0.32s ease;
}

.alert.is-auto-dismissing,
.notification-session-notice.is-auto-dismissing {
    opacity: 0;

    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-color: transparent !important;
    pointer-events: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--primary-dark);
    padding: 3px 9px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.badge--role {
    align-self: start;
}

.badge--muted {
    border-color: var(--line);
    background: var(--surface-raised);
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.button:hover {

    text-decoration: none;
}

.button--primary {
    background: var(--primary);
    color: var(--text);
}

.button--primary:hover {
    background: var(--primary-dark);
}

.button--secondary,
.button--ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--primary-dark);
}

.button--secondary:hover,
.button--ghost:hover {
    border-color: var(--line-strong);
    background: var(--surface-blue);
}

.button--danger {
    background: var(--danger);
    color: var(--text);
}

.button--danger:hover {
    background: var(--danger-dark);
}

.button--full {
    width: 100%;
}

.button--tiny {
    min-height: 31px;
    border-radius: 9px;
    padding: 6px 9px;
    font-size: 0.84rem;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-card,
.panel,
.stat-card,
.empty-state,
.role-card,
.access-card,
.simple-row,
.employee-mini-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.hero-card,
.panel,
.stat-card {
    box-shadow: var(--shadow);
}

.hero-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 18px;
}

.hero-card--flat {
    align-items: flex-start;
    background: linear-gradient(180deg, var(--surface), var(--surface-raised));
}

.panel {
    padding: 16px;
}

.panel--compact {
    position: sticky;
    top: 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head--stack {
    align-items: flex-start;
}

.panel-head--compact h2 {
    font-size: 1.06rem;
}

.empty-state {
    padding: 18px;
    background: var(--surface-soft);
    box-shadow: none;
}

.empty-state strong {
    display: block;
}

.empty-state p {
    margin: 5px 0 0;
}

.note {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 11px;
    font-size: 0.88rem;
}

.section-gap {
    margin-top: 14px;
}

/* Grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    padding: 14px;
}

.stat-card small,
.simple-row small,
td small {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 5px;
    font-size: 1.55rem;
    line-height: 1.1;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
    align-items: start;
}

.content-grid--wide {
    grid-template-columns: minmax(0, 1fr) 335px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.role-card {
    padding: 13px;
    box-shadow: none;
}

.role-card strong,
.role-card span {
    display: block;
}

.role-card strong {
    color: var(--primary-dark);
}

/* Forms */
.stack-form {
    display: grid;
    gap: 10px;
}

.stack-form--compact {
    gap: 9px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input,
.search-form select {
    min-width: 170px;
}

.inline-form {
    margin-top: 12px;
}

.form-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.field-group {
    display: grid;
    gap: 7px;
}

.field-label {
    color: var(--muted-strong);
    font-size: 0.88rem;
}

.mini-text {
    margin: 0;
    font-size: 0.88rem;
}

.checkbox-list {
    display: grid;
    gap: 7px;
    max-height: 178px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 9px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.92rem;
}

.checkbox-row--compact {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    padding: 7px 9px;
}

.file-control {
    min-width: 0;
}

/* Tables */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: var(--surface-soft);
    color: var(--muted-strong);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: var(--surface-raised);
}

.cell-actions {
    width: 1%;
    white-space: nowrap;
}

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

.dev-wide-table table {
    min-width: 980px;
}

/* Lists and tags */
.simple-list {
    display: grid;
    gap: 8px;
}

.simple-list--compact {
    gap: 7px;
}

.simple-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    box-shadow: none;
}

.simple-row--flat {
    align-items: center;
}

.tag-list {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-blue);
    color: var(--primary-dark);
    padding: 4px 9px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
}

.tag-list--compact .tag {
    min-height: 24px;
    font-size: 0.78rem;
}

/* Employee slider */
.employee-slider {
    display: grid;
    gap: 12px;
}

.employee-cards {
    position: relative;
    min-height: 320px;
}

.employee-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--surface), var(--surface-raised));
    padding: 16px;
    opacity: 0;
    pointer-events: none;

    transition: opacity 0.24s ease, transform 0.24s ease;
}

.employee-card.is-active {
    opacity: 1;
    pointer-events: auto;

}

.employee-card__top,
.profile-card__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.employee-card__top h3 {
    font-size: 1.18rem;
}

.employee-card__top p {
    margin: 3px 0 0;
    color: var(--muted);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.meta-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-grid div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 9px;
}

.meta-grid dt {
    color: var(--muted);
    font-size: 0.76rem;
}

.meta-grid dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.card-note {
    margin: 12px 0 0;
    color: var(--muted);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 12px;
}

.card-actions .inline-form {
    margin-top: 0;
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.slider-controls span {
    min-width: 72px;
    color: var(--muted);
    text-align: center;
}

/* Cabinet */
.cabinet-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.62fr);
    gap: 14px;
    align-items: start;
}

.cabinet-card {
    padding: 15px;
}

.cabinet-card__top {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.cabinet-avatar,
.profile-avatar {
    width: 62px;
    height: 62px;
    border: 1px solid var(--line-strong);
    border-radius: 17px;
    background: var(--surface-soft);
    object-fit: cover;
}

.cabinet-card__identity {
    min-width: 0;
}

.cabinet-card__identity h2 {
    margin: 1px 0 2px;
    overflow: hidden;
    font-size: 1.14rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-card__identity p {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.cabinet-meta--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cabinet-meta div,
.profile-quick div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-raised);
    padding: 8px 9px;
}

.cabinet-meta span,
.profile-quick span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cabinet-meta strong,
.profile-quick strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-fold {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    overflow: hidden;
}

.profile-fold summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 9px 11px;
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 800;
    list-style: none;
}

.profile-fold summary::-webkit-details-marker {
    display: none;
}

.profile-fold summary::after {
    content: "⌄";
    color: var(--muted);
    transition: transform 0.18s ease;
}

.profile-fold[open] summary::after {
    transform: rotate(180deg);
}

.profile-fold summary small {
    color: var(--muted);
    font-weight: 500;
}

.profile-fold__form {
    border-top: 1px solid var(--line);
    padding: 11px;
}

.avatar-upload-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
}

.avatar-upload-row--compact {
    grid-template-columns: 46px minmax(0, 1fr);
}

.avatar-upload-row__preview {
    width: 52px;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
    object-fit: cover;
}

.avatar-upload-row--compact .avatar-upload-row__preview {
    width: 46px;
    height: 46px;
    border-radius: 12px;
}

.employee-mini-card {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
}

.employee-mini-card strong,
.employee-mini-card small {
    display: block;
}

.cabinet-access-panel {
    max-width: 100%;
}

.access-card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.access-card-list--compact {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.access-card {
    padding: 10px;
    box-shadow: none;
}

.access-card--compact {
    padding: 10px 11px;
}

.access-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.access-card__head strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.access-card__head span {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.access-card p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

/* DEV control */
.inline-control-form {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) auto;
    gap: 7px;
    align-items: center;
    min-width: 210px;
}

.inline-control-form select {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 0.9rem;
}

.user-link-cell {
    min-width: 270px;
}

.user-link-cell strong,
.user-link-cell small {
    display: block;
}

.link-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
}

.dev-control-note {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1180px) {
    .content-grid,
    .content-grid--wide,
    .cabinet-shell {
        grid-template-columns: 1fr;
    }

    .panel--compact {
        position: static;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .main-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        align-items: start;
    }

    .nav-group__label {
        padding-inline: 8px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page {
        padding: 14px;
    }

    .main-nav {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .page-head,
    .hero-card,
    .panel-head,
    .search-form,
    .simple-row {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form input,
    .search-form select {
        min-width: 0;
    }

    .stats-grid,
    .meta-grid,
    .meta-grid--wide,
    .meta-grid--compact,
    .role-grid,
    .form-two,
    .cabinet-meta,
    .cabinet-meta--compact,
    .access-card-list {
        grid-template-columns: 1fr;
    }

    .employee-cards {
        min-height: 450px;
    }

    .cabinet-card__top {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .cabinet-avatar,
    .profile-avatar {
        width: 56px;
        height: 56px;
        border-radius: 15px;
    }

    .badge--role {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .profile-fold summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .avatar-upload-row,
    .avatar-upload-row--compact,
    .inline-control-form {
        grid-template-columns: 1fr;
    }

    .avatar-upload-row__preview,
    .avatar-upload-row--compact .avatar-upload-row__preview {
        width: 64px;
        height: 64px;
    }

    .cell-actions--wrap,
    .button-row,
    .card-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* V11: requests, compact cabinet */
.badge--neutral {
    border-color: var(--line-strong);
    background: var(--surface-raised);
    color: var(--primary-dark);
}

.badge--info {
    border-color: var(--line-strong);
    background: var(--surface-raised);
    color: var(--primary-dark);
}

.badge--danger {
    border-color: var(--error-line);
    background: var(--error-bg);
    color: var(--danger-dark);
}

.badge--success {
    border-color: var(--line-strong);
    background: var(--surface-raised);
    color: var(--primary-dark);
}

.request-page {
    display: grid;
    place-items: start center;
    padding: 8px 0 24px;
}

.request-form-card {
    width: min(680px, 100%);
    padding: 22px;
}

.request-form-card__head {
    margin-bottom: 16px;
}

.request-form-card__head h2 {
    margin: 0 0 6px;
    font-size: 1.35rem;
}

.request-form-card__head p,
.form-help {
    margin: 0;
    color: var(--muted);
}

.stack-form--spacious {
    gap: 14px;
}

.issuance-request-list {
    display: grid;
    gap: 12px;
}

.issuance-request-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 13px;
}

.issuance-request-card__main,
.issuance-request-card__side {
    min-width: 0;
}

.issuance-request-card__title,
.my-request-card__top,
.cabinet-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.issuance-request-card__title strong,
.my-request-card__top strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.issuance-request-card p,
.my-request-card p {
    margin: 9px 0 0;
    color: var(--muted-strong);
}

.request-meta-line {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.84rem;
}

.request-meta-line span:not(:last-child)::after {
    content: "•";
    margin-left: 8px;
    color: var(--line-strong);
}

.mini-dl {
    display: grid;
    gap: 6px;
    margin: 0 0 10px;
}

.mini-dl div {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
}

.mini-dl dt {
    color: var(--muted);
    font-size: 0.78rem;
}

.mini-dl dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
}

.status-form {
    display: grid;
    gap: 8px;
}

.status-form textarea {
    min-height: 62px;
}

.cabinet-compact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 14px;
    align-items: stretch;
}

.cabinet-summary-card {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.cabinet-summary-card__avatar img {
    width: 84px;
    height: 84px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: var(--surface-soft);
    object-fit: cover;
}

.cabinet-summary-card__body,
.cabinet-title-row > div {
    min-width: 0;
}

.cabinet-summary-card h2 {
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.2rem;
}

.cabinet-summary-card p {
    margin: 0;
    color: var(--muted);
}

.cabinet-action-card {
    display: grid;
    align-content: center;
    gap: 8px;
}

.compact-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.compact-meta-grid--employee {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
}

.compact-meta-grid div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-raised);
    padding: 8px 9px;
}

.compact-meta-grid span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.compact-meta-grid strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-edit-details summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 800;
    list-style: none;
}

.profile-edit-details summary::-webkit-details-marker {
    display: none;
}

.profile-edit-form {
    max-width: 560px;
    margin-top: 12px;
}

.checkbox-row--inline {
    display: flex;
}

.mini-access-list,
.my-requests-grid {
    display: grid;
    gap: 8px;
}

.mini-access-row,
.my-request-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 10px;
}

.mini-access-row {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 72px minmax(0, 1.2fr);
    gap: 8px;
    align-items: center;
}

.mini-access-row span,
.mini-access-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .issuance-request-card,
    .cabinet-compact-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-action-card {
        align-content: start;
    }
}

@media (max-width: 720px) {
    .request-form-card {
        padding: 16px;
    }

    .issuance-request-card__title,
    .my-request-card__top,
    .cabinet-title-row {
        flex-direction: column;
    }

    .cabinet-summary-card,
    .compact-meta-grid,
    .compact-meta-grid--employee,
    .mini-access-row {
        grid-template-columns: 1fr;
    }

    .cabinet-summary-card__avatar img {
        width: 72px;
        height: 72px;
        border-radius: 18px;
    }

    .mini-dl div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}


/* Stable details: no page-enter/page-exit animations. */
.fold-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 10px 26px rgba(255, 255, 255, 0.012);
}

.fold-panel + .fold-panel {
    margin-top: 10px;
}

.fold-panel summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-weight: 800;
    user-select: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.fold-panel summary::-webkit-details-marker {
    display: none;
}

.fold-panel summary::after {
    content: "";
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.18s ease;
    opacity: 0.7;
}

.fold-panel[open] summary {
    background: var(--surface-raised);
    color: var(--primary-dark);
}

.fold-panel[open] summary::after {
    transform: rotate(225deg) translate(-2px, -1px);
}

.fold-panel summary span,
.fold-panel summary small {
    min-width: 0;
}

.fold-panel summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fold-panel summary small {
    margin-left: auto;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.fold-panel__body {
    padding: 14px;
    border-top: 1px solid var(--line);
}

.cabinet-v13-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
    gap: 12px;
    align-items: stretch;
}

.cabinet-v13-user-card {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
}

.cabinet-v13-avatar {
    width: 62px;
    height: 62px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: var(--surface-soft);
    object-fit: cover;
}

.cabinet-v13-user-main {
    min-width: 0;
}

.cabinet-v13-user-main h2 {
    margin: 1px 0 2px;
    overflow: hidden;
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-v13-user-main p,
.cabinet-v13-empty {
    margin: 0;
}

.cabinet-v13-employee-card {
    padding: 14px;
}

.panel-head--compact {
    margin-bottom: 10px;
}

.panel-head--compact h2 {
    font-size: 1rem;
}

.cabinet-v13-employee-static,
.cabinet-v13-data-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.cabinet-v13-employee-static div,
.cabinet-v13-data-grid div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-raised);
    padding: 8px 9px;
}

.cabinet-v13-employee-static span,
.cabinet-v13-data-grid dt {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cabinet-v13-employee-static strong,
.cabinet-v13-data-grid dd {
    display: block;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cabinet-v13-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cabinet-v13-actions .button {
    width: auto;
}

.cabinet-v13-folds {
    max-width: 980px;
}

.my-requests-grid--compact .my-request-card {
    padding: 9px 10px;
}

.my-requests-grid--compact .my-request-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 980px) {
    .cabinet-v13-grid,
    .cabinet-v13-employee-static,
    .cabinet-v13-data-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .cabinet-v13-grid,
    .cabinet-v13-user-card,
    .cabinet-v13-employee-static,
    .cabinet-v13-data-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-v13-user-card {
        justify-items: start;
    }

    .fold-panel summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .fold-panel summary::after {
        position: absolute;
        right: 16px;
        margin-top: 5px;
    }

    .fold-panel summary small {
        margin-left: 0;
    }
}


/* V61: consolidated login/auth dark layer */
body:has(.auth-page),
body:has(.login-page) {
    overflow-x: hidden;
    background: var(--bg) !important;
    background-image: none !important;
}

body:has(.auth-page)::before,
body:has(.auth-page)::after,
body:has(.login-page)::before,
body:has(.login-page)::after,
body .auth-page::before,
body .auth-page::after,
body .login-page::before,
body .login-page::after {
    content: none !important;
    display: none !important;
}

body .auth-page,
body .login-page,
body main.auth-page,
body main.login-page {
    position: relative !important;
    z-index: auto !important;
    isolation: auto !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

body .as-body-particles {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    opacity: 1 !important;
    pointer-events: none !important;
}

body .auth-page > *:not(.as-body-particles),
body .login-page > *:not(.as-body-particles) {
    position: relative !important;
    z-index: 1 !important;
}




/* ==========================================================================\n   V11 application shell — one interaction model, no duplicate controls\n   ========================================================================== */
html { background: var(--bg); color-scheme: dark; }
body.az-ui-v11 {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
}
body.az-ui-v11 * { scrollbar-color: #4a4a4a transparent; scrollbar-width: thin; }
body.az-ui-v11 a { color: var(--primary-dark); }
body.az-ui-v11 a:hover { color: #dce1e4; }
body.az-ui-v11 .app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--app-sidebar) minmax(0, 1fr);
    background: var(--bg);
}
body.az-ui-v11 .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    padding: 10px 9px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line);
    box-shadow: none;
}
body.az-ui-v11 .brand {
    min-height: 46px;
    padding: 5px 7px;
    border-radius: 7px;
    transition: background-color .12s ease;
}
body.az-ui-v11 .brand:hover { background: rgba(255,255,255,.035); text-decoration: none; }
body.az-ui-v11 .brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--surface-raised);
}
body.az-ui-v11 .brand-mark img { width: 24px; height: 24px; object-fit: contain; margin: auto; }
body.az-ui-v11 .brand strong { color: var(--text); font-size: 14px; }
body.az-ui-v11 .brand small { color: var(--muted); font-size: 10px; }
body.az-ui-v11 .main-nav {
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 3px 0 12px;
}
body.az-ui-v11 .nav-group { margin: 0 0 8px; gap: 2px; }
body.az-ui-v11 .nav-group__label {
    min-height: 24px;
    width: 100%;
    padding: 4px 7px;
    color: #9aa3aa;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
body.az-ui-v11 .nav-group__label::after { background: var(--line); }
body.az-ui-v11 .nav-group__toggle { background: transparent; border: 0; cursor: pointer; text-align: left; }
body.az-ui-v11 .nav-group__chevron { margin-left: auto; color: #8d969d; transition: none; }
body.az-ui-v11 .nav-group.is-collapsed .nav-group__items { display: none; }
body.az-ui-v11 .nav-group__items { display: grid; gap: 2px; }
body.az-ui-v11 .nav-link {
    position: relative;
    min-height: 35px;
    padding: 0 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #dce0e3;
    background: transparent;
    transition: background-color .11s ease, color .11s ease, border-color .11s ease;
}
body.az-ui-v11 .nav-link__icon { width: 18px; color: #adb5bb; }
body.az-ui-v11 .nav-link:hover { background: rgba(255,255,255,.035); color: var(--text); text-decoration: none; }
body.az-ui-v11 .nav-link.is-active {
    background: #383838;
    border-color: #4a4a4a;
    color: #f4f6f7;
    box-shadow: inset 2px 0 0 #788791;
}
body.az-ui-v11 .nav-link.is-active .nav-link__icon { color: #dce1e4; }
body.az-ui-v11 .app-workspace { min-width: 0; min-height: 100vh; background: var(--bg); }
body.az-ui-v11 .app-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--app-topbar);
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}
body.az-ui-v11 .app-topbar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.az-ui-v11 .app-topbar__menu,
body.az-ui-v11 .topbar-icon-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--muted-strong);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
body.az-ui-v11 .app-topbar__menu:hover,
body.az-ui-v11 .topbar-icon-button:hover,
body.az-ui-v11 .topbar-icon-button.is-active {
    background: var(--surface-raised);
    border-color: var(--line-strong);
    color: var(--text);
    text-decoration: none;
}
body.az-ui-v11 .app-topbar__title { min-width: 0; display: grid; gap: 1px; }
body.az-ui-v11 .app-topbar__title small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body.az-ui-v11 .app-topbar__title strong { color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.az-ui-v11 .app-topbar__actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
body.az-ui-v11 .topbar-icon-button { position: relative; }
body.az-ui-v11 .app-topbar__badge {
    position: absolute;
    right: -4px;
    top: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border: 2px solid var(--topbar-bg);
    border-radius: 9px;
    background: #66737a;
    color: #f5f6f7;
    font-size: 9px;
    line-height: 1;
}
body.az-ui-v11 .account-menu { position: relative; }
body.az-ui-v11 .account-menu > summary { list-style: none; }
body.az-ui-v11 .account-menu > summary::-webkit-details-marker { display: none; }
body.az-ui-v11 .account-menu__trigger {
    min-height: 36px;
    max-width: 205px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px 3px 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: background-color .12s ease, border-color .12s ease;
}
body.az-ui-v11 .account-menu__trigger:hover,
body.az-ui-v11 .account-menu[open] .account-menu__trigger,
body.az-ui-v11 .account-menu.is-active .account-menu__trigger { background: var(--surface-raised); border-color: var(--line-strong); }
body.az-ui-v11 .app-topbar__avatar {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: #353535;
}
body.az-ui-v11 .app-topbar__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body.az-ui-v11 .app-topbar__avatar b { font-size: 10px; color: var(--text-soft); }
body.az-ui-v11 .app-topbar__user-copy { min-width: 0; display: grid; line-height: 1.05; }
body.az-ui-v11 .app-topbar__user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 11px; }
body.az-ui-v11 .app-topbar__user-copy small { color: var(--muted); font-size: 8px; margin-top: 2px; }
body.az-ui-v11 .account-menu__chevron { width: 13px; color: #8f989f; }
body.az-ui-v11 .account-menu__dropdown {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 80;
    width: 196px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #2a2a2a;
    box-shadow: 0 16px 38px rgba(0,0,0,.34);
}
body.az-ui-v11 .account-menu__dropdown a,
body.az-ui-v11 .account-menu__dropdown button {
    width: 100%;
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 9px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
}
body.az-ui-v11 .account-menu__dropdown a:hover,
body.az-ui-v11 .account-menu__dropdown button:hover { background: rgba(255,255,255,.055); color: #f4f5f6; }
body.az-ui-v11 .account-menu__dropdown form { margin: 2px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
body.az-ui-v11 .page {
    width: min(100%, var(--page-max));
    min-width: 0;
    min-height: calc(100vh - var(--app-topbar));
    margin: 0 auto;
    padding: 16px 18px 26px;
    background: transparent;
}
body.az-ui-v11 .footer { margin-top: auto; padding: 16px 0 2px; color: #8d959b; font-size: 10px; text-align: center; }

/* Shared surfaces and controls */
body.az-ui-v11 input:not([type=checkbox]):not([type=radio]),
body.az-ui-v11 select,
body.az-ui-v11 textarea {
    background: var(--field);
    color: var(--text);
    border-color: #3a4248;
    border-radius: 6px;
    box-shadow: none;
}
body.az-ui-v11 input::placeholder,
body.az-ui-v11 textarea::placeholder { color: #7f888f; }
body.az-ui-v11 input:focus,
body.az-ui-v11 select:focus,
body.az-ui-v11 textarea:focus { border-color: #697980; box-shadow: 0 0 0 2px rgba(119,134,143,.07); }
body.az-ui-v11 .button {
    min-height: 34px;
    border-radius: 6px;
    box-shadow: none;
    transform: none !important;
    transition: background-color .11s ease, border-color .11s ease, color .11s ease;
}
body.az-ui-v11 .button--primary { background: #59656b; border-color: #68747a; color: #f5f6f7; }
body.az-ui-v11 .button--primary:hover { background: #646f75; border-color: #737f85; }
body.az-ui-v11 .button--secondary,
body.az-ui-v11 .button--ghost { background: #282828; border-color: #404040; color: #dde1e4; }
body.az-ui-v11 .button--secondary:hover,
body.az-ui-v11 .button--ghost:hover { background: #2c3135; border-color: #515b61; color: #f4f5f6; }
body.az-ui-v11 .panel,
body.az-ui-v11 .hero-card,
body.az-ui-v11 .stat-card,
body.az-ui-v11 .empty-state,
body.az-ui-v11 .role-card,
body.az-ui-v11 .access-card,
body.az-ui-v11 .simple-row,
body.az-ui-v11 .employee-mini-card { box-shadow: none; }
body.az-ui-v11 .page-head { background: var(--surface); border-color: var(--line); border-radius: 8px; box-shadow: none; }
body.az-ui-v11 .eyebrow { color: #a3a7a9; }
body.az-ui-v11 .badge,
body.az-ui-v11 .tag { background: #292929; border-color: #414141; color: #d2d7da; }
body.az-ui-v11 table { border-color: var(--line); }
body.az-ui-v11 th { background: #292929; color: #cdd3d7; border-color: var(--line); }
body.az-ui-v11 td { border-color: #323232; }
body.az-ui-v11 tbody tr:hover td { background: rgba(255,255,255,.018); }
body.az-ui-v11 details > summary { transition: background-color .1s ease, border-color .1s ease, color .1s ease; }
body.az-ui-v11 a,
body.az-ui-v11 button,
body.az-ui-v11 [role=button] { transform: none !important; }

/* Notification toast only; the duplicate floating bell is removed. */
body.az-ui-v11 .notification-bell-toast {
    position: fixed;
    top: 66px;
    right: 14px;
    z-index: 90;
    width: min(340px, calc(100vw - 28px));
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #2a2a2a;
    box-shadow: 0 18px 44px rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
}
body.az-ui-v11 .notification-bell-toast.is-visible { opacity: 1; pointer-events: auto; }
body.az-ui-v11 .notification-bell-toast.is-hiding { opacity: 0; }
body.az-ui-v11 .notification-bell-toast__link { flex: 1; display: flex; align-items: center; gap: 10px; padding: 11px 12px; color: var(--text); text-decoration: none; }
body.az-ui-v11 .notification-bell-toast__icon { color: var(--primary-dark); }
body.az-ui-v11 .notification-bell-toast__body { display: grid; gap: 2px; }
body.az-ui-v11 .notification-bell-toast__body strong { font-size: 12px; }
body.az-ui-v11 .notification-bell-toast__body small { font-size: 10px; color: var(--muted); }
body.az-ui-v11 .notification-bell-toast__close { width: 34px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }

/* Compact icon rail */
html.az-sidebar-compact body.az-ui-v11 .app-shell { grid-template-columns: var(--app-sidebar-compact) minmax(0,1fr); }
html.az-sidebar-compact body.az-ui-v11 .sidebar { padding-inline: 7px; }
html.az-sidebar-compact body.az-ui-v11 .brand > span:last-child,
html.az-sidebar-compact body.az-ui-v11 .testing-mode-switch span,
html.az-sidebar-compact body.az-ui-v11 .nav-group__label,
html.az-sidebar-compact body.az-ui-v11 .nav-link__text { display: none; }
html.az-sidebar-compact body.az-ui-v11 .brand,
html.az-sidebar-compact body.az-ui-v11 .nav-link,
html.az-sidebar-compact body.az-ui-v11 .testing-mode-switch { justify-content: center; padding-inline: 0; }
html.az-sidebar-compact body.az-ui-v11 .nav-group { margin-bottom: 4px; }
html.az-sidebar-compact body.az-ui-v11 .nav-link { width: 40px; margin-inline: auto; }
html.az-sidebar-compact body.az-ui-v11 .testing-mode-switch { width: 40px; margin-inline: auto; }

@media (max-width: 1050px) {
    body.az-ui-v11 .page { padding: 14px; }
    body.az-ui-v11 .app-topbar__user-copy { display: none; }
    body.az-ui-v11 .account-menu__trigger { padding-right: 5px; }
    body.az-ui-v11 .account-menu__chevron { display: none; }
}
@media (max-width: 760px) {
    body.az-ui-v11 .app-shell { grid-template-columns: 1fr; }
    body.az-ui-v11 .sidebar { position: relative; width: 100%; height: auto; max-height: none; }
    body.az-ui-v11 .page { padding: 10px; }
}


/* ==========================================================================
   V13 balanced graphite — readable typography, neutral surfaces, quiet accent
   ========================================================================== */
body.az-ui-v11,
body.az-ui-v11 .app-workspace {
    background: var(--bg);
    color: var(--text);
}
body.az-ui-v11 .sidebar {
    background: var(--sidebar-bg);
    border-right-color: #383d41;
}
body.az-ui-v11 .app-topbar {
    background: var(--topbar-bg);
    border-bottom-color: #34393d;
}
body.az-ui-v11 .page { background: transparent; }

/* Make hierarchy come from luminance, not blue fills. */
body.az-ui-v11 .panel,
body.az-ui-v11 .hero-card,
body.az-ui-v11 .stat-card,
body.az-ui-v11 .empty-state,
body.az-ui-v11 .role-card,
body.az-ui-v11 .access-card,
body.az-ui-v11 .simple-row,
body.az-ui-v11 .employee-mini-card,
body.az-ui-v11 .page-head {
    background: var(--surface);
    border-color: var(--line);
}
body.az-ui-v11 .surface-soft,
body.az-ui-v11 .card,
body.az-ui-v11 .list-row {
    background: var(--surface-soft);
    border-color: #383e42;
}

/* Navigation: white text, subtle graphite selection, only a thin steel accent. */
body.az-ui-v11 .nav-group__label { color: #a3abb1; }
body.az-ui-v11 .nav-group__chevron { color: #8f989f; }
body.az-ui-v11 .nav-link { color: #dce1e4; }
body.az-ui-v11 .nav-link__icon { color: #aeb6bc; }
body.az-ui-v11 .nav-link:hover {
    background: #303438;
    color: #f6f7f8;
}
body.az-ui-v11 .nav-link.is-active {
    background: #34393d;
    border-color: #495158;
    color: #ffffff;
    box-shadow: inset 2px 0 0 #6f91a5;
}
body.az-ui-v11 .nav-link.is-active .nav-link__icon { color: #c8d7df; }
body.az-ui-v11 .testing-mode-switch {
    background: #303437;
    border-color: #41474b;
}
body.az-ui-v11 .testing-mode-switch:hover {
    background: #363a3e;
    border-color: #50575c;
}

/* Topbar and profile controls stay neutral. */
body.az-ui-v11 .app-topbar__menu,
body.az-ui-v11 .topbar-icon-button,
body.az-ui-v11 .account-menu__trigger {
    background: #282c2f;
    border-color: #3a4044;
    color: #cbd1d5;
}
body.az-ui-v11 .app-topbar__menu:hover,
body.az-ui-v11 .topbar-icon-button:hover,
body.az-ui-v11 .topbar-icon-button.is-active,
body.az-ui-v11 .account-menu__trigger:hover,
body.az-ui-v11 .account-menu[open] .account-menu__trigger {
    background: #30353a;
    border-color: #4a5258;
    color: #ffffff;
}
body.az-ui-v11 .account-menu__dropdown {
    background: #24282b;
    border-color: #3f464b;
}
body.az-ui-v11 .account-menu__dropdown a,
body.az-ui-v11 .account-menu__dropdown button { color: #d3d8dc; }
body.az-ui-v11 .account-menu__dropdown a:hover,
body.az-ui-v11 .account-menu__dropdown button:hover {
    background: #30353a;
    color: #ffffff;
}

/* Forms: actual form text is bright; only placeholders are muted. */
body.az-ui-v11 input:not([type=checkbox]):not([type=radio]),
body.az-ui-v11 select,
body.az-ui-v11 textarea {
    background: var(--field);
    border-color: #3a4248;
    color: #f1f3f4;
}
body.az-ui-v11 input::placeholder,
body.az-ui-v11 textarea::placeholder { color: #7f8990; opacity: 1; }
body.az-ui-v11 input:focus,
body.az-ui-v11 select:focus,
body.az-ui-v11 textarea:focus {
    border-color: #637d8d;
    box-shadow: 0 0 0 2px rgba(85,120,141,.11);
}

/* Buttons: no gray-on-gray labels. */
body.az-ui-v11 .button { color: #eef1f3; }
body.az-ui-v11 .button--primary {
    background: #40515b;
    border-color: #536975;
    color: #ffffff;
}
body.az-ui-v11 .button--primary:hover {
    background: #4a5d68;
    border-color: #67808e;
    color: #ffffff;
}
body.az-ui-v11 .button--secondary,
body.az-ui-v11 .button--ghost {
    background: #282c2f;
    border-color: #3e454a;
    color: #e2e6e8;
}
body.az-ui-v11 .button--secondary:hover,
body.az-ui-v11 .button--ghost:hover {
    background: #30353a;
    border-color: #50585e;
    color: #ffffff;
}

/* Tables and labels: body copy remains readable; muted is reserved for metadata. */
body.az-ui-v11 .badge,
body.az-ui-v11 .tag {
    background: #292d30;
    border-color: #3d4449;
    color: #dce1e4;
}
body.az-ui-v11 table { border-color: var(--line); }
body.az-ui-v11 th {
    background: #272b2e;
    border-color: #3a4044;
    color: #d5dade;
}
body.az-ui-v11 td {
    border-color: #30363a;
    color: #edf0f2;
}
body.az-ui-v11 tbody tr:hover td { background: rgba(255,255,255,.025); }

/* Dashboard: keep large areas near-charcoal, not washed gray. */
body.page-dashboard .dashboard-v53-hero,
body.page-dashboard .dashboard-v53-panel,
body.page-dashboard .dashboard-v53-stats > article {
    background: #1d2022;
    border-color: #343a3e;
}
body.page-dashboard .dashboard-v53-user-row,
body.page-dashboard .dashboard-v53-access-row,
body.page-dashboard .dashboard-v53-activity-row,
body.page-dashboard .dashboard-v53-employee-row,
body.page-dashboard .dashboard-v53-general-activity-row,
body.page-dashboard .dashboard-v53-support-row,
body.page-dashboard .dashboard-v53-support-card__summary > div {
    background: #24282b;
    border-color: #383f43;
}

/* Explicit text hierarchy for recurring utility classes. */
body.az-ui-v11 .muted,
body.az-ui-v11 .text-muted,
body.az-ui-v11 small.muted { color: var(--muted) !important; }
body.az-ui-v11 .page-title,
body.az-ui-v11 h1,
body.az-ui-v11 h2,
body.az-ui-v11 h3,
body.az-ui-v11 h4,
body.az-ui-v11 strong { color: var(--text); }

/* ========================================================================== 
   V14 structural cleanup — dense sidebar and Graphite Smoke interaction model
   ========================================================================== */
body.az-ui-v11 .main-nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    align-content: flex-start;
    gap: 6px;
}
body.az-ui-v11 .nav-group {
    display: block;
    flex: 0 0 auto;
    margin: 0;
}
body.az-ui-v11 .nav-group__label {
    min-height: 27px;
    padding: 4px 7px;
}
body.az-ui-v11 .nav-group__items {
    display: grid;
    gap: 2px;
    margin-top: 2px;
}
body.az-ui-v11 .nav-group.is-collapsed .nav-group__items { display: none; }
body.az-ui-v11 .nav-group__chevron { transform: rotate(0); transition: transform .10s ease; }
body.az-ui-v11 .nav-group.is-collapsed .nav-group__chevron { transform: rotate(-90deg); }

body.az-ui-v11 .sidebar { background: var(--sidebar-bg); border-right-color: var(--line); }
body.az-ui-v11 .app-topbar { background: var(--topbar-bg); border-bottom-color: var(--line); }
body.az-ui-v11 .nav-group__label { color: #929da4; }
body.az-ui-v11 .nav-link { color: var(--text-soft); }
body.az-ui-v11 .nav-link__icon { color: var(--muted-strong); }
body.az-ui-v11 .nav-link:hover { background: #292e31; color: var(--text); }
body.az-ui-v11 .nav-link.is-active {
    background: #2b3033;
    border-color: #394146;
    color: var(--text);
    box-shadow: inset 2px 0 0 var(--accent);
}
body.az-ui-v11 .nav-link.is-active .nav-link__icon { color: var(--accent-bright); }

body.az-ui-v11 .app-topbar__menu,
body.az-ui-v11 .topbar-icon-button,
body.az-ui-v11 .account-menu__trigger {
    background: #202428;
    border-color: #30373b;
    color: var(--text-soft);
}
body.az-ui-v11 .app-topbar__menu:hover,
body.az-ui-v11 .topbar-icon-button:hover,
body.az-ui-v11 .topbar-icon-button.is-active,
body.az-ui-v11 .account-menu__trigger:hover,
body.az-ui-v11 .account-menu[open] .account-menu__trigger {
    background: #282d30;
    border-color: #3d464b;
    color: var(--text);
}
body.az-ui-v11 .account-menu__dropdown { background: #1e2225; border-color: #343b40; }
body.az-ui-v11 .account-menu__dropdown a:hover,
body.az-ui-v11 .account-menu__dropdown button:hover { background: #292e31; color: var(--text); }
body.az-ui-v11 .notification-bell-toast { background: #1e2225; border-color: #343b40; }

body.az-ui-v11 input:not([type=checkbox]):not([type=radio]),
body.az-ui-v11 select,
body.az-ui-v11 textarea {
    background: var(--field);
    border-color: #3a4248;
    color: var(--text);
}
body.az-ui-v11 input:focus,
body.az-ui-v11 select:focus,
body.az-ui-v11 textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}
body.az-ui-v11 .button--primary { background: #354047; border-color: #48565d; color: var(--text); }
body.az-ui-v11 .button--primary:hover { background: #3d4a51; border-color: #596a72; }
body.az-ui-v11 .button--secondary,
body.az-ui-v11 .button--ghost { background: #202427; border-color: #343b3f; color: var(--text-soft); }
body.az-ui-v11 .button--secondary:hover,
body.az-ui-v11 .button--ghost:hover { background: #292e31; border-color: #444d52; color: var(--text); }
body.az-ui-v11 .badge,
body.az-ui-v11 .tag { background: #22272a; border-color: #343b40; color: var(--text-soft); }
body.az-ui-v11 th { background: #202427; border-color: var(--line); color: var(--text-soft); }
body.az-ui-v11 td { border-color: #2b3135; color: #e8ebed; }
body.az-ui-v11 tbody tr:hover td { background: rgba(255,255,255,.018); }

/* Compact mode: removed Testers card means only brand and nav links need centering. */
html.az-sidebar-compact body.az-ui-v11 .brand > span:last-child,
html.az-sidebar-compact body.az-ui-v11 .nav-group__label,
html.az-sidebar-compact body.az-ui-v11 .nav-link__text { display: none; }
html.az-sidebar-compact body.az-ui-v11 .brand,
html.az-sidebar-compact body.az-ui-v11 .nav-link { justify-content: center; padding-inline: 0; }
html.az-sidebar-compact body.az-ui-v11 .nav-group { margin-bottom: 4px; }
html.az-sidebar-compact body.az-ui-v11 .nav-link { width: 40px; margin-inline: auto; }

/* ========================================================================== 
   V15 interaction cleanup — pre-painted nav state + unified transient toasts
   ========================================================================== */

/* Persisted group state is placed on <html> before body paint in layout.php. */
html.az-nav-collapsed-main body.az-ui-v11 [data-nav-group="main"] .nav-group__items,
html.az-nav-collapsed-management body.az-ui-v11 [data-nav-group="management"] .nav-group__items,
html.az-nav-collapsed-content body.az-ui-v11 [data-nav-group="content"] .nav-group__items,
html.az-nav-collapsed-stats body.az-ui-v11 [data-nav-group="stats"] .nav-group__items,
html.az-nav-collapsed-dev body.az-ui-v11 [data-nav-group="dev"] .nav-group__items {
    display: none;
}
html.az-nav-collapsed-main body.az-ui-v11 [data-nav-group="main"] .nav-group__chevron,
html.az-nav-collapsed-management body.az-ui-v11 [data-nav-group="management"] .nav-group__chevron,
html.az-nav-collapsed-content body.az-ui-v11 [data-nav-group="content"] .nav-group__chevron,
html.az-nav-collapsed-stats body.az-ui-v11 [data-nav-group="stats"] .nav-group__chevron,
html.az-nav-collapsed-dev body.az-ui-v11 [data-nav-group="dev"] .nav-group__chevron {
    transform: rotate(-90deg);
}

body.az-ui-v11 .sidebar {
    background: linear-gradient(180deg, #202427 0%, var(--sidebar-bg) 46%, #1b1f22 100%);
}
body.az-ui-v11 .app-topbar {
    background: color-mix(in srgb, var(--topbar-bg) 94%, #20272b 6%);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .22);
}
body.az-ui-v11 .nav-link.is-active {
    background: #272d31;
    border-color: #354047;
    box-shadow: inset 2px 0 0 #7793a0;
}
body.az-ui-v11 .nav-link:hover {
    background: #24292d;
}

/* Server flash messages and client validation share one compact toast surface. */
.app-toast-stack {
    position: fixed;
    top: calc(var(--app-topbar, 56px) + 14px);
    right: 16px;
    z-index: 140;
    width: min(360px, calc(100vw - 32px));
    display: grid;
    gap: 9px;
    pointer-events: none;
}
.app-toast {
    position: relative;
    min-height: 64px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    padding: 10px 9px 10px 11px;
    overflow: hidden;
    border: 1px solid #343b40;
    border-radius: 10px;
    background: rgba(28, 32, 35, .98);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
    opacity: 0;
    transform: translate3d(10px, -4px, 0);
    transition: opacity .18s ease, transform .18s ease, border-color .18s ease;
    pointer-events: auto;
}
.app-toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #728995;
}
.app-toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}
.app-toast.is-hiding {
    opacity: 0;
    transform: translate3d(10px, -3px, 0);
    pointer-events: none;
}
.app-toast__icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #343b40;
    border-radius: 9px;
    background: #23282c;
    color: #b8c6cd;
    font-size: 14px;
}
.app-toast__copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}
.app-toast__copy strong {
    color: #edf0f2;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}
.app-toast__copy small {
    color: #adb6bc;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.app-toast__close {
    width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #7f8990;
    font: inherit;
    font-size: 17px;
    cursor: pointer;
}
.app-toast__close:hover {
    background: #282d31;
    color: #e6eaec;
}
.app-toast--success { border-color: #35443a; }
.app-toast--success::before { background: #78907f; }
.app-toast--success .app-toast__icon { color: #a9c5b0; background: #202822; border-color: #35443a; }
.app-toast--warning { border-color: #4a4031; }
.app-toast--warning::before { background: #9b8669; }
.app-toast--warning .app-toast__icon { color: #cfb68f; background: #28231c; border-color: #4a4031; }
.app-toast--error { border-color: #513b3f; }
.app-toast--error::before { background: #a26970; }
.app-toast--error .app-toast__icon { color: #d9a1a7; background: #2a2022; border-color: #513b3f; }
.app-toast--info::before { background: #728995; }

/* Existing notification-event toast follows the same cadence/visual language. */
body.az-ui-v11 .notification-bell-toast {
    top: calc(var(--app-topbar) + 14px);
    right: 16px;
    border-radius: 10px;
    background: rgba(28, 32, 35, .98);
    border-color: #343b40;
    box-shadow: 0 18px 48px rgba(0,0,0,.34);
}

@media (max-width: 720px) {
    .app-toast-stack {
        top: 12px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

/* Keep unread-event reminder separate from action/error toasts. */
body.az-ui-v11 .notification-bell-toast {
    top: auto;
    right: 16px;
    bottom: 16px;
}


/* ==========================================================================
   V18 regression guards — behaviour stays on the V16 shell\n   ========================================================================== */
body.az-ui-v11 .main-nav {
    display: flex;
    flex-direction: column;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 0;
}
body.az-ui-v11 .nav-group {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    min-height: 0;
}
body.az-ui-v11 .nav-group__items {
    flex: 0 0 auto;
    grid-auto-rows: max-content;
}
body.az-ui-v11 .nav-group.is-collapsed .nav-group__items,
html.az-nav-collapsed-main body.az-ui-v11 [data-nav-group="main"] .nav-group__items,
html.az-nav-collapsed-management body.az-ui-v11 [data-nav-group="management"] .nav-group__items,
html.az-nav-collapsed-content body.az-ui-v11 [data-nav-group="content"] .nav-group__items,
html.az-nav-collapsed-stats body.az-ui-v11 [data-nav-group="stats"] .nav-group__items,
html.az-nav-collapsed-dev body.az-ui-v11 [data-nav-group="dev"] .nav-group__items {
    display: none !important;
}
body.az-ui-v11 .topbar-icon-button[href="/testing"] {
    color: #b7aad0;
}
body.az-ui-v11 .topbar-icon-button[href="/testing"]:hover,
body.az-ui-v11 .topbar-icon-button[href="/testing"].is-active {
    border-color: var(--tone-purple-line);
    background: var(--tone-purple-soft);
    color: #d0c5e3;
}


/* Current UI consistency: form controls stay graphite, not near-black. */
body.az-ui-v11 input:not([type="checkbox"]):not([type="radio"]),
body.az-ui-v11 select,
body.az-ui-v11 textarea {
    background: var(--field);
    border-color: #3a4248;
    color: var(--text);
}
body.az-ui-v11 input:not([type="checkbox"]):not([type="radio"]):hover,
body.az-ui-v11 select:hover,
body.az-ui-v11 textarea:hover {
    border-color: #465159;
}
body.az-ui-v11 input:not([type="checkbox"]):not([type="radio"]):focus,
body.az-ui-v11 select:focus,
body.az-ui-v11 textarea:focus {
    background: #252b2f;
    border-color: #627985;
    box-shadow: 0 0 0 2px rgba(98, 121, 133, .12);
}


/* Current interface polish: neutral icons and predictable foreground contrast. */
body.az-ui-v11 .fa {
    color: #a6afb5 !important;
    opacity: 1 !important;
}
body.az-ui-v11 .fa[aria-hidden="true"],
body.az-ui-v11 button .fa,
body.az-ui-v11 a .fa,
body.az-ui-v11 summary .fa {
    color: #a6afb5 !important;
}
body.az-ui-v11 .app-topbar__menu .fa,
body.az-ui-v11 .topbar-icon-button .fa,
body.az-ui-v11 .nav-link__icon .fa,
body.az-ui-v11 .nav-link > .fa {
    color: #a6afb5 !important;
}


/* CURRENT: sidebar density and chrome balance */
body.az-ui-v11 .sidebar {
    padding: 9px 8px;
    gap: 6px;
}
body.az-ui-v11 .brand {
    min-height: 43px;
    padding: 4px 6px;
}
body.az-ui-v11 .main-nav {
    padding: 2px 0 8px;
}
body.az-ui-v11 .nav-group {
    margin: 0 0 5px;
}
body.az-ui-v11 .nav-group__label {
    min-height: 25px;
    padding: 4px 7px 3px;
    font-size: 10px;
    letter-spacing: .085em;
}
body.az-ui-v11 .nav-group__items {
    gap: 2px;
    margin-top: 1px;
}
body.az-ui-v11 .nav-link {
    min-height: 36px;
    padding: 0 9px;
    font-size: 13px;
    line-height: 1.15;
}
body.az-ui-v11 .app-topbar {
    height: 52px;
    padding-inline: 12px;
}
body.az-ui-v11 .app-topbar__menu,
body.az-ui-v11 .topbar-icon-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
}
body.az-ui-v11 .account-menu__trigger {
    min-height: 34px;
}

/* CURRENT: slightly fuller sidebar without reintroducing oversized spacing. */
body.az-ui-v11 .sidebar {
    padding: 8px 7px;
    gap: 5px;
}
body.az-ui-v11 .brand {
    min-height: 45px;
    padding: 4px 7px;
}
body.az-ui-v11 .main-nav {
    padding: 1px 0 6px;
}
body.az-ui-v11 .nav-group {
    margin: 0 0 7px;
}
body.az-ui-v11 .nav-group__label {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 10.5px;
    line-height: 1.1;
}
body.az-ui-v11 .nav-group__items {
    gap: 2px;
    margin-top: 2px;
}
body.az-ui-v11 .nav-link {
    min-height: 38px;
    padding: 0 9px;
    font-size: 13.4px;
    line-height: 1.18;
}
body.az-ui-v11 .nav-link__icon {
    width: 19px;
    height: 19px;
}

/* Smooth internal navigation. The shell stays in place while the current page is swapped.
   The old and new views are never rendered at the same time to avoid ghost duplicates. */

html.az-pjax-loading {
    cursor: progress;
}

html.az-pjax-loading [data-page-view] {
    pointer-events: none;
}

body.az-ui-v11 .app-topbar::after,
body.testing-body.az-ui-v11 .testing-topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -1px;
    height: 2px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

html.az-pjax-loading body.az-ui-v11 .app-topbar::after,
html.az-pjax-loading body.testing-body.az-ui-v11 .testing-topbar::after {
    opacity: .68;
    animation: az-pjax-progress 720ms ease-in-out infinite;
}

@keyframes az-pjax-progress {
    0% { left: 0; right: 82%; }
    45% { left: 22%; right: 28%; }
    100% { left: 84%; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html.az-pjax-loading body.az-ui-v11 .app-topbar::after,
    html.az-pjax-loading body.testing-body.az-ui-v11 .testing-topbar::after {
        animation: none !important;
    }
}

/* Login screen — compact graphite auth experience. */
body.az-ui-v11.page-login {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
}

body.az-ui-v11.page-login .auth-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 3vw, 36px);
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 18%, rgba(102, 138, 160, .075), transparent 30%),
        radial-gradient(circle at 84% 78%, rgba(120, 155, 131, .045), transparent 27%),
        var(--bg) !important;
}

body.az-ui-v11.page-login .as-body-particles {
    opacity: .48 !important;
    filter: grayscale(1) saturate(.15);
}

.login-stage {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    display: grid;
    gap: 14px;
}

.login-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(350px, .92fr);
    min-height: 550px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 28px 82px rgba(0, 0, 0, .34);
}

.login-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.login-intro {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 42px 44px 38px;
    border-right: 1px solid var(--line-soft);
    background:
        linear-gradient(145deg, rgba(102, 138, 160, .085), transparent 43%),
        var(--surface);
}

.login-intro::after {
    content: '';
    position: absolute;
    right: 34px;
    bottom: 34px;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(255, 255, 255, .025);
    border-radius: 50%;
    box-shadow:
        0 0 0 36px rgba(255, 255, 255, .012),
        0 0 0 72px rgba(255, 255, 255, .008);
    pointer-events: none;
}

.login-brand {
    position: relative;
    z-index: 1;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text) !important;
    text-decoration: none !important;
}

.login-brand__mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface-raised);
}

.login-brand__mark img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.login-brand__copy {
    display: grid;
    gap: 0;
    line-height: 1.05;
}

.login-brand__copy strong {
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.login-brand__copy small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.login-intro__content {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    margin: auto 0 34px;
}

.login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted-strong);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.login-eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--line-strong);
}

.login-intro__content h1 {
    max-width: 520px;
    margin: 14px 0 14px;
    color: var(--text);
    font-size: clamp(32px, 4vw, 46px);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.login-intro__content p {
    max-width: 465px;
    margin: 0;
    color: var(--text-soft);
    font-size: 14.5px;
    line-height: 1.65;
}

.login-capabilities {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.login-capability {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: rgba(32, 36, 40, .66);
}

.login-capability__icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--icon-neutral);
}

.login-capability__icon .fa {
    width: 14px;
    height: 14px;
}

.login-capability > span:last-child {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.login-capability strong {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 11.5px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-capability small {
    overflow: hidden;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-auth {
    min-width: 0;
    display: grid;
    align-items: center;
    padding: 46px 42px;
    background: var(--bg-strong);
}

.login-auth__inner {
    width: min(360px, 100%);
    margin: 0 auto;
}

.login-auth__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--surface-soft);
}

.login-auth__icon svg {
    width: 24px;
    height: 24px;
    fill: var(--icon-neutral);
}

.login-auth__heading {
    margin-bottom: 25px;
}

.login-auth__heading h2 {
    margin: 9px 0 8px;
    color: var(--text);
    font-size: 26px;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.login-auth__heading p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.6;
}

.login-warning {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -6px 0 16px;
    padding: 10px 11px;
    border: 1px solid var(--warning-line);
    border-radius: 9px;
    background: var(--warning-soft);
    color: var(--text-soft);
    font-size: 12px;
}

.login-discord-button {
    width: 100%;
    min-height: 46px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 11px;
    padding: 0 15px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-raised);
    color: var(--text) !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .13);
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.login-discord-button:hover {
    transform: translateY(-1px);
    border-color: #4a545a;
    background: var(--surface-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

.login-discord-button:active {
    transform: translateY(0);
}

.login-discord-button:focus-visible {
    outline: 2px solid var(--accent-line);
    outline-offset: 3px;
}

.login-discord-button svg {
    width: 20px;
    height: 20px;
    fill: var(--icon-neutral);
}

.login-discord-button > span {
    min-width: 0;
}

.login-discord-button > .fa {
    width: 13px;
    height: 13px;
    justify-self: end;
}

.login-auth__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 10.5px;
}

.login-auth__meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.login-auth__meta .fa {
    width: 12px;
    height: 12px;
}

.login-dev-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    margin-top: 28px;
    padding-top: 17px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.login-dev-note__badge {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 20px;
    padding: 0 7px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--muted-strong);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
}

.login-footer {
    color: #6f787e;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .025em;
    text-align: center;
}

body.az-ui-v11.page-login .app-toast-stack {
    z-index: 20;
}

@media (max-width: 820px) {
    body.az-ui-v11.page-login .auth-page {
        padding: 16px;
        overflow: auto;
    }

    .login-stage {
        width: min(520px, 100%);
    }

    .login-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .login-intro {
        padding: 28px 28px 24px;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
    }

    .login-intro__content {
        margin: 42px 0 26px;
    }

    .login-intro__content h1 {
        font-size: clamp(30px, 8vw, 40px);
    }

    .login-capabilities {
        grid-template-columns: 1fr;
    }

    .login-capability {
        grid-template-columns: 28px minmax(0, 1fr);
        padding: 8px 9px;
    }

    .login-capability small {
        display: none;
    }

    .login-auth {
        padding: 32px 28px;
    }
}

@media (max-width: 480px) {
    body.az-ui-v11.page-login .auth-page {
        padding: 10px;
    }

    .login-shell {
        border-radius: 16px;
    }

    .login-intro {
        padding: 22px 20px 18px;
    }

    .login-brand__mark {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .login-brand__mark img {
        width: 27px;
        height: 27px;
    }

    .login-intro__content {
        margin: 34px 0 22px;
    }

    .login-intro__content h1 {
        margin-top: 11px;
        font-size: 29px;
    }

    .login-intro__content p {
        font-size: 13px;
    }

    .login-auth {
        padding: 28px 20px 24px;
    }

    .login-auth__icon {
        margin-bottom: 20px;
    }

    .login-auth__heading h2 {
        font-size: 24px;
    }

    .login-auth__meta {
        display: grid;
        gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-discord-button {
        transition: none;
    }

    .login-discord-button:hover {
        transform: none;
    }
}

/* Login particles visibility fix: keep the original login content, remove only large opaque backplates. */
body.az-ui-v11.page-login .as-body-particles {
    opacity: 1 !important;
    filter: none !important;
}

body.az-ui-v11.page-login .login-shell {
    background: transparent !important;
}

body.az-ui-v11.page-login .login-intro {
    background: transparent !important;
}

body.az-ui-v11.page-login .login-auth {
    background: transparent !important;
}

body.az-ui-v11.page-login .login-capability {
    background: transparent !important;
}

/* Login layout repair: preserve the user's reduced markup and keep particles visible. */
body.az-ui-v11.page-login {
    background:
        radial-gradient(circle at 14% 18%, rgba(0, 126, 255, .055), transparent 31%),
        radial-gradient(circle at 84% 78%, rgba(0, 126, 255, .025), transparent 28%),
        var(--bg) !important;
}

body.az-ui-v11.page-login .auth-page {
    padding: clamp(16px, 2.2vw, 26px);
    background: transparent !important;
}

body.az-ui-v11.page-login .as-body-particles {
    z-index: 0 !important;
    opacity: 1 !important;
    filter: none !important;
}

body.az-ui-v11.page-login .as-body-particles__item {
    filter: saturate(1.18) brightness(1.08) drop-shadow(0 8px 20px rgba(0, 126, 255, .22)) !important;
}

body.az-ui-v11.page-login .login-stage {
    z-index: 2;
    width: min(940px, 100%);
    gap: 10px;
}

body.az-ui-v11.page-login .login-shell {
    grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr);
    min-height: 460px;
    background: rgba(17, 19, 21, .20) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .20);
    backdrop-filter: blur(1.5px);
}

body.az-ui-v11.page-login .login-intro {
    padding: 34px 42px 30px;
    background: transparent !important;
}

body.az-ui-v11.page-login .login-intro__content {
    margin: 72px 0 28px;
}

body.az-ui-v11.page-login .login-intro__content h1 {
    max-width: 430px;
    margin: 12px 0 0;
    font-size: clamp(34px, 4vw, 44px);
    line-height: 1.06;
}

body.az-ui-v11.page-login .login-capabilities {
    width: min(330px, 100%);
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: auto;
}

body.az-ui-v11.page-login .login-capability {
    background: rgba(32, 36, 40, .42) !important;
    backdrop-filter: blur(3px);
}

body.az-ui-v11.page-login .login-auth {
    padding: 38px 44px;
    background: rgba(17, 19, 21, .12) !important;
}

body.az-ui-v11.page-login .login-auth__inner {
    width: min(360px, 100%);
}

body.az-ui-v11.page-login .login-auth__icon {
    margin-bottom: 26px;
}

body.az-ui-v11.page-login .login-auth__heading {
    margin-bottom: 22px;
}

body.az-ui-v11.page-login .login-auth__meta:empty,
body.az-ui-v11.page-login .login-dev-note:empty,
body.az-ui-v11.page-login .login-capabilities:empty {
    display: none !important;
}

@media (max-width: 820px) {
    body.az-ui-v11.page-login .login-stage {
        width: min(520px, 100%);
    }

    body.az-ui-v11.page-login .login-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    body.az-ui-v11.page-login .login-intro {
        padding: 28px 28px 24px;
    }

    body.az-ui-v11.page-login .login-intro__content {
        margin: 38px 0 24px;
    }

    body.az-ui-v11.page-login .login-capabilities {
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    body.az-ui-v11.page-login .login-auth {
        padding: 30px 28px;
    }
}

@media (max-width: 480px) {
    body.az-ui-v11.page-login .auth-page {
        padding: 10px;
    }

    body.az-ui-v11.page-login .login-intro {
        padding: 22px 20px 20px;
    }

    body.az-ui-v11.page-login .login-intro__content {
        margin: 30px 0 22px;
    }

    body.az-ui-v11.page-login .login-intro__content h1 {
        font-size: 30px;
    }

    body.az-ui-v11.page-login .login-capabilities {
        grid-template-columns: 1fr;
    }

    body.az-ui-v11.page-login .login-auth {
        padding: 26px 20px 24px;
    }
}
