/**
 * ZERTI admin layer: zerti-layout.css
 * Topbar, sidebar, main content, panels
 * Loaded via assets/css/zerti-admin.css manifest and includes/admin/assets.php.
 * @see docs/DESIGN-SYSTEM.md
 */




.zerti-admin-topbar {
    flex-shrink: 0;
}

.zerti-theme-switch {
    direction: ltr;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--zerti-control-pill-h);
    flex-shrink: 0;
    padding: 4px 8px;
    margin: 0;
    border: 0;
    border-radius: var(--zerti-radius-pill);
    cursor: pointer;
    font: inherit;
    line-height: 1.25;
    color: var(--zerti-docs-text);
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.zerti-theme-switch:hover {
    filter: brightness(1.06);
}

.zerti-theme-switch:focus-visible {
    outline: 2px solid var(--zerti-bs-purple);
    outline-offset: 2px;
}

.zerti-theme-switch:active {
    filter: brightness(0.96);
}

#zertiAdmin .zerti-mobile-menu-trigger {
    position: fixed;
    top: 10px;
    right: 10px;
    left: auto;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    direction: ltr;
}

.zerti-admin-topbar-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 160px;
}

.zerti-admin-topbar-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.zerti-admin-topbar-actions .fa-solid {
    font-size: 14px;
    line-height: 1;
}

/* Global search — collapsed icon pill; expands to 300px on desktop. */
#zertiAdmin .zerti-global-search {
    --zerti-global-search-expanded-w: 300px;
    position: fixed;
    top: 10px;
    left: 10px;
    right: auto;
    z-index: 1055;
    width: var(--zerti-control-pill-h);
    margin: 0;
    box-sizing: border-box;
}

#zertiAdmin .zerti-global-search__toggle {
    display: inline-flex;
    width: var(--zerti-control-pill-h);
    padding-inline: 0;
    justify-content: center;
}

#zertiAdmin .zerti-global-search__body {
    position: relative;
    width: 100%;
}

#zertiAdmin .zerti-global-search--expanded {
    width: var(--zerti-global-search-expanded-w);
}

#zertiAdmin .zerti-global-search--expanded .zerti-global-search__toggle {
    display: none;
}

#zertiAdmin .zerti-global-search--expanded .zerti-global-search__body {
    display: block;
}

#zertiAdmin .zerti-global-search__field {
    cursor: text;
    justify-content: flex-start;
    width: 100%;
}

#zertiAdmin .zerti-global-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--zerti-docs-text);
    font: inherit;
    font-size: inherit;
    line-height: 1.25;
    padding: 0;
    margin: 0;
    outline: none;
    box-shadow: none;
}

#zertiAdmin .zerti-global-search__input::placeholder {
    color: var(--zerti-docs-muted);
    opacity: 0.92;
}

#zertiAdmin .zerti-global-search__input::-webkit-search-cancel-button,
#zertiAdmin .zerti-global-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

#zertiAdmin .zerti-global-search__clear {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: var(--zerti-radius-pill);
    background: color-mix(in srgb, var(--zerti-docs-muted) 18%, transparent);
    color: var(--zerti-docs-muted);
    line-height: 1;
    cursor: pointer;
}

#zertiAdmin .zerti-global-search__clear .fa-solid {
    font-size: 11px;
}

#zertiAdmin .zerti-global-search__clear:hover,
#zertiAdmin .zerti-global-search__clear:focus-visible {
    color: var(--zerti-docs-text);
    background: color-mix(in srgb, var(--zerti-docs-muted) 30%, transparent);
    outline: none;
}

#zertiAdmin .zerti-global-search__field:focus-within {
    filter: brightness(1.06);
    box-shadow: 0 4px 14px rgba(113, 44, 249, 0.35);
    outline: 2px solid var(--zerti-bs-purple);
    outline-offset: 2px;
}

#zertiAdmin .zerti-global-search__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    inset-inline: 0;
    max-height: min(24rem, 55vh);
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--zerti-header-bar-border, var(--zerti-docs-border));
    border-radius: var(--zerti-radius-lg);
    background: color-mix(in srgb, var(--zerti-docs-subtle-bg) 94%, var(--zerti-docs-bg));
    box-shadow: 0 10px 28px color-mix(in srgb, #000 22%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0.35rem 0;
}

#zertiAdmin .zerti-global-search__message {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    color: var(--zerti-docs-muted);
    text-align: center;
}

#zertiAdmin .zerti-global-search__message--loading {
    color: var(--zerti-docs-text);
}

#zertiAdmin .zerti-global-search__group + .zerti-global-search__group {
    border-top: 1px solid color-mix(in srgb, var(--zerti-docs-border) 70%, transparent);
    margin-top: 0.15rem;
    padding-top: 0.15rem;
}

#zertiAdmin .zerti-global-search__group-title {
    margin: 0;
    padding: 0.35rem 0.85rem 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--zerti-docs-muted);
}

#zertiAdmin .zerti-global-search__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#zertiAdmin .zerti-global-search__hit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.08rem;
    width: 100%;
    padding: 0.45rem 0.85rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--zerti-docs-text);
    text-align: inherit;
    cursor: pointer;
    font-family: var(--zerti-font-family);
}

#zertiAdmin .zerti-global-search__hit:hover,
#zertiAdmin .zerti-global-search__hit:focus-visible,
#zertiAdmin .zerti-global-search__hit--active {
    background: color-mix(in srgb, var(--zerti-brand) 12%, transparent);
    outline: none;
}

#zertiAdmin .zerti-global-search__hit-label {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

#zertiAdmin .zerti-global-search__hit-meta {
    font-size: 0.74rem;
    color: var(--zerti-docs-muted);
    line-height: 1.25;
}

#zertiAdmin .zerti-global-search__hit-sub {
    font-size: 0.72rem;
    color: color-mix(in srgb, var(--zerti-docs-muted) 88%, transparent);
    line-height: 1.25;
}

@media (max-width: 991.98px) {
    #zertiAdmin .zerti-global-search--expanded {
        left: 10px;
        right: calc(10px + var(--zerti-control-pill-h));
        width: auto;
    }
}

@media (min-width: 992px) {
    #zertiAdmin .zerti-global-search--expanded {
        width: var(--zerti-global-search-expanded-w);
    }
}

.zerti-admin-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.zerti-admin-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: clamp(2.75rem, 11vh, 3.75rem);
    object-fit: contain;
}

.zerti-admin-tagline-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    line-height: 1.2;
}

.zerti-admin-brand-title {
    margin: 0;
    font-size: 10.5pt;
    font-weight: 700;
    color: var(--zerti-docs-muted);
}

.zerti-admin-brand-subtitle {
    margin: 0;
    font-size: 8.5pt;
    font-weight: 400;
    color: var(--zerti-docs-muted);
    opacity: 0.92;
}

.zerti-admin-brand-edition {
    margin: 0;
    font-size: 7pt;
    font-weight: 400;
    color: var(--zerti-docs-muted);
    opacity: 0.92;
}

.zerti-sidebar-edition-footer {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0.25rem 0.5rem 0;
    text-align: center;
}

#zertiAdmin .zerti-get-pro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.28rem 0.55rem;
    border: 1px solid #ffc107;
    border-radius: 0.375rem;
    background: rgba(255, 193, 7, 0.14);
    color: #ffc107;
    font-size: 7.5pt;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    animation: zerti-nav-pro-label-blink 1.4s ease-in-out infinite;
}

#zertiAdmin .zerti-get-pro-btn:hover,
#zertiAdmin .zerti-get-pro-btn:focus-visible {
    animation: none;
    background: rgba(255, 193, 7, 0.26);
    border-color: #ffca2c;
    color: #ffca2c;
    text-decoration: none;
}

#zertiAdmin .zerti-get-pro-btn__icon {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
}

#zertiAdmin .zerti-get-pro-btn__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#zertiAdmin[data-bs-theme='light'] .zerti-get-pro-btn {
    background: #fff3cd;
    border-color: #ffc107;
    color: #997404;
}

#zertiAdmin[data-bs-theme='light'] .zerti-get-pro-btn:hover,
#zertiAdmin[data-bs-theme='light'] .zerti-get-pro-btn:focus-visible {
    background: #ffe69c;
    border-color: #e0a800;
    color: #664d03;
}

#zertiAdmin .zerti-edition-licensed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.28rem 0.55rem;
    border: 1px solid #28a745;
    border-radius: 0.375rem;
    background: rgba(40, 167, 69, 0.14);
    color: #28a745;
    font-size: 7pt;
    font-weight: 600;
    line-height: 1.2;
    box-sizing: border-box;
    cursor: default;
    pointer-events: none;
    user-select: none;
}

#zertiAdmin .zerti-edition-licensed-badge__icon {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
}

#zertiAdmin .zerti-edition-licensed-badge__label {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

#zertiAdmin[data-bs-theme='light'] .zerti-edition-licensed-badge {
    background: #d1e7dd;
    border-color: #28a745;
    color: #146c43;
}

.zerti-admin-user {
    font-size: 10pt;
    color: #f8f9fa;
}

.zerti-admin-main {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

#zertiAdmin .zerti-admin-main.zerti-body {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.zerti-body {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    min-width: 0;
}

/* RTL flex row: lower order at main-start (physical right). Desktop: sidebar fixed full viewport height. */
@media (min-width: 992px) {
    #zertiAdmin .zerti-body {
        flex-direction: row;
        align-items: stretch;
    }

    #zertiAdmin .zerti-body > .zerti-sidebar {
        order: 1;
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        width: 260px;
        max-width: 260px;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        z-index: 1020;
        flex: none;
        align-self: stretch;
        min-height: 100vh;
        min-height: 100dvh;
        box-sizing: border-box;
        overflow: hidden;
    }

    /*
     * flex-basis 0% + min-width 0 lets the main column consume all space between shell edge and
     * sidebar (avoids "shrink to content" + empty strip on some WP + RTL/LTR combinations).
     */
    #zertiAdmin .zerti-body > .zerti-main-content {
        order: 2;
        flex: 1 1 0%;
        min-width: 0;
        max-width: none;
        /* Reserve space for fixed sidebar on the physical right; keep horizontal gutter. */
        padding-right: calc(260px + 1rem);
        box-sizing: border-box;
    }
}

.zerti-sidebar {
    width: 260px;
    border-left: 1px solid var(--zerti-docs-border);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar {
    background: rgba(43, 48, 53, 0.92);
}

#zertiAdmin[data-bs-theme='light'] .zerti-sidebar {
    background: rgba(248, 249, 250, 0.93);
}

.zerti-sidebar-inner {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.zerti-sidebar-inner > .zerti-sidebar-actions {
    margin-top: auto;
}

.zerti-sidebar-branding {
    flex: 0 0 auto;
    padding-inline: 0.35rem;
}

.zerti-sidebar-branding .zerti-admin-branding {
    width: 100%;
}

/* Scrollable nav block (logo + user badge stay fixed above/below). */
.zerti-sidebar-nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--zerti-docs-muted) 55%, transparent) transparent;
}

.zerti-sidebar-nav-scroll::-webkit-scrollbar {
    width: 6px;
}

.zerti-sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--zerti-docs-muted) 45%, transparent);
    border-radius: var(--zerti-radius-pill);
}

.zerti-sidebar-nav-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.zerti-sidebar-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: 0;
}

.zerti-sidebar-theme {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.35rem 0.5rem;
}

#zertiAdmin .offcanvas-body > .zerti-sidebar-theme {
    margin-top: auto;
    padding-inline: 0.75rem;
}

/* Space first nav item below the branding border (avoid Bootstrap pt-0 !important on p-3). */
#zertiAdmin .zerti-admin-nav-pills {
    padding-top: 12px;
    padding-inline: 0.2rem;
    padding-bottom: 1rem;
    min-height: 0;
}

#zertiAdmin .offcanvas .zerti-admin-nav-pills {
    padding-top: 14px;
}

.zerti-user-badge {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border: 1px solid var(--zerti-docs-border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--zerti-docs-subtle-bg);
    color: var(--zerti-docs-text);
    line-height: 1.3;
}

.zerti-user-badge strong {
    font-weight: 600;
}

.zerti-user-badge .zerti-user-role {
    display: block;
    margin-top: 0;
    font-size: 0.95em;
    color: var(--zerti-docs-muted);
}

.zerti-user-badge .zerti-user-server-time {
    display: block;
    margin-top: 0;
    color: var(--zerti-docs-muted);
}

#zertiAdmin .zerti-server-clock {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

#zertiAdmin .zerti-server-clock__date {
    order: 1;
}

#zertiAdmin .zerti-server-clock__time {
    order: 2;
    font-variant-numeric: tabular-nums;
}

.zerti-sidebar .nav-link {
    color: var(--zerti-docs-text);
    border-radius: 0.5rem;
    padding: 0.45rem 0.35rem;
    border: 1px solid transparent;
}

#zertiAdmin .zerti-admin-nav-pills a.nav-link,
#zertiAdmin .zerti-admin-nav-pills button.nav-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    line-height: 1.25;
    text-decoration: none;
}

#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-solid,
#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-brands {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    width: 1.25em;
    height: 1.25em;
    margin: 0;
    margin-inline-start: 0.35rem !important;
    font-family: var(--fa-style-family, 'Font Awesome 6 Free');
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
    transform: translateY(-0.07em);
}

#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-solid,
#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-solid::before {
    font-weight: 900;
}

#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-brands,
#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-brands::before {
    font-weight: 400;
}

#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-solid::before,
#zertiAdmin .zerti-admin-nav-pills .nav-link .fa-brands::before {
    display: block;
    line-height: 1;
}

#zertiAdmin .zerti-nav-tab__label,
#zertiAdmin .zerti-admin-nav-pills .nav-link > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge) {
    display: inline-flex;
    align-items: center;
    align-self: center;
    line-height: 1;
}

#zertiAdmin .zerti-nav-tab__label {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Shop tab — processing orders count (inline-start / physical left in RTL). */
#zertiAdmin .zerti-nav-processing-badge {
    margin-inline-start: auto;
    flex-shrink: 0;
    align-self: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    border-radius: 0.3125rem;
    font-size: 0.5625rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: #fff;
    background: #dc2626;
    border: 1px solid #dc2626;
    pointer-events: none;
}

/* Pro-only tabs — yellow crown icon at inline-end (physical left in RTL). */
#zertiAdmin .zerti-nav-pro-badge {
    margin-inline-start: auto;
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.65rem;
    line-height: 1;
    color: #ffc107;
    pointer-events: none;
}

#zertiAdmin .zerti-nav-pro-badge.zerti-nav-pro-badge--license-target {
    pointer-events: auto;
    cursor: pointer;
}

@keyframes zerti-nav-pro-label-blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

#zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge,
#zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge {
    color: #ffc107;
    animation: zerti-nav-pro-label-blink 1.4s ease-in-out infinite;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge,
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge {
    color: #ffd54f;
}

#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge,
#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge {
    color: #e6a800;
}

@media (prefers-reduced-motion: reduce) {
    #zertiAdmin .zerti-get-pro-btn {
        animation: none;
    }

    #zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
    #zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
    #zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
    #zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
    #zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
    #zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
    #zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
    #zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
    #zertiAdmin .zerti-sidebar .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge,
    #zertiAdmin .offcanvas .nav-link:has(.zerti-nav-pro-badge) .zerti-nav-pro-badge {
        animation: none;
    }
}

#zertiAdmin .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin .zerti-sidebar .nav-link.active .zerti-nav-pro-badge,
#zertiAdmin .offcanvas .nav-link.active .zerti-nav-pro-badge {
    color: #ffcd39;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) > .fa-solid:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) > .fa-brands:not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) .zerti-nav-tab__label,
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link.active:has(.zerti-nav-pro-badge) > span:not(.zerti-nav-processing-badge):not(.zerti-nav-pro-badge),
#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active .zerti-nav-pro-badge,
#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link.active .zerti-nav-pro-badge {
    color: #ffd54f;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active .zerti-nav-processing-badge {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link.active .zerti-nav-processing-badge {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

#zertiAdmin .zerti-admin-nav-pills a.nav-link:hover,
#zertiAdmin .zerti-admin-nav-pills a.nav-link:focus {
    color: inherit;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link:hover {
    color: var(--zerti-docs-text);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--zerti-docs-border);
}

#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link:hover {
    color: var(--zerti-docs-text);
    background: #f1f3f5;
    border-color: #e9ecef;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-sidebar .nav-link.active {
    background: rgba(var(--zerti-brand-rgb), 0.2);
    border-color: rgba(var(--zerti-brand-rgb), 0.45);
    font-weight: 600;
    color: color-mix(in srgb, var(--zerti-brand) 65%, #ffffff);
}

#zertiAdmin[data-bs-theme='light'] .zerti-sidebar .nav-link.active {
    background: rgba(var(--zerti-brand-rgb), 0.12);
    border-color: rgba(var(--zerti-brand-rgb), 0.24);
    font-weight: 600;
    color: var(--zerti-brand-hover);
}

.offcanvas .nav-link {
    color: var(--zerti-docs-text);
    border-radius: 0.5rem;
    padding: 0.45rem 0.35rem;
    border: 1px solid transparent;
}

#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--zerti-docs-border);
}

#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link:hover {
    background: #f1f3f5;
    border-color: #e9ecef;
}

#zertiAdmin[data-bs-theme='dark'] .offcanvas .nav-link.active {
    background: rgba(var(--zerti-brand-rgb), 0.2);
    border-color: rgba(var(--zerti-brand-rgb), 0.45);
    color: color-mix(in srgb, var(--zerti-brand) 65%, #ffffff);
    font-weight: 600;
}

#zertiAdmin[data-bs-theme='light'] .offcanvas .nav-link.active {
    background: rgba(var(--zerti-brand-rgb), 0.12);
    border-color: rgba(var(--zerti-brand-rgb), 0.24);
    color: var(--zerti-brand-hover);
    font-weight: 600;
}

/* Gradient buttons */
#zertiAdmin .btn.btn-primary {
    --bs-btn-color: var(--zerti-color-white-text);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--zerti-color-white-text);
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--zerti-color-white-text);
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: color-mix(in srgb, transparent 35%, var(--zerti-color-white-text));
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: transparent;
    color: var(--zerti-color-white-text);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-image: var(--zerti-btn-primary-gradient);
    background-size: 200% 100%;
    background-position: 0% 50%;
    transition: background-position 0.28s ease, filter 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    font-size: var(--zerti-btn-font-size);
    min-height: var(--zerti-btn-min-height);
    border-radius: var(--zerti-btn-border-radius);
}

#zertiAdmin a.btn.btn-primary {
    color: var(--zerti-color-white-text);
}

#zertiAdmin .btn.btn-primary:hover {
    background-position: 100% 50%;
    filter: brightness(1.07);
    box-shadow: 0 4px 14px var(--zerti-btn-primary-hover-shadow);
}

#zertiAdmin .btn.btn-primary:active,
#zertiAdmin .btn.btn-primary.active {
    filter: brightness(0.94);
}

#zertiAdmin .btn.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem var(--zerti-btn-primary-focus-shadow);
}

#zertiAdmin .btn.btn-outline-secondary {
    --bs-btn-color: var(--zerti-docs-text);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--zerti-docs-text);
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--zerti-docs-text);
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: transparent;
    border: 2px solid transparent;
    background-image:
        linear-gradient(var(--zerti-docs-subtle-bg), var(--zerti-docs-subtle-bg)),
        var(--zerti-btn-outline-border-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
    font-size: var(--zerti-btn-font-size);
    min-height: var(--zerti-btn-min-height);
    border-radius: var(--zerti-btn-border-radius);
}

#zertiAdmin .btn.btn-outline-secondary:hover {
    filter: brightness(1.06);
    box-shadow: 0 2px 12px var(--zerti-btn-outline-hover-shadow);
}

#zertiAdmin .btn.btn-outline-secondary:active {
    filter: brightness(0.96);
}

#zertiAdmin .btn.btn-outline-secondary:focus-visible {
    box-shadow: 0 0 0 0.2rem var(--zerti-btn-outline-focus-shadow);
}

#zertiAdmin[data-bs-theme='dark'] #zertiSidebar .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Pill chrome shared by mobile menu, global search toggle, and search field. */
#zertiAdmin .zerti-mobile-menu-trigger .zerti-mobile-menu-btn,
#zertiAdmin .zerti-global-search__toggle,
#zertiAdmin .zerti-global-search__field {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: var(--zerti-control-pill-h);
    flex-shrink: 0;
    padding: 4px 8px;
    margin: 0;
    border-radius: var(--zerti-radius-pill);
    border: 2px solid transparent;
    cursor: pointer;
    font: inherit;
    line-height: 1.25;
    color: var(--zerti-docs-text);
    background-color: transparent;
    background-image:
        linear-gradient(var(--zerti-docs-subtle-bg), var(--zerti-docs-subtle-bg)),
        linear-gradient(135deg, #712cf9 0%, #339af0 55%, #20c997 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 2px 8px rgba(113, 44, 249, 0.22);
    box-sizing: border-box;
    text-decoration: none;
    -webkit-appearance: none;
    appearance: none;
}

#zertiAdmin .zerti-mobile-menu-trigger .zerti-mobile-menu-btn {
    width: var(--zerti-control-pill-h);
    min-width: 0;
    padding-inline: 0;
    justify-content: center;
}

#zertiAdmin .zerti-mobile-menu-trigger .zerti-mobile-menu-btn:hover,
#zertiAdmin .zerti-global-search__toggle:hover,
#zertiAdmin .zerti-global-search__field:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 14px rgba(113, 44, 249, 0.35);
}

#zertiAdmin .zerti-mobile-menu-trigger .zerti-mobile-menu-btn:focus-visible,
#zertiAdmin .zerti-global-search__toggle:focus-visible {
    outline: 2px solid var(--zerti-bs-purple);
    outline-offset: 2px;
}

#zertiAdmin .zerti-mobile-menu-trigger .zerti-mobile-menu-btn:active,
#zertiAdmin .zerti-global-search__toggle:active {
    filter: brightness(0.96);
}

.zerti-theme-switch-ico {
    flex: 0 0 auto;
    width: 14px;
    font-size: 12px;
    line-height: 1;
    text-align: center;
    color: var(--zerti-docs-muted);
}

.zerti-theme-switch-track {
    position: relative;
    width: 38px;
    height: 20px;
    border-radius: 10px;
    flex: 0 0 auto;
    background-image: linear-gradient(135deg, rgba(88, 35, 194, 0.45) 0%, rgba(34, 139, 230, 0.35) 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

#zertiAdmin[data-bs-theme='dark'] .zerti-theme-switch-track {
    background-image: linear-gradient(135deg, rgba(149, 97, 251, 0.35) 0%, rgba(34, 139, 230, 0.25) 100%);
}

.zerti-theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-image: linear-gradient(145deg, #fff 0%, #e9ecef 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease;
}

#zertiAdmin[data-bs-theme='light'] .zerti-theme-switch-thumb {
    transform: translateX(18px);
}

#zertiAdmin[data-bs-theme='dark'] .zerti-theme-switch .fa-moon {
    color: var(--zerti-docs-text);
}

#zertiAdmin[data-bs-theme='light'] .zerti-theme-switch .fa-sun {
    color: var(--zerti-docs-text);
}

/* Compact theme toggle in sidebar (below nav, above user badge). */
#zertiAdmin .zerti-sidebar-theme .zerti-theme-switch,
#zertiAdmin .zerti-theme-switch--sidebar {
    position: static;
    width: auto;
    min-width: 0;
    height: 28px;
    padding: 2px 6px;
    gap: 4px;
}

#zertiAdmin .zerti-sidebar-theme .zerti-theme-switch-track {
    width: 28px;
    height: 14px;
    border-radius: 7px;
}

#zertiAdmin .zerti-sidebar-theme .zerti-theme-switch-thumb {
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
}

#zertiAdmin[data-bs-theme='light'] .zerti-sidebar-theme .zerti-theme-switch-thumb {
    transform: translateX(14px);
}

#zertiAdmin .zerti-sidebar-theme .zerti-theme-switch-ico {
    width: 11px;
    font-size: 10px;
}

.zerti-actions-row .zerti-action-btn {
    flex: 1 1 0;
    min-width: 0;
}

#zertiAdmin .zerti-sidebar-actions .zerti-actions-row,
#zertiAdmin #zertiSidebar .zerti-actions-row {
    align-items: stretch;
}

#zertiAdmin .zerti-sidebar-actions .zerti-action-btn,
#zertiAdmin #zertiSidebar .zerti-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 2.125rem;
    padding-block: 0.375rem;
    padding-inline: 0.5rem;
    line-height: 1.2;
    box-sizing: border-box;
}

.zerti-sidebar .zerti-sidebar-actions {
    border-top-color: var(--zerti-docs-border) !important;
}

.zerti-sidebar .zerti-admin-brand-title,
.zerti-sidebar .zerti-admin-brand-subtitle,
.zerti-sidebar .zerti-admin-brand-edition,
.offcanvas .zerti-admin-brand-title,
.offcanvas .zerti-admin-brand-subtitle,
.offcanvas .zerti-admin-brand-edition {
    color: var(--zerti-docs-muted);
}

.zerti-sidebar .zerti-admin-logo,
.offcanvas .zerti-admin-logo {
    width: 75%;
    max-width: 75%;
    height: auto;
    max-height: clamp(2.0625rem, 8.25vh, 2.8125rem);
    object-fit: contain;
}

.zerti-sidebar .zerti-admin-branding,
.offcanvas .zerti-admin-branding {
    gap: 8px;
}

/*
 * Main padding: do not use Bootstrap .p-3 here — its padding shorthand uses !important and
 * was resetting our top offset below the fixed theme / menu pills.
 */
#zertiAdmin .zerti-main-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: 100%;
    overflow: hidden;
    background: transparent;
    color: var(--zerti-docs-text);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    padding-top: calc(10px + var(--zerti-control-pill-h, 36px) + 10px - 15px);
}

@media (min-width: 992px) {
    #zertiAdmin .zerti-main-content {
        padding-top: 1rem;
    }
}

/*
 * Main column uses column flex; under #zertiAdmin { direction: rtl } some browsers shrink
 * flex children to content width (gap on the physical "start" side). LTR here fixes width;
 * each panel restores rtl for copy.
 */
#zertiAdmin .zerti-main-content > .container-fluid,
#zertiAdmin .zerti-main-content .zerti-panels {
    direction: ltr;
}

#zertiAdmin .zerti-main-content > .container-fluid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

#zertiAdmin .zerti-main-content .zerti-panels {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Content panels: full width + height, no card chrome (background/border removed so the component fills the area). */
#zertiAdmin .zerti-main-content .zerti-panel {
    display: flex;
    flex-direction: column;
    direction: rtl;
    align-self: stretch;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    flex: 1 1 auto;
    min-height: 0;
    float: none;
    clear: both;
    margin-left: 0;
    margin-right: 0;
    margin-inline: 0;
    box-sizing: border-box;
    position: relative;
    background: transparent;
    border: 0;
    border-radius: var(--zerti-component-panel-radius, 14px);
    overflow: hidden;
    box-shadow: none;
}

#zertiAdmin .zerti-main-content .zerti-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: transparent;
    padding: 1rem 0;
}

.zerti-main-content .card {
    border-radius: 0.75rem;
    border-width: 1px;
    border-style: solid;
}

#zertiAdmin[data-bs-theme='dark'] .zerti-main-content .card {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
}

#zertiAdmin[data-bs-theme='light'] .zerti-main-content .card {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.125rem 0.5rem rgba(33, 37, 41, 0.04);
}

#zertiAdmin .zerti-main-content .card .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: transparent;
    /* Tighter than Bootstrap default card-body padding-x (1rem). */
    padding-left: 0rem;
    padding-right: 0rem;
}

.zerti-main-content .card-title {
    font-weight: 600;
}

.zerti-main-content .card-title,
.zerti-main-content .card-text {
    color: var(--zerti-docs-text);
}

/* Panel heading: centered component name + rule above the slot. */
#zertiAdmin .zerti-panel .zerti-panel-title {
    flex: 0 0 auto;
    text-align: center;
    width: 100%;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--zerti-docs-border);
    font-size: clamp(0.95rem, 1.6vw + 0.45rem, 1.2rem);
}

/* Shared admin notes — toggle under license badge + opposite-edge slide panel. */
#zertiAdmin .zerti-sidebar-notes-toggle-wrap {
    width: 100%;
    box-sizing: border-box;
    padding: 0.15rem 0.5rem 0;
    text-align: center;
}

#zertiAdmin .zerti-notes-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--zerti-docs-border);
    border-radius: 0.375rem;
    background: var(--zerti-docs-subtle-bg);
    color: var(--zerti-docs-text);
    font-family: var(--zerti-font-family);
    font-size: 7.5pt;
    font-weight: 600;
    line-height: 1.25;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#zertiAdmin .zerti-notes-toggle .fa-solid {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1;
}

#zertiAdmin .zerti-notes-toggle__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#zertiAdmin .zerti-notes-toggle:hover,
#zertiAdmin .zerti-notes-toggle:focus-visible,
#zertiAdmin .zerti-notes-toggle.is-active {
    background: color-mix(in srgb, var(--zerti-docs-accent, #0d6efd) 12%, var(--zerti-docs-subtle-bg));
    border-color: color-mix(in srgb, var(--zerti-docs-accent, #0d6efd) 45%, var(--zerti-docs-border));
    color: var(--zerti-docs-text);
    outline: none;
}

#zertiAdmin .zerti-notes-backdrop {
    position: fixed;
    inset: 0;
    /* Above global search (1055) and mobile menu trigger (1060). */
    z-index: 1065;
    background: rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#zertiAdmin.zerti-notes-open .zerti-notes-backdrop {
    opacity: 1;
    pointer-events: auto;
}

#zertiAdmin .zerti-notes-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    /* Opposite the RTL nav sidebar (nav is on the right). */
    left: 0;
    right: auto;
    width: min(320px, 92vw);
    z-index: 1070;
    display: flex;
    flex-direction: column;
    background: var(--zerti-docs-bg, var(--bs-body-bg, #fff));
    color: var(--zerti-docs-text);
    border-inline-end: 1px solid var(--zerti-docs-border);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--zerti-docs-border) 60%, transparent),
        12px 0 28px rgba(15, 23, 42, 0.12);
    font-family: var(--zerti-font-family);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    visibility: hidden;
}

#zertiAdmin.zerti-notes-open .zerti-notes-panel {
    transform: translateX(0);
    visibility: visible;
}

@media (max-width: 991.98px) {
    #zertiAdmin .zerti-notes-panel {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        border-inline-end: none;
        box-shadow: none;
    }
}

/* Keep chrome controls under the open notes panel. */
#zertiAdmin.zerti-notes-open .zerti-global-search,
#zertiAdmin.zerti-notes-open .zerti-mobile-menu-trigger {
    z-index: 1060;
}

#zertiAdmin .zerti-notes-panel__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 0.85rem 0.9rem 1rem;
    box-sizing: border-box;
}

#zertiAdmin .zerti-notes-panel__busy {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 0;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.42);
    box-sizing: border-box;
}

#zertiAdmin[data-bs-theme='light'] .zerti-notes-panel__busy {
    background: rgba(255, 255, 255, 0.45);
}

#zertiAdmin .zerti-notes-panel__busy .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

#zertiAdmin .zerti-notes-panel.is-busy .zerti-notes-panel__inner > :not(.zerti-notes-panel__busy) {
    pointer-events: none;
    user-select: none;
}

#zertiAdmin .zerti-notes-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
}

#zertiAdmin .zerti-notes-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

#zertiAdmin .zerti-notes-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--zerti-docs-muted, inherit);
    cursor: pointer;
}

#zertiAdmin .zerti-notes-panel__close:hover,
#zertiAdmin .zerti-notes-panel__close:focus-visible {
    border-color: var(--zerti-docs-border);
    background: var(--zerti-docs-subtle-bg);
    color: var(--zerti-docs-text);
    outline: none;
}

#zertiAdmin .zerti-notes-panel__composer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--zerti-docs-border);
}

#zertiAdmin .zerti-notes-panel__input {
    resize: vertical;
    min-height: 5.5rem;
    font-family: var(--zerti-font-family);
    font-size: 9pt;
}

#zertiAdmin .zerti-notes-panel__composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

#zertiAdmin .zerti-notes-panel__composer-actions .btn {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0.15rem 0.4rem;
    font-size: 8pt;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 0.25rem;
}

#zertiAdmin .zerti-notes-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

#zertiAdmin .zerti-notes-panel__list {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-inline-end: 0.15rem;
}

#zertiAdmin .zerti-notes-panel__empty {
    margin: 0.25rem 0 0;
    text-align: center;
}

#zertiAdmin .zerti-notes-card {
    border: 1px solid var(--zerti-docs-border);
    border-radius: 0.5rem;
    background: var(--zerti-docs-subtle-bg);
    padding: 0.65rem 0.7rem 0.45rem;
}

#zertiAdmin .zerti-notes-card__text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 9pt;
    line-height: 1.45;
    margin-bottom: 0.45rem;
}

#zertiAdmin .zerti-notes-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    font-size: 8pt;
    color: var(--zerti-docs-muted);
    margin-bottom: 0.15rem;
}

#zertiAdmin .zerti-notes-card__author,
#zertiAdmin .zerti-notes-card__date {
    font-size: 8pt;
}

#zertiAdmin .zerti-notes-card__author {
    font-weight: 600;
    color: var(--zerti-docs-text);
}

#zertiAdmin .zerti-notes-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.1rem;
    margin-inline: -0.15rem;
}

#zertiAdmin .zerti-notes-card__actions .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    padding: 0.2rem 0.35rem;
    line-height: 1;
    font-size: 8pt;
    text-decoration: none;
}
