/* Notification shell (topbar popover) */
body.v3 .notification-popover {
    position: relative;
}
body.v3 .notification-popover__toggle {
    position: relative;
    text-decoration: none;
    color: var(--fg-3);
}
body.v3 .notification-popover__toggle:hover {
    color: var(--fg);
    text-decoration: none;
}
body.v3 .notification-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    padding: 1px 5px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--bg);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    pointer-events: none;
    box-sizing: border-box;
}
body.v3 .notification-popover-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 300;
    width: min(360px, calc(100vw - 24px));
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.v3 .notification-popover-panel [data-notification-hub-target="chrome"] {
    min-width: 0;
    width: 100%;
}
body.v3 .notification-popover-panel[hidden] {
    display: none !important;
}
body.v3 .notification-popover-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
body.v3 .notification-popover-panel__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
}
body.v3 .notification-popover-list {
    max-height: 320px;
    overflow-y: auto;
}
body.v3 .notification-preview-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
body.v3 .notification-preview-item:last-child {
    border-bottom: 0;
}
body.v3 .notification-preview-item:hover {
    background: var(--bg-4);
    text-decoration: none;
    color: inherit;
}
body.v3 .notification-preview-item--unread {
    background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
    box-shadow: inset 3px 0 0 var(--accent);
}
body.v3 .notification-preview-item--unread:hover {
    background: color-mix(in srgb, var(--accent-soft) 50%, var(--bg-4));
}
body.v3 .notification-preview-item__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
body.v3 .notification-preview-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
}
body.v3 .notification-preview-item__text {
    color: var(--fg-2);
    font-size: 12px;
    line-height: 1.4;
}
body.v3 .notification-popover-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    color: var(--fg-3);
    text-align: center;
    font-size: 13px;
}
body.v3 .notification-popover-panel__footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}
body.v3 .notification-popover-panel__view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
body.v3 .notification-popover-panel__view-all:hover {
    color: var(--accent-2);
    text-decoration: none;
}

body.v3 .notification-popover-list .notification-preview-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

body.v3 .notification-popover-list .notification-preview-item__content {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

body.v3 .notification-popover-list .notification-preview-item__body {
    flex: 1 1 auto;
    min-width: 0;
}

body.v3 .notification-popover-list .notification-preview-item__title,
body.v3 .notification-popover-list .notification-preview-item__text {
    overflow-wrap: anywhere;
}

body.v3 .notification-popover-list .notification-preview-item__badges-col {
    flex: 0 0 auto;
    align-self: flex-start;
    max-width: 9rem;
}

body.v3 .notification-popover-list .notification-preview-item__badges-col .notification-item__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

body.v3 .notification-popover-list .notification-preview-item__badges-col .app-badge {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

/* Notification inbox chrome */
body.v3 .notification-inbox-title-icon {
    color: var(--accent);
}

body.v3 .notification-inbox-subtitle-badge {
    margin-inline-start: 4px;
}

body.v3 .notification-inbox-mark-all-form {
    margin: 0;
}

body.v3 .notification-mark-all-read-btn__label {
    display: none;
}

@media (min-width: 992px) {
    body.v3 .notification-mark-all-read-btn__label {
        display: inline;
    }
}

body.v3 .notification-mark-all-read-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* Notification list items */
body.v3 .notification-item {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
body.v3 .notification-item:last-child {
    border-bottom: 0;
}
body.v3 .notification-item.unread {
    background: color-mix(in srgb, var(--accent-soft) 40%, transparent);
    box-shadow: inset 3px 0 0 var(--accent);
}
body.v3 .notification-item__link {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding: 14px 12px 14px 20px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}
body.v3 .notification-item__link:hover {
    background: var(--bg-3);
    text-decoration: none;
    color: inherit;
}
body.v3 .notification-item.unread .notification-item__link:hover {
    background: color-mix(in srgb, var(--accent-soft) 55%, var(--bg-3));
}
body.v3 .notification-item__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
body.v3 .notification-item__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    overflow-wrap: anywhere;
}
body.v3 .notification-item__text {
    color: var(--fg-2);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
body.v3 .notification-item__actions {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
    padding: 10px 16px 10px 0;
}
body.v3 .notification-item__dismiss-form {
    margin: 0;
}
body.v3 .notification-item__severity-badge {
    flex-shrink: 0;
}
body.v3 .app-empty-state p,
body.v3 .notification-popover-empty p {
    margin: 0;
}
body.v3 .notification-unread-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    flex-shrink: 0;
    margin-top: 6px;
}
body.v3 .notification-item__dismiss {
    color: var(--fg-3);
}

body.v3 .notification-item__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex-shrink: 0;
    align-items: center;
}

body.v3 .notification-datetime {
    font-size: 11px;
    color: var(--fg-3);
    line-height: 1.3;
}
body.v3 table.tbl.request-show-table thead th {
    text-align: center;
}

body.v3 .request-show-table__icon-col {
    text-align: center;
}

body.v3 .request-show-table__qty,
body.v3 .request-show-table__fulfilled,
body.v3 .request-show-table__remaining {
    text-align: center;
}

body.v3 .request-show-table__qty {
    font-weight: 600;
}

body.v3 .request-show-table__fulfilled {
    color: var(--success);
}

body.v3 .request-show-table__remaining {
    font-weight: 700;
}

body.v3 .request-show-table__remaining--open {
    color: var(--accent);
}

body.v3 .request-show-table__remaining--done {
    color: var(--success);
}

body.v3 .request-show-table__specs {
    text-align: center;
    vertical-align: middle;
}

body.v3 .request-show-table__specs .app-request-line-chips {
    justify-content: center;
}

body.v3 .request-show-table__lang {
    text-align: center;
    font-size: 13px;
    color: var(--fg-2);
}

body.v3 .request-show-table__mark--warn {
    color: var(--warn);
}

body.v3 .request-show-table__mark--accent {
    color: var(--accent);
}

body.v3 .request-show-table__mark--info {
    color: var(--info);
}

body.v3 .request-show-table__mark--empty {
    color: var(--fg-4);
}

body.v3 .request-show-lines-mobile {
    padding: 12px;
    margin-bottom: 0;
}

body.v3 .request-show-line-mobile__chips {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

body.v3 .request-show-line-mobile__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    text-align: center;
}

body.v3 .request-show-line-mobile__metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

body.v3 .request-show-line-mobile__metric-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--fg-3);
}

body.v3 .request-show-line-mobile__metric-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--fg);
}

body.v3 .request-show-line-mobile__price {
    text-align: end;
}

body.v3 .request-show-line-mobile__val {
    font-weight: 600;
    color: var(--fg);
}

body.v3 .request-show-line-mobile__val--success {
    color: var(--success);
}

body.v3 .request-show-line-mobile__val--accent {
    color: var(--accent);
}

body.v3 .app-qty-line__row--show-meta {
    grid-template-columns: minmax(11rem, 1.35fr) minmax(12rem, 1fr);
    align-items: start;
}
body.v3 .app-qty-line__row--show-meta-stacked {
    grid-template-columns: 1fr;
    gap: 16px;
}
body.v3 .app-qty-line__row--show-meta-stacked .app-qty-line__field--paid .app-qty-line__label--paid-align {
    display: none;
}
body.v3 .app-qty-line__row--show-meta-stacked .app-qty-line__field--paid .app-qty-line__label--paid-section {
    display: block;
}
body.v3 .app-qty-line__row--show-fulfill {
    grid-template-columns: minmax(10rem, 1.5fr) minmax(7.6rem, auto);
}
body.v3 .app-qty-line__field--paid .app-qty-line__label--paid-align {
    visibility: hidden;
    pointer-events: none;
}
body.v3 .app-qty-line__field--paid .app-qty-line__label--paid-section {
    display: none;
}
body.v3 .app-paid-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 38px;
}
body.v3 .app-paid-inline__switch {
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    gap: 0;
    min-height: 0;
    display: inline-flex;
    align-items: center;
}
body.v3 .app-paid-inline__switch .app-form-check-input {
    margin: 0;
    flex-shrink: 0;
}
body.v3 .app-paid-inline__label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.25;
    cursor: pointer;
    white-space: nowrap;
}
body.v3 .app-paid-inline__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-4);
    border: 1px solid var(--border-strong);
    color: var(--fg-3);
}
body.v3
    .app-paid-inline:has(.app-form-check-input:checked)
    .app-paid-inline__icon {
    color: var(--success);
    border-color: rgba(45, 212, 160, 0.35);
    background: var(--success-soft);
}
body.v3 .app-qty-line__field--paid .app-paid-inline__hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--fg-4);
    line-height: 1.35;
}

@container request-show-form (max-width: 34rem) {
    body.v3 .app-qty-line__row--show-meta,
    body.v3 .app-qty-line__row--show-fulfill {
        grid-template-columns: 1fr;
    }
    body.v3 .app-qty-line__field--paid .app-qty-line__label--paid-align {
        display: none;
    }
    body.v3 .app-qty-line__field--paid .app-qty-line__label--paid-section {
        display: block;
    }
}
@media (max-width: 767px) {
    body.v3 .app-qty-line__row--show-meta,
    body.v3 .app-qty-line__row--show-fulfill {
        grid-template-columns: 1fr;
    }
    body.v3 .app-qty-line__field--paid .app-qty-line__label--paid-align {
        display: none;
    }
    body.v3 .app-qty-line__field--paid .app-qty-line__label--paid-section {
        display: block;
    }
}

body.v3 .app-title-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    margin-right: 8px;
    vertical-align: -0.125em;
}

body.v3 .app-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.v3 .app-list-narrow-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 1rem;
}

body.v3 .app-list-table-viewport--wide {
    display: none;
}

@media (min-width: 992px) {
    body.v3 .app-list-narrow-stack {
        display: none;
    }

    body.v3 .app-list-table-viewport--wide {
        display: block;
    }
}

body.v3 .app-card-header.app-card-header--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

body.v3 .app-card-help {
    margin: 0;
    font-size: 13px;
    color: var(--fg-2);
}

body.v3 .app-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

body.v3 .app-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 0 12px;
}

body.v3 .app-input-group .app-form-control {
    flex: 1;
    min-width: 0;
    padding: 9px 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.v3 .app-input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

body.v3 .filter-pills--secondary {
    margin-top: 0.5rem;
}

body.v3 .saved-filters-bar {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-2);
    border-radius: 10px;
    background: var(--bg-2);
}

body.v3 .saved-filters-bar__grid {
    display: grid;
    grid-template-columns: minmax(0, 30%) minmax(0, 1fr);
    gap: 0 16px;
    align-items: start;
}

body.v3 .saved-filters-bar--can-save:not(.saved-filters-bar--has-pills) .saved-filters-bar__grid {
    grid-template-columns: minmax(0, 30%);
}

body.v3 .saved-filters-bar--has-pills:not(.saved-filters-bar--can-save) .saved-filters-bar__grid {
    grid-template-columns: minmax(0, 1fr);
}

body.v3 .saved-filters-bar__save-col {
    min-width: 0;
    padding-right: 16px;
    border-right: 1px solid var(--border-2);
}

body.v3 .saved-filters-bar--has-pills:not(.saved-filters-bar--can-save) .saved-filters-bar__save-col {
    display: none;
}

body.v3 .saved-filters-bar__save-col .saved-filter-save__label {
    display: block;
    margin-bottom: 8px;
}

body.v3 .saved-filters-bar__save {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

body.v3 .saved-filters-bar__pills-col {
    min-width: 0;
}

body.v3 .saved-filters-bar__heading {
    display: block;
    margin-bottom: 8px;
}

body.v3 .saved-filters-bar__pills {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    gap: 6px;
    min-width: 0;
}

body.v3 .filter-pill--saved {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

body.v3 .filter-pill--saved .filter-pill__label {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}

body.v3 .filter-pill--saved .filter-pill__delete {
    display: inline-flex;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body.v3 .filter-pill--saved .filter-pill__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0 4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--fg-3);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s, background 0.12s;
}

body.v3 .filter-pill--saved:hover .filter-pill__remove,
body.v3 .filter-pill--saved:focus-within .filter-pill__remove {
    opacity: 1;
}

body.v3 .filter-pill--saved .filter-pill__remove:hover {
    color: var(--fg);
    background: var(--bg-3);
}

body.v3 .saved-filter-save__label {
    font-size: 11px;
    font-weight: 700;
    color: var(--fg-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

body.v3 .saved-filter-save__input {
    flex: 1 1 auto;
    min-width: 0;
}

body.v3 .saved-filter-save__button {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 900px) {
    body.v3 .saved-filters-bar__grid {
        grid-template-columns: 1fr;
        gap: 12px 0;
    }

    body.v3 .saved-filters-bar__save-col {
        padding-right: 0;
        padding-bottom: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border-2);
    }

    body.v3 .saved-filters-bar__save {
        flex-wrap: wrap;
    }
}

body.v3 .filter-pills-date {
    width: auto;
    min-width: 10rem;
}

body.v3 .app-table-col--actions-sm {
    width: 6rem;
}

body.v3 .app-table-col--actions {
    width: 12rem;
}

body.v3 .app-table-col--actions-md {
    width: 14rem;
}

body.v3 .app-table-cell--strong {
    color: var(--fg);
    font-weight: 500;
}

body.v3 .app-table-cell--muted {
    color: var(--fg-2);
}

body.v3 .app-table-cell--subtle {
    color: var(--fg-3);
}

body.v3 .app-table-cell--nowrap {
    white-space: nowrap;
}

body.v3 .app-table-cell--actions {
    text-align: right;
}

body.v3 .app-inline-offset {
    margin-left: 6px;
}

body.v3 .app-link-plain,
body.v3 .app-link-muted {
    font-weight: 500;
    text-decoration: none;
}

body.v3 .app-link-plain {
    color: var(--fg);
}

body.v3 .app-link-muted {
    color: var(--fg-2);
}

body.v3 .app-muted-empty {
    color: var(--fg-3);
}

body.v3 .app-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.v3 .app-row-actions--center {
    justify-content: center;
    width: 100%;
}

body.v3 .app-row-actions--end {
    justify-content: flex-end;
}

body.v3 .app-action-form {
    display: inline-flex;
    margin: 0;
}

body.v3 .btn-app-icon.btn-app-icon--success {
    color: var(--success);
}

body.v3 .btn-app-icon.btn-app-icon--danger {
    color: var(--danger);
}

body.v3 .app-mobile-card {
    padding: 1rem;
}

body.v3 .app-mobile-card__row,
body.v3 .app-mobile-card__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

body.v3 .app-mobile-card__header {
    justify-content: space-between;
}

body.v3 .app-mobile-card__stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.v3 .app-mobile-card__main {
    flex: 1 1 auto;
    min-width: 0;
}

body.v3 .app-mobile-card__aside {
    flex: 0 0 auto;
}

body.v3 .app-mobile-card__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
    overflow-wrap: anywhere;
}

body.v3 .app-mobile-card__title--compact {
    margin-bottom: 4px;
}

body.v3 .app-mobile-card__meta {
    font-size: 12px;
    color: var(--fg-3);
}

body.v3 .app-mobile-card__meta--body {
    color: var(--fg-2);
    overflow-wrap: anywhere;
}

body.v3 .app-mobile-card__badge-row {
    margin-bottom: 8px;
}

body.v3 .app-mobile-card__facts {
    display: grid;
    grid-template-columns: minmax(7rem, 0.55fr) minmax(0, 1fr);
    gap: 4px 12px;
    margin: 0;
    font-size: 12px;
}

body.v3 .app-mobile-card__facts dt {
    margin: 0;
    font-weight: 400;
    color: var(--fg-3);
}

body.v3 .app-mobile-card__facts dd {
    margin: 0;
    color: var(--fg-2);
}

body.v3 .app-mobile-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 4px;
}

body.v3 .app-mobile-card__actions--aside {
    flex: 0 0 auto;
    padding-top: 0;
}

body.v3 .price-value {
    font-variant-numeric: tabular-nums;
    color: var(--fg-2);
    font-size: 0.875rem;
    white-space: nowrap;
}

body.v3 .price-value--unknown {
    color: var(--fg-4);
}

/* === Price Lookup === */

body.v3 .request-show-prices {
    padding: 18px 20px;
    margin-bottom: 0;
}

body.v3 .price-lookup {
    /* wrapper — no background; sits inside app-surface or app-drawer-section */
}

body.v3 .price-lookup__alert {
    margin-bottom: 10px;
}

body.v3 .price-lookup__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

body.v3 .price-lookup__toolbar-spacer {
    flex: 1 1 auto;
    min-width: 0;
}

body.v3 .price-lookup__actions {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
}

body.v3 .price-lookup__last-refresh {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    line-height: 1;
}

body.v3 .price-lookup__last-refresh-summary {
    font-size: var(--t-meta);
    color: var(--fg-3);
}

body.v3 .price-lookup__last-refresh--success .price-lookup__last-refresh-summary {
    color: var(--fg-2);
}

body.v3 .price-lookup__last-refresh--warning .price-lookup__last-refresh-summary {
    color: var(--warning-fg, var(--fg-2));
}

body.v3 .price-lookup__last-refresh--danger .price-lookup__last-refresh-summary {
    color: var(--danger-fg, var(--fg-2));
}

body.v3 .price-lookup__last-refresh-when {
    font-size: var(--t-meta);
    font-weight: 600;
    color: var(--fg-3);
    white-space: nowrap;
}

body.v3 .price-lookup__refresh-btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Specific printing: label / value pairs */
body.v3 .price-lookup__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

body.v3 .price-lookup:not(.price-lookup--drawer) .price-lookup__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.v3 .price-lookup:not(.price-lookup--drawer) .price-lookup__fields--single {
    grid-template-columns: minmax(0, 13rem);
}

body.v3 .price-lookup__field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.v3 .price-lookup:not(.price-lookup--drawer) .price-lookup__field {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    gap: 6px;
}

body.v3 .price-lookup__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--fg-4);
}

body.v3 .price-lookup__val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
}

body.v3 .price-lookup:not(.price-lookup--drawer) .price-lookup__val {
    font-size: 1.35rem;
}

body.v3 .price-lookup__foil-mark {
    color: var(--accent);
}

body.v3 .price-lookup__content {
    position: relative;
}

body.v3 .price-lookup__content.is-refreshing {
    pointer-events: none;
}

/* Any printing: two-column comparison grid */
body.v3 .price-lookup__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    /* prevent grid tracks from overflowing their container */
    overflow: hidden;
}

body.v3 .price-lookup__loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(2px);
    border-radius: 8px;
}

body.v3 .price-lookup__loading[hidden] {
    display: none;
}

body.v3 .price-lookup__loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 9rem;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-2);
    box-shadow: var(--shadow-sm, 0 8px 24px rgba(0, 0, 0, 0.18));
    text-align: center;
}

body.v3 .price-lookup__loading-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid color-mix(in srgb, var(--fg-4) 35%, transparent);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: price-lookup-spin 0.75s linear infinite;
}

body.v3 .price-lookup__loading-label {
    font-size: var(--t-meta);
    font-weight: 600;
    color: var(--fg-2);
}

@keyframes price-lookup-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 420px) {
    body.v3 .price-lookup__grid {
        grid-template-columns: 1fr;
    }
}

body.v3 .price-lookup__col {
    /* grid items default min-width is auto (content size); override so they clip */
    min-width: 0;
    overflow: hidden;
}

body.v3 .price-lookup__col-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--fg-4);
    margin-bottom: 8px;
}

body.v3 .price-lookup__card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

body.v3 .price-lookup__card:last-child {
    border-bottom: none;
}

body.v3 .price-lookup__card-thumb {
    flex: 0 0 auto;
    width: 32px;
}

body.v3 .price-lookup__card-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

body.v3 .price-lookup__card-set {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--fg-2);
    /* wrap at word boundaries, never mid-word */
    word-break: keep-all;
    overflow-wrap: normal;
}

body.v3 .price-lookup__card-cn {
    font-size: 10px;
    color: var(--fg-4);
    white-space: nowrap;
}

body.v3 .price-lookup__card-lang {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    font-size: 1rem;
    line-height: 1;
}

body.v3 .price-lookup__card-lang--unknown,
body.v3 .app-lang-flag--unknown {
    font-size: 9px;
    font-weight: 700;
    color: var(--fg-4);
    letter-spacing: 0.02em;
}

body.v3 .price-lookup__card-price {
    flex: 0 0 auto;
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--fg);
}

/* Empty state */
body.v3 .price-lookup__empty {
    padding: 16px 0;
}

/* Drawer: stacked columns, surfaced rows */
body.v3 .price-lookup--drawer .price-lookup__grid {
    grid-template-columns: 1fr;
    gap: 0;
}

body.v3 .price-lookup--drawer .price-lookup__col + .price-lookup__col {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

body.v3 .price-lookup--drawer .price-lookup__col-label {
    margin-bottom: 10px;
}

body.v3 .price-lookup--drawer .price-lookup__card {
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-bottom: none;
}

body.v3 .price-lookup--drawer .price-lookup__card:last-child {
    margin-bottom: 0;
}

body.v3 .price-lookup--drawer .price-lookup__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.v3 .price-lookup--drawer .price-lookup__fields--single {
    grid-template-columns: minmax(0, 1fr);
}

body.v3 .price-lookup--drawer .price-lookup__field {
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    gap: 4px;
}

body.v3 .price-lookup--drawer .price-lookup__empty {
    padding: 4px 0;
}

/* Request row actions dropdown — compact horizontal icon toolbar */
body.v3 .app-request-actions.is-open .app-request-actions__menu,
body.v3 .app-request-actions[data-dropdown-open="true"] .app-request-actions__menu {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 2px;
    min-width: auto;
    padding: 4px;
}

body.v3 .app-request-actions__menu > li {
    margin: 0;
    padding: 0;
}

body.v3 .app-request-actions__menu .app-request-actions__form {
    display: block;
    margin: 0;
}

body.v3 .app-request-actions__menu .app-menu__item,
body.v3 .app-request-actions__menu .app-request-actions__menu-item,
body.v3 .app-request-actions__menu .app-request-actions__menu-item--disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    min-height: 0;
    padding: 0;
    text-align: center;
}

/* Request drawer — full-width mobile panel + overflow fixes */
@media (max-width: 991.98px) {
    body.v3 .app-drawer.is-open,
    body.v3 #requestDrawerPanel.app-drawer {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-left: none;
    }

    body.v3 .app-drawer-body {
        padding: 16px;
    }

    body.v3 .app-drawer-card-head {
        margin: -16px -16px 0;
        padding: 16px 16px 0;
    }

    body.v3 .app-drawer-card-head__set {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    body.v3 .app-drawer-card-head__badges {
        width: 100%;
        gap: 6px;
    }

    body.v3 .app-drawer-card-head__badges .badge {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        justify-content: center;
        line-height: 1.25;
    }

    body.v3 .app-drawer-section--pipeline {
        padding: 12px 16px 0;
    }

    body.v3 .app-drawer-section--metrics,
    body.v3 .app-drawer-section--prices,
    body.v3 .app-drawer-section--customer,
    body.v3 .app-drawer-section--edit {
        padding-left: 16px;
        padding-right: 16px;
    }

    body.v3 .app-drawer .app-pipeline-step {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.25;
        font-size: 10px;
        padding: 8px 6px;
        min-width: 0;
        hyphens: auto;
    }

    body.v3 .app-drawer-panel {
        padding: 12px;
        overflow: visible;
    }

    body.v3 .app-drawer-metric-cell {
        padding: 10px;
        min-width: 0;
    }

    body.v3 .app-drawer-metric-cell__value {
        overflow-wrap: anywhere;
    }

    body.v3 .app-drawer-fulfillment-progress__head {
        gap: 10px;
        min-width: 0;
    }

    body.v3 .app-drawer-fulfillment-progress__pct {
        flex-shrink: 0;
    }

    body.v3 .app-drawer-lines__head,
    body.v3 .app-drawer-line-card__head {
        gap: 10px;
        min-width: 0;
    }

    body.v3 .app-drawer-lines__count {
        flex-shrink: 0;
        text-align: end;
    }

    body.v3 .app-drawer-line-card {
        padding: 10px;
    }

    body.v3 .app-drawer-line-card__fulfillment {
        min-width: 4.75rem;
    }

    body.v3 .price-lookup--drawer .price-lookup__toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.v3 .price-lookup--drawer .price-lookup__last-refresh {
        flex: 1 1 auto;
        flex-wrap: wrap;
        row-gap: 6px;
        width: 100%;
    }

    body.v3 .price-lookup--drawer .price-lookup__last-refresh .app-badge {
        max-width: 100%;
        white-space: normal;
    }

    body.v3 .price-lookup--drawer .price-lookup__last-refresh-when {
        white-space: normal;
    }

    body.v3 .price-lookup--drawer .price-lookup__actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }

    body.v3 .price-lookup--drawer .price-lookup__refresh-btn {
        width: 100%;
        justify-content: center;
    }

    body.v3 .price-lookup--drawer .price-lookup__grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body.v3 .price-lookup--drawer .price-lookup__card {
        padding: 8px 10px;
        gap: 10px;
    }

    body.v3 .price-lookup--drawer .price-lookup__card-price {
        min-width: 3.25rem;
        padding-left: 8px;
        text-align: end;
    }
}

/* === Request line chips (list + drawer) === */

body.v3 .app-request-lines {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

body.v3 .app-request-line-chips {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

body.v3 .app-request-line-chips__langs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

body.v3 .app-request-line-chips__flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    line-height: 1;
}

body.v3 .app-request-line-chips__badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Filter search shells: input must fill the bordered field (adv panels, report rows). */
body.v3 .filter-pills-search {
    min-width: 0;
}

body.v3 .report-filter-search.filter-pills-search,
body.v3 .adv-filter-field .filter-pills-search,
body.v3 .adv-filter-field--wide .filter-pills-search {
    width: 100%;
}

body.v3 .report-filter-search.filter-pills-search input,
body.v3 .report-filter-search.filter-pills-search .report-filter-search__input,
body.v3 .adv-filter-field .filter-pills-search input,
body.v3 .adv-filter-field--wide .filter-pills-search input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

body.v3 .list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
}

body.v3 .list-pagination__summary {
    margin: 0;
    font-size: 12px;
    color: var(--fg-3);
}

body.v3 .list-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

body.v3 .page-link--ellipsis {
    pointer-events: none;
    cursor: default;
}

/* Shared horizontal filter bar */
body.v3 .report-filter-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 12px 16px;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
body.v3 .report-filter-field {
    min-width: 0;
}
body.v3 .report-filter-field--grow {
    flex: 1 1 0;
    min-width: 140px;
}
body.v3 .report-filter-field--paid {
    flex: 0 0 auto;
    width: 160px;
    min-width: 120px;
}
body.v3 .request-adv-filter-panel {
    margin-bottom: 16px;
}
body.v3 .request-adv-filter-panel .request-adv-filter-row {
    flex-wrap: wrap;
    overflow-x: visible;
    -webkit-overflow-scrolling: unset;
    padding-bottom: 0;
}
body.v3 .request-adv-filter-panel .request-adv-filter-field {
    flex: 1 1 9.5rem;
    min-width: 0;
}
body.v3 .request-adv-filter-panel .request-adv-filter-field--search {
    flex: 2 1 13rem;
}
body.v3 .request-adv-filter-panel .request-adv-filter-field--date {
    flex: 1 1 9.5rem;
}
body.v3 .request-adv-filter-panel .request-adv-filter-field .app-form-control,
body.v3 .request-adv-filter-panel .request-adv-filter-field .app-form-select,
body.v3 .request-adv-filter-panel .request-adv-filter-field .report-filter-search {
    width: 100%;
}
@media (max-width: 767.98px) {
    body.v3 .request-adv-filter-panel .request-adv-filter-field {
        flex: 1 1 calc(50% - 8px);
    }
    body.v3 .request-adv-filter-panel .request-adv-filter-field--search {
        flex: 1 1 100%;
    }
}
@media (max-width: 479.98px) {
    body.v3 .request-adv-filter-panel .request-adv-filter-field {
        flex: 1 1 100%;
    }
}
body.v3 .report-filter-field--languages {
    flex: 1 1 0;
    min-width: 180px;
}
body.v3 .report-filter-field--languages:has(.app-ms-tags--open) {
    position: relative;
    z-index: 50;
}
body.v3 .report-filter-row:has(.app-ms-tags--open) {
    overflow: visible;
}
body.v3 .adv-filter-panel:has(.app-ms-tags--open) {
    position: relative;
    z-index: 40;
    overflow: visible;
}
body.v3 .report-filter-field--languages .app-ms-tags--open {
    z-index: 50;
}
body.v3 .report-filter-field--languages .app-ms-tags__menu {
    z-index: 60;
}
body.v3 #admin-catalog-cards-list:has(.app-ms-tags--open) .list-table-viewport,
body.v3 #admin-catalog-cards-list:has(.app-ms-tags--open) .app-list-narrow-stack {
    pointer-events: none;
}
body.v3 .app-language-multi-select {
    width: 100%;
}
body.v3 .report-filter-search {
    width: 100%;
    min-width: 0;
}
body.v3 .report-filter-search__input {
    width: 100%;
    min-width: 0;
}

/* Cookie consent */
.cb-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.65);
}
body.v3 .cb-cookie-consent {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    padding: 24px 16px;
    overflow: auto;
    align-items: center;
    justify-content: center;
}
body.v3 .cb-cookie-consent.is-open {
    display: flex;
}
body.v3 .cb-cookie-consent__dialog {
    max-width: 860px;
    width: min(100%, 860px);
    margin: 0 auto;
}
body.v3 .cb-cookie-consent__header {
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
}
body.v3 .cb-cookie-consent__body {
    padding: 20px 24px;
}
body.v3 .cb-cookie-consent__content {
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-2);
    border: 1px solid var(--border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
body.v3 .cb-cookie-consent__form {
    margin-top: 16px;
}

body.v3 .cb-cookie-consent .cb-cookie-consent__intro {
    color: var(--fg-2);
    font-size: 0.875rem;
    margin-bottom: 8px;
}
body.v3 .cb-cookie-consent__read-more {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
body.v3 .cb-cookie-consent__read-more:hover {
    text-decoration: underline;
}

body.v3 .cb-cookie-consent .cb-cookie-consent__category-group {
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    row-gap: 12px;
    column-gap: 16px;
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category-list > * {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category-list > [class*="col-"] {
    flex: initial !important;
    padding: 0 !important;
}
@media (max-width: 767px) {
    body.v3 .cb-cookie-consent .cb-cookie-consent__category-list {
        grid-template-columns: 1fr;
    }
}

body.v3 .cb-cookie-consent .cb-cookie-consent__category {
    display: flex;
    flex-direction: column;
    height: 100%;
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category > div:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 12px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category-information {
    padding: 10px 12px 14px !important;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category-title {
    font-size: 0.875rem !important;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
    line-height: 1.3;
}
body.v3 .cb-cookie-consent .cb-cookie-consent__category-description {
    font-size: 0.75rem;
    color: var(--fg-3);
    line-height: 1.4;
    display: block;
}

body.v3 .cb-cookie-consent .form-check,
body.v3 .cb-cookie-consent .app-form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
body.v3 .cb-cookie-consent .form-switch,
body.v3 .cb-cookie-consent .app-form-switch {
    padding-left: 0;
}
body.v3 .cb-cookie-consent .form-switch .form-check-input,
body.v3 .cb-cookie-consent .app-form-switch .app-form-check-input {
    flex-shrink: 0;
    width: 2.5em;
    height: 1.35em;
    margin: 0;
    cursor: pointer;
    background-color: var(--bg-4);
    border: 1px solid var(--border-strong);
    border-radius: 2em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23888'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: calc(1.35em - 2px);
    transition:
        background-position 0.15s ease-in-out,
        background-color 0.15s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
}
body.v3 .cb-cookie-consent .form-switch .form-check-input:checked,
body.v3 .cb-cookie-consent .app-form-switch .app-form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: right center;
}
body.v3 .cb-cookie-consent .form-switch .form-check-input:disabled,
body.v3 .cb-cookie-consent .app-form-switch .app-form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
body.v3 .cb-cookie-consent .form-check-label,
body.v3 .cb-cookie-consent .app-form-check-label {
    display: none;
}

body.v3 .cb-cookie-consent .cb-cookie-consent__btn-group {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 12px 0;
}
body.v3 .cb-cookie-consent .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s;
}
body.v3 .cb-cookie-consent .btn:hover {
    opacity: 0.85;
}
body.v3 .cb-cookie-consent .btn-success,
body.v3 .cb-cookie-consent .btn-primary {
    background: var(--accent);
    color: #fff;
}
body.v3 .cb-cookie-consent .btn-secondary {
    background: var(--bg-4);
    color: var(--fg-2);
    border: 1px solid var(--border);
}

body.v3 .list-results-scroll-anchor {
    display: block;
    height: 0;
    overflow: hidden;
    scroll-margin-top: var(--shell-topbar-h, 68px);
}


/* App shell layout */
/* ===== App shell layout ===== */
body.v3.app-shell {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ───── Sidebar ───── */
body.v3 .sidebar {
    width: var(--d-sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition:
        width 0.2s ease,
        transform 0.22s ease;
}
body.v3 .sidebar::before {
    content: "";
    position: absolute;
    inset: 0 -1px auto 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-line) 50%,
        transparent
    );
}
body.v3 .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--fg);
    flex-shrink: 0;
}
body.v3 .sidebar .brand {
    box-sizing: border-box;
    height: 76px;
    min-height: 76px;
    padding: 0 var(--d-brand-pad-x);
    border-bottom: 1px solid var(--border);
}
body.v3 .brand:hover {
    color: var(--fg);
    text-decoration: none;
}
body.v3 .brand-logo {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
body.v3 .brand-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}
body.v3 .navgroup {
    padding: 0 12px;
    flex: 1;
}
body.v3 .navlabel {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fg-4);
    padding: 16px 12px 8px;
}
body.v3 .navitem {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--fg-2);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    position: relative;
}
body.v3 .navitem:hover {
    background: var(--bg-3);
    color: var(--fg);
    text-decoration: none;
}
body.v3 .navitem.active {
    background: var(--bg-3);
    color: var(--fg);
    box-shadow: inset 3px 0 0 var(--accent);
}
body.v3 .navitem .badge-count {
    margin-left: auto;
    background: var(--accent);
    color: var(--bg);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
}
body.v3 .sidebar-foot {
    margin-top: auto;
    padding: 14px 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
body.v3 .user-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
body.v3 .avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-3);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
body.v3 .locale-pills {
    display: flex;
    gap: 4px;
}
body.v3 .locale-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--fg-3);
    cursor: pointer;
    transition:
        background 0.12s,
        color 0.12s;
}
body.v3 .locale-pill.active {
    background: var(--accent);
    color: var(--bg);
}
body.v3 .logout-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg-3);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}
body.v3 .logout-btn:hover {
    background: var(--bg-3);
    color: var(--fg);
}

/* Collapsed sidebar */
body.v3[data-sidebar="collapsed"] .brand-text,
body.v3[data-sidebar="collapsed"] .navitem-label,
body.v3[data-sidebar="collapsed"] .navlabel,
body.v3[data-sidebar="collapsed"] .navitem .badge-count,
body.v3[data-sidebar="collapsed"] .user-row .user-info,
body.v3[data-sidebar="collapsed"] .sidebar-foot .locale-pills,
body.v3[data-sidebar="collapsed"] .logout-btn span {
    display: none;
}
body.v3[data-sidebar="collapsed"] .navitem,
body.v3[data-sidebar="collapsed"] .sidebar .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
body.v3[data-sidebar="collapsed"] .sidebar .brand {
    height: 76px;
    min-height: 76px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Sidebar overlay (mobile) */
body.v3 .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}
body.v3 .sidebar-overlay.is-active {
    display: block;
}

/* ───── Main column ───── */
body.v3 .shell-content {
    margin-left: var(--d-sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s ease;
}

/* ───── Top bar ───── */
body.v3 .topbar {
    box-sizing: border-box;
    --shell-topbar-h: 68px;
    height: var(--shell-topbar-h);
    min-height: var(--shell-topbar-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--d-brand-pad-x);
    gap: 16px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}
body.v3 .topbar .crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-3);
    font-size: 13px;
}
body.v3 .topbar .crumbs .sep {
    color: var(--fg-4);
}
body.v3 .topbar .crumb-current {
    color: var(--fg);
}
body.v3 .topbar .crumb-link {
    color: var(--fg-3);
    text-decoration: none;
    transition: color 0.12s;
}
body.v3 .topbar .crumb-link:hover {
    color: var(--fg);
}
body.v3 .topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
body.v3 .topbar-hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--fg-3);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
    flex-shrink: 0;
}

/* ───── Main content area ───── */
body.v3 .main {
    flex: 1;
    min-width: 0;
    position: relative;
}
body.v3 .main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    height: 320px;
    background: radial-gradient(
        ellipse at center top,
        var(--accent-soft) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}
body.v3 .content {
    position: relative;
    z-index: 1;
    padding: var(--d-pad-section) 32px;
    display: flex;
    flex-direction: column;
    gap: var(--d-gap-stack);
}
/* Wrapper is layout-transparent: children become flex items of .content (restores gap between sections). */
body.v3 .app-layout-contents-host {
    display: contents;
}

/* List shell */
body.v3 .page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
body.v3 .language-flags-cell {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    color: var(--fg-2);
}

body.v3 .page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
body.v3 .page-head-main {
    min-width: 0;
    flex: 1 1 auto;
}
body.v3 .page-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 0;
}
body.v3 .page-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
body.v3 .page-sub {
    color: var(--fg-3);
    font-size: 14px;
    margin-top: 6px;
}


/* ===== Page entrance animation ===== */
@keyframes page-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
#main-content.page-enter {
    animation: page-fade-in 1.2s ease both;
}
@media (prefers-reduced-motion: reduce) {
    #main-content.page-enter {
        animation: none !important;
        opacity: 1 !important;
    }
}


/* Core reusable components */
/* ===== Buttons ===== */
body.v3 .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
body.v3 .btn.primary {
    background: var(--accent);
    color: var(--bg);
    box-shadow: var(--accent-glow);
}
body.v3 .btn.primary:hover {
    background: var(--accent-2);
    color: var(--bg);
    text-decoration: none;
}
body.v3 .btn.ghost {
    background: var(--bg-3);
    border-color: var(--border-2);
    color: var(--fg);
}
body.v3 .btn.ghost:hover {
    background: var(--bg-4);
    border-color: var(--border-strong);
    color: var(--fg);
    text-decoration: none;
}
body.v3 .btn.subtle {
    background: var(--bg-3);
    border-color: var(--border);
    color: var(--fg-2);
}
body.v3 .btn.subtle:hover {
    background: var(--bg-4);
    color: var(--fg);
    text-decoration: none;
}
body.v3 .btn.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.3);
}
body.v3 .btn.danger:hover {
    background: rgba(251, 113, 133, 0.2);
    color: var(--danger);
    text-decoration: none;
}
body.v3 .btn:disabled,
body.v3 .btn[disabled],
body.v3 .btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}
body.v3 .btn:active {
    transform: scale(0.97);
}

body.v3 .iconbtn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: var(--fg-3);
    border: 1px solid var(--border);
    background: var(--bg-3);
    transition: all 0.12s;
    flex-shrink: 0;
}
body.v3 .iconbtn:hover {
    background: var(--bg-4);
    color: var(--fg);
    border-color: var(--border-strong);
}

/* ===== Inputs & Forms ===== */
body.v3 .input {
    background: var(--bg-input);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13.5px;
    color: var(--fg);
    width: 100%;
}
body.v3 .input::placeholder {
    color: var(--fg-4);
}
body.v3 .input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
body.v3 .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 0 12px;
}
body.v3 .input-group .input,
body.v3 .input-group .form-control,
body.v3 .input-group .app-form-control {
    background: transparent;
    border: 0;
    padding: 9px 0;
    box-shadow: none;
    flex: 1;
    min-width: 0;
}
body.v3 .input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
body.v3 .input-group .input-group-text {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: var(--fg-4);
    flex-shrink: 0;
}

/* Standard Symfony form fields dark-themed */
body.v3 .form-label,
body.v3 .app-form-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-3);
    display: block;
    margin-bottom: 6px;
}
body.v3 .form-control,
body.v3 .form-select,
body.v3 .app-form-control,
body.v3 .app-form-select {
    background: var(--bg-input);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    color: var(--fg);
    font-size: 13.5px;
    padding: 9px 12px;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
body.v3 .form-control::placeholder,
body.v3 .app-form-control::placeholder {
    color: var(--fg-4);
}
body.v3 .form-control:focus,
body.v3 .form-select:focus,
body.v3 .app-form-control:focus,
body.v3 .app-form-select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-input);
    color: var(--fg);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Chrome / Edge / Safari: autofill paints a light background over transparent inputs
   (e.g. login email in .input-group), which looks like a white patch — restore tokens. */
body.v3 input.form-control:-webkit-autofill,
body.v3 input.form-control:-webkit-autofill:hover,
body.v3 input.form-control:-webkit-autofill:focus,
body.v3 input.form-control:-webkit-autofill:active,
body.v3 input.app-form-control:-webkit-autofill,
body.v3 input.app-form-control:-webkit-autofill:hover,
body.v3 input.app-form-control:-webkit-autofill:focus,
body.v3 input.app-form-control:-webkit-autofill:active,
body.v3 input.input:-webkit-autofill,
body.v3 input.input:-webkit-autofill:hover,
body.v3 input.input:-webkit-autofill:focus,
body.v3 input.input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--fg) !important;
    caret-color: var(--fg);
    box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.v3 .form-select option,
body.v3 .app-form-select option {
    background: var(--bg-4);
    color: var(--fg);
}
body.v3 .form-check-input,
body.v3 .app-form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-2);
}
body.v3 .form-check-input:checked,
body.v3 .app-form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
body.v3 .form-check-label,
body.v3 .app-form-check-label {
    font-size: 13.5px;
    color: var(--fg-2);
}
body.v3 .invalid-feedback {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}
body.v3 .app-form-errors {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}
body.v3 .is-invalid {
    border-color: var(--danger) !important;
}
body.v3 .app-form-row {
    margin-bottom: 1rem;
}
body.v3 .app-form-help {
    font-size: 11.5px;
    color: var(--fg-4);
    margin-top: 4px;
    display: block;
}
body.v3 .app-choice-expanded {
    display: grid;
    gap: 8px;
}
body.v3 .app-form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.v3 .app-form-select--sm {
    font-size: 12px;
    padding: 7px 10px;
}
body.v3 .app-hidden {
    display: none !important;
}
body.v3 .input-group-text {
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    border-right: none;
    color: var(--fg-3);
    border-radius: 8px 0 0 8px;
    padding: 0 12px;
}

/* ===== Badges ===== */
body.v3 .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-3);
    color: var(--fg-2);
    border: 1px solid var(--border-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
body.v3 .badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    flex-shrink: 0;
}
body.v3 .badge.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(74, 222, 128, 0.3);
}
body.v3 .badge.warn {
    color: var(--warn);
    background: var(--warn-soft);
    border-color: rgba(251, 191, 36, 0.3);
}
body.v3 .badge.danger {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(251, 113, 133, 0.3);
}
body.v3 .badge.info {
    color: var(--info);
    background: var(--info-soft);
    border-color: rgba(96, 165, 250, 0.3);
}
body.v3 .badge.accent {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

/* ===== Tables ===== */
body.v3 .tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    font-size: var(--t-body, 0.875rem);
}
body.v3 .tbl thead th {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-3);
    padding: 12px 16px;
    white-space: nowrap;
    text-align: left;
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border-bottom: 1px solid var(--border-2);
}
body.v3 .tbl tbody td {
    padding: var(--d-pad-cell);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    height: var(--d-row-h);
}
body.v3 .tbl tbody tr:last-child td {
    border-bottom: 0;
}
body.v3 .tbl tbody tr:hover {
    background: var(--bg-3);
}
body.v3 .tbl tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}
body.v3 .tbl .num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
body.v3 .tbl .col-actions {
    text-align: right;
    white-space: nowrap;
}
body.v3 .tbl thead th.col-actions {
    text-align: center;
}
body.v3 .tbl tr[data-drawer-url] {
    cursor: pointer;
}

/* Sortable header links */
body.v3 .tbl .sort-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    user-select: none;
}
body.v3 .tbl .sort-link:hover {
    color: var(--fg-2);
}
body.v3 .tbl th.sort-asc .sort-link,
body.v3 .tbl th.sort-desc .sort-link {
    color: var(--accent);
}
body.v3 .tbl .sort-icons {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1;
}
body.v3 .tbl .sort-icons .tri {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.35;
}
body.v3 .tbl .sort-icons .tri.up {
    border-bottom: 6px solid var(--fg-3);
}
body.v3 .tbl .sort-icons .tri.down {
    border-top: 6px solid var(--fg-3);
}
body.v3 .tbl th.sort-asc .sort-icons .tri.up,
body.v3 .tbl th.sort-desc .sort-icons .tri.down {
    opacity: 1;
    border-bottom-color: var(--accent);
    border-top-color: var(--accent);
}

/* Row actions fade in */
body.v3 .tbl tbody tr .row-actions {
    opacity: 0;
    transition: opacity 0.15s;
}
body.v3 .tbl tbody tr:hover .row-actions {
    opacity: 1;
}
@media (hover: none) {
    body.v3 .tbl tbody tr .row-actions {
        opacity: 1;
    }
}

/* ===== Card thumbnails ===== */
body.v3 .card-thumb {
    width: var(--d-thumb);
    height: var(--d-thumb-h);
    border-radius: 5px;
    background-size: cover;
    background-position: center top;
    border: 1px solid var(--border-2);
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
body.v3 .card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
body.v3 .card-thumb--no-art {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--bg-4), var(--bg-3));
    color: var(--fg-4);
}
body.v3 .card-thumb--no-art svg {
    width: 38%;
    height: auto;
    max-width: 1.35rem;
    opacity: 0.9;
}
body.v3 .card-thumb.holo::after,
body.v3 .card-thumb-zoom.holo::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 6px;
    padding: 1px;
    background: var(--holo);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
}

/* Card thumb zoom (hover preview) */
body.v3 .card-thumb-zoom {
    --card-zoom-w: 18rem;
    width: var(--d-thumb);
    height: var(--d-thumb-h);
    position: relative;
    flex-shrink: 0;
    border-radius: 5px;
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    overflow: visible;
}
body.v3 .card-thumb-zoom:hover {
    z-index: 40;
}
body.v3 .card-thumb-zoom__pad {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    z-index: 0;
}
body.v3 .card-thumb-zoom__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 2;
    pointer-events: none;
}
body.v3 .card-thumb-zoom__layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
body.v3 .card-thumb-zoom__preview {
    position: fixed;
    top: var(--card-preview-top, 0px);
    left: var(--card-preview-left, 0px);
    width: var(--card-zoom-w);
    height: auto;
    border-radius: 0.6rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-strong);
    background: var(--bg-3);
    display: none;
    opacity: 0;
    transform: translateY(10px) scale(0.99);
    transform-origin: 0 0;
    pointer-events: none;
    transition:
        opacity 0.12s ease-out,
        transform 0.12s ease-out;
    z-index: 2000;
}
body.v3 .card-thumb-zoom.is-preview-active .card-thumb-zoom__preview {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}
body.v3 .tbl tbody td:has(.card-thumb-zoom) {
    overflow: visible;
}
/* Fixed preview still stacks inside table paint order: later <td>/<tr> win unless we lift the active row/cell. */
body.v3 .tbl tbody tr:has(.card-thumb-zoom.is-preview-active) {
    position: relative;
    z-index: 220;
}
body.v3 .tbl tbody td:has(.card-thumb-zoom.is-preview-active) {
    position: relative;
    z-index: 2;
}
@media (max-width: 576px) {
    body.v3 .card-thumb-zoom {
        --card-zoom-w: 15rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.v3 .card-thumb-zoom__preview {
        transition: none;
    }
}

/* ===== KPI / Stat grid ===== */
body.v3 .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
body.v3 .kpi {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
body.v3 .kpi::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.6;
}
body.v3 .kpi-label {
    color: var(--fg-3);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
body.v3 .kpi-value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
body.v3 .kpi-delta {
    font-size: 12px;
}
body.v3 .kpi-delta.up {
    color: var(--success);
}
body.v3 .kpi-delta.dn {
    color: var(--danger);
}

/* ===== Filters panel ===== */
body.v3 .filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 18px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
}
body.v3 .filters .fld {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
body.v3 .filters .fld-lbl {
    font-size: 10.5px;
    color: var(--fg-3);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ===== Progress bar ===== */
body.v3 .progress {
    height: 8px;
    background: var(--bg-4);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
body.v3 .progress > span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    box-shadow: 0 0 10px var(--accent);
}
body.v3 .progress.success > span {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

/* ===== Mana pip badges ===== */
body.v3 .pip {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}
body.v3 .pip.w {
    background: var(--w);
    color: #5a4a1a;
}
body.v3 .pip.u {
    background: var(--u);
    color: #0a3a5a;
}
body.v3 .pip.b {
    background: var(--b);
    color: #1a1a1a;
}
body.v3 .pip.r {
    background: var(--r);
    color: #5a1a0a;
}
body.v3 .pip.g {
    background: var(--g);
    color: #0a3a1a;
}

/* ===== Pagination ===== */
body.v3 .pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}
body.v3 .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-2);
    background: var(--bg-3);
    color: var(--fg-2);
    text-decoration: none;
    transition: all 0.12s;
}
body.v3 .page-link:hover {
    background: var(--bg-4);
    color: var(--fg);
    border-color: var(--border-strong);
    text-decoration: none;
}
body.v3 .page-item.active .page-link {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
body.v3 .page-item.disabled .page-link {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ===== Flash alerts ===== */
body.v3 .alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.45;
    border: 1px solid transparent;
    margin-bottom: 0;
}
body.v3 .alert.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.3);
}
body.v3 .alert.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.3);
}
body.v3 .alert.warn {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: rgba(251, 191, 36, 0.3);
}
body.v3 .alert.info {
    background: var(--info-soft);
    color: var(--info);
    border-color: rgba(96, 165, 250, 0.3);
}
body.v3 .alert .btn-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    opacity: 0.6;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
body.v3 .alert .btn-close:hover {
    opacity: 1;
}

/* ===== Slide drawer ===== */
body.v3 .app-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1020;
    backdrop-filter: blur(2px);
}
body.v3 .app-drawer-backdrop.is-active {
    display: block;
}
body.v3 .app-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(520px, 95vw);
    z-index: 1030;
    background: var(--bg-2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.22s ease;
}
body.v3 .app-drawer.is-open {
    transform: translateX(0);
}
body.v3 .app-drawer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-3);
    flex-shrink: 0;
}
body.v3 .app-drawer-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fg);
    flex: 1;
}
body.v3 .app-drawer-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-4);
    color: var(--fg-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
    flex-shrink: 0;
}
body.v3 .app-drawer-close:hover {
    background: var(--bg-3);
    color: var(--fg);
}
body.v3 .app-drawer-body {
    flex: 1;
    overflow-x: visible;
    overflow-y: auto;
    padding: 20px;
}

/* Drawer card header — thumb zoom (preview portaled to body via card_thumb_zoom_controller) */
body.v3 .app-drawer-card-head {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: -20px -20px 0;
    padding: 20px 20px 0;
    overflow: visible;
}
body.v3 .app-drawer-card-head__thumb {
    --d-thumb: 4.5rem;
    --d-thumb-h: 6.3rem;
    flex-shrink: 0;
    position: relative;
}
body.v3 .app-drawer-card-head__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 4px;
}
body.v3 .app-drawer-card-head__set {
    font-size: 0.78rem;
    color: var(--fg-4);
}
body.v3 .app-drawer-card-head__badges {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
/* Portaled drawer previews: positioned via inline top/left in JS */
body.v3 .card-thumb-zoom__preview--portaled {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    width: min(var(--card-zoom-w), 42vw) !important;
    height: auto !important;
    transform: none !important;
    transform-origin: 0 0 !important;
    display: none !important;
    opacity: 0 !important;
    z-index: 1045 !important;
    transition: opacity 0.12s ease-out;
}
body.v3 .card-thumb-zoom__preview--portaled.is-preview-visible {
    display: block !important;
    opacity: 1 !important;
}
/* Customer quick-edit: full-width form, no double padding */
body.v3 .app-drawer-body:has(.customer-drawer-request-list) {
    padding: 0;
}
body.v3 .customer-drawer-request-list {
    display: flex;
    flex-direction: column;
}
body.v3 .customer-drawer-request-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: background 0.15s ease;
}
body.v3 .customer-drawer-request-item:hover {
    background: var(--bg-elevated);
}
body.v3 .customer-drawer-request-item__thumb .card-thumb-zoom,
body.v3 .customer-drawer-request-item__thumb .card-thumb--no-art {
    --d-thumb: 40px;
    --d-thumb-h: 56px;
}
body.v3 .customer-drawer-request-item__thumb .card-thumb-zoom__pad {
    width: 40px;
    height: 56px;
}
body.v3 .customer-drawer-request-item__thumb .card-thumb-zoom__layer {
    width: 40px;
    height: 56px;
}
body.v3 .customer-drawer-request-item__main {
    min-width: 0;
    flex: 1;
}
body.v3 .customer-drawer-request-item__name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--fg);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.v3 .customer-drawer-request-item__set {
    font-size: 0.72rem;
    color: var(--fg-3);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.v3 .customer-drawer-request-item__aside {
    flex-shrink: 0;
    text-align: right;
}
body.v3 .customer-drawer-request-item__main .app-request-lines {
    margin-top: 2px;
}
body.v3 .customer-drawer-request-item__date-inner {
    font-size: 0.72rem;
    color: var(--fg-3);
}
body.v3 .customer-drawer-request-item__days {
    font-size: 0.72rem;
    color: var(--fg-3);
    margin-top: 2px;
}
body.v3 .customer-drawer-request-item__priority {
    margin-top: 0.25rem;
}
body.v3 .customer-drawer-request-list__footer {
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    padding: 1rem;
}
body.v3 .customer-drawer-request-list__footer-link {
    width: 100%;
    text-align: center;
}
body.v3 .tbl tbody tr.app-request-row {
    cursor: pointer;
}
body.v3 .app-drawer-body:has(.customer-drawer-form) {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.v3 .customer-drawer-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
}
body.v3 .customer-drawer-form__lead {
    padding: 20px 24px 10px;
    flex-shrink: 0;
}
body.v3 .customer-drawer-form__main {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 24px 20px;
}
body.v3 .customer-drawer-form__main .app-drawer-section-title {
    margin-bottom: 14px;
}
body.v3 .customer-drawer-form__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: none;
}
body.v3 .customer-drawer-form .mb-3 {
    width: 100%;
    margin-bottom: 0 !important;
}
body.v3 .customer-drawer-form .form-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    color: var(--fg-2);
}
body.v3 .customer-drawer-form .form-control,
body.v3 .customer-drawer-form .form-select {
    width: 100%;
    max-width: none;
    font-size: 14px;
    line-height: 1.4;
    padding: 11px 14px;
    min-height: 44px;
}
body.v3 .customer-drawer-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}
body.v3 .customer-drawer-form [type="submit"],
body.v3 .customer-drawer-form .btn-app-primary {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
    min-height: 44px;
    font-size: 14px;
}
/* Drawer shell: force full-width field column (Bootstrap row/col + flex quirks) */
body.v3 .app-drawer .customer-drawer-form__form,
body.v3 .app-drawer .customer-drawer-form__form > div {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
body.v3 .app-drawer .customer-drawer-form .mb-3,
body.v3 .app-drawer .customer-drawer-form .w-100 {
    width: 100% !important;
    max-width: none !important;
}
body.v3 .app-drawer .customer-drawer-form .form-control,
body.v3 .app-drawer .customer-drawer-form .form-select,
body.v3 .app-drawer .customer-drawer-form textarea {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}
body.v3 .customer-drawer-form__footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-3);
    flex-shrink: 0;
}

/* Customer edit page: compact card, fields fill card width */
body.v3 .customer-edit {
    max-width: 28rem;
    width: 100%;
}
@media (min-width: 992px) {
    body.v3 .customer-edit {
        max-width: 36rem;
    }
}
body.v3 .customer-edit .app-card {
    width: 100%;
}
body.v3 .customer-edit .app-card-body form,
body.v3 .customer-edit .app-card-body form > div {
    width: 100%;
    box-sizing: border-box;
}
body.v3 .customer-edit .app-card-body .mb-3,
body.v3 .customer-edit .app-card-body .w-100 {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}
body.v3 .customer-edit .app-card-body .form-control,
body.v3 .customer-edit .app-card-body .form-select,
body.v3 .customer-edit .app-card-body textarea {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

body.v3 .app-drawer-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-3);
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
body.v3 .drawer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 12px;
    color: var(--fg-4);
}
body.v3 .drawer-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-2);
    border-top-color: var(--accent);
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Drawer sections */
body.v3 .drawer-section {
    margin-bottom: 20px;
}
body.v3 .drawer-section-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-4);
    margin-bottom: 10px;
}
body.v3 .drawer-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
body.v3 .drawer-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
body.v3 .drawer-field-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-4);
}
body.v3 .drawer-field-value {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fg);
}
body.v3 .drawer-card-img {
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-3);
    display: inline-block;
}
body.v3 .drawer-card-img img {
    display: block;
    width: 100%;
    height: auto;
}
body.v3 .drawer-pipeline {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}
body.v3 .drawer-pipeline-step {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    background: var(--bg-3);
    color: var(--fg-4);
    border: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        background 0.15s,
        color 0.15s;
}
body.v3 .drawer-pipeline-step.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-line);
}
body.v3 .drawer-pipeline-step.done {
    background: var(--success-soft);
    color: var(--success);
    border-color: transparent;
}

/* ===== Fulfillment progress ===== */
body.v3 .fulfillment-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-4);
    overflow: hidden;
}
body.v3 .fulfillment-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    transition: width 0.3s ease;
}

/* ===== Empty state ===== */
body.v3 .empty-state {
    text-align: center;
    padding: 64px 0;
    color: var(--fg-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
body.v3 .empty-state svg {
    opacity: 0.5;
}
body.v3 .empty-state p {
    font-size: 14px;
    margin: 0;
    color: var(--fg-3);
}
body.v3 .empty-state a {
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
}
body.v3 .empty-state a:hover {
    color: var(--accent-2);
    text-decoration: underline;
}

/* ===== Select autocomplete ===== */
body.v3 .select-autocomplete-menu {
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-top: 4px;
    max-height: min(40vh, 320px);
    overflow-y: auto;
    z-index: 500;
    position: absolute;
    width: 100%;
}
body.v3 .select-autocomplete-item {
    padding: 8px 12px;
    font-size: 13.5px;
    color: var(--fg-2);
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--border);
}
body.v3 .select-autocomplete-item:last-child {
    border-bottom: 0;
}
body.v3 .select-autocomplete-item:hover,
body.v3 .select-autocomplete-item.is-active {
    background: var(--bg-4);
    color: var(--fg);
}

/* ===== Scryfall picker ===== */
body.v3 .scryfall-picker-results {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-height: 22rem;
    overflow-y: auto;
    z-index: 1030;
}
body.v3 .scryfall-picker-results .list-group-item {
    background: transparent;
    border-color: var(--border);
    color: var(--fg-2);
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.1s;
    padding: 8px 14px;
}
body.v3 .scryfall-picker-results .list-group-item:hover {
    background: var(--bg-4);
    color: var(--fg);
}

/* ===== Inline-edit ===== */
body.v3 [data-inline-edit-field] {
    border-radius: 4px;
    padding: 2px 4px;
    cursor: text;
    transition: background 0.12s;
}
body.v3 [data-inline-edit-field]:hover {
    background: var(--bg-3);
}



/* Shell mobile responsive overrides */
/* ===== Mobile responsive ===== */
@media (max-width: 991.98px) {
    body.v3.app-shell {
        flex-direction: column;
    }
    body.v3 .sidebar {
        transform: translateX(-100%);
    }
    body.v3 .sidebar.is-open {
        transform: translateX(0);
    }
    body.v3 .shell-content {
        margin-left: 0;
    }
    body.v3 .content {
        padding: 16px;
    }
    body.v3 .topbar {
        padding: 0 var(--d-brand-pad-x);
    }
    body.v3 .topbar-hamburger {
        display: flex;
    }
    body.v3 .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    body.v3 .page-head {
        flex-direction: column;
        align-items: flex-start;
    }
    body.v3 .page-title {
        font-size: 1.5rem;
    }
}
@media (max-width: 576px) {
    body.v3 .kpi-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    body.v3 .app-drawer {
        transition: none;
    }
    body.v3 .report-cards-needed-detail {
        transition-duration: 0.01ms !important;
    }
}
