.filters {
    gap: 14px;
}

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

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

.stat-card {
    padding: 1rem 1.1rem;
}

.stat-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    min-width: 0;
    width: 100%;
}

.stat-card .stat-label {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 65%;
}

.stat-value-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    max-width: 100%;
    margin-left: auto;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(38, 50, 56, 0.12);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(239, 243, 247, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    color: var(--admin-ink);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.stat-value-chip a {
    color: inherit;
}

@media (max-width: 640px) {
    .stat-card__row {
        align-items: flex-start;
        flex-direction: column;
    }

    .stat-card .stat-label {
        max-width: 100%;
    }

    .stat-value-chip {
        max-width: 100%;
        margin-left: 0;
        white-space: normal;
        text-align: left;
    }
}

.data-table a,
table a:not(.secondary-button):not(.primary-button):not(.danger-button):not(.badge) {
    color: var(--admin-primary);
    font-weight: 600;
}

.parts-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.inventory-name-link {
    display: inline-block;
    max-width: 100%;
}

.name-with-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    vertical-align: middle;
}

.name-with-edit-link__edit {
    flex: 0 0 auto;
    color: rgba(38, 50, 56, 0.46);
}

.name-with-edit-link__edit:hover,
.name-with-edit-link__edit:focus {
    color: var(--admin-primary);
}

.table-action-menu {
    display: inline-flex;
}

.table-action-menu__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid rgba(38, 50, 56, 0.14);
    border-radius: 999px;
    background: #fff;
    color: var(--admin-ink);
    cursor: pointer;
}

.table-action-menu__trigger:hover,
.table-action-menu__trigger:focus {
    border-color: rgba(33, 150, 243, 0.3);
    box-shadow: 0 0 0 0.15rem rgba(33, 150, 243, 0.12);
    outline: none;
}

.table-action-menu .dropdown-menu {
    min-width: 11rem;
}

.table-action-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
}

.table-action-menu .dropdown-item-form {
    margin: 0;
}

.table-action-menu .dropdown-item-form .dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.general-inventory-items-table {
    table-layout: auto;
}

.general-inventory-items-table .general-inventory-col--manufacturer {
    width: 9rem;
}

.general-inventory-items-table .general-inventory-col--quantity,
.general-inventory-items-table .general-inventory-col--listings {
    width: 6rem;
    white-space: nowrap;
}

.general-inventory-items-table .general-inventory-col--price {
    width: 8rem;
    white-space: nowrap;
}

.general-inventory-items-table .general-inventory-col--date,
.general-inventory-items-table .general-inventory-col--deleted {
    width: 8.5rem;
    white-space: nowrap;
}

.general-inventory-items-table .general-inventory-col--actions {
    width: 1%;
    white-space: nowrap;
}

.general-inventory-items-table th {
    white-space: normal;
}

.table-header-compact {
    display: inline-block;
    line-height: 1.15;
}

.general-inventory-quantity-separator {
    margin: 0 0.3rem;
    color: rgba(38, 50, 56, 0.52);
}

.stock-row > td {
    transition: background-color 0.15s ease;
}

.stock-row--custom > td {
    background-color: var(--stock-row-bg, transparent);
}

.stock-row--healthy > td {
    background-color: rgba(76, 175, 80, 0.12);
}

.stock-row--warning > td {
    background-color: rgba(255, 193, 7, 0.16);
}

.stock-row--critical > td {
    background-color: rgba(229, 57, 53, 0.14);
}

.stock-row--muted > td {
    background-color: rgba(120, 144, 156, 0.18);
}

.table-hover tbody tr.stock-row--healthy:hover > td {
    background-color: rgba(76, 175, 80, 0.18);
}

.table-hover tbody tr.stock-row--warning:hover > td {
    background-color: rgba(255, 193, 7, 0.22);
}

.table-hover tbody tr.stock-row--critical:hover > td {
    background-color: rgba(229, 57, 53, 0.2);
}

.table-hover tbody tr.stock-row--muted:hover > td {
    background-color: rgba(120, 144, 156, 0.26);
}

.table-hover tbody tr.stock-row--custom:hover > td {
    background-color: var(--stock-row-bg-hover, var(--stock-row-bg, transparent));
}

.managed-dictionary-color-preview {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.managed-dictionary-color-preview__swatch {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 50, 56, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
    flex: 0 0 auto;
}

.listing-badge-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.listing-badge {
    border: 1px solid transparent;
    font-weight: 700;
}

a.listing-badge {
    text-decoration: none;
}

a.listing-badge:hover,
a.listing-badge:focus {
    text-decoration: none;
    filter: brightness(0.96);
}

.listing-badge--active {
    color: #fff;
    background-color: #4caf50;
    border-color: #43a047;
}

.listing-badge--inactive {
    color: #5f4500;
    background-color: #ffd54f;
    border-color: #fbc02d;
}

.listing-badge--empty {
    color: inherit;
}

.listing-row--inactive {
    background: rgba(255, 193, 7, 0.12);
}

.pc-set-usage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.2;
}

.pc-set-usage-badge--empty {
    color: #546e7a;
    background: #eceff1;
    border-color: #cfd8dc;
    cursor: default;
}

.pc-set-usage-badge--linked {
    color: #fff;
    background: var(--admin-primary);
    border-color: rgba(21, 101, 192, 0.35);
    cursor: pointer;
}

.pc-set-usage-badge--linked:hover,
.pc-set-usage-badge--linked:focus {
    box-shadow: 0 0 0 0.15rem rgba(33, 150, 243, 0.18);
}

.pc-set-usage-popover-list {
    display: grid;
    gap: 0.35rem;
    min-width: 11rem;
}

.pc-set-usage-popover-link {
    color: var(--admin-primary);
    font-weight: 600;
    text-decoration: none;
}

.pc-set-usage-popover-link:hover,
.pc-set-usage-popover-link:focus {
    text-decoration: underline;
}

.split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.split-grid > .stack {
    min-width: 0;
    display: grid;
    gap: 1.5rem;
}

.split-grid .panel,
.split-grid .table-responsive,
.split-grid .compact-form,
.split-grid .definition-card,
.split-grid .detail-grid,
.split-grid .form-row {
    min-width: 0;
}

.part-listings-layout {
    display: grid;
    gap: 1.5rem;
}

.part-listings-table-scroll {
    max-height: 23rem;
    overflow: auto;
}

.part-listings-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}

.part-listings-table-scroll .table {
    margin-bottom: 0;
}

.part-tests-panel .definition-card,
.part-tests-panel .compact-form {
    overflow: hidden;
}

.parts-uuid-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    border: 1px solid rgba(38, 50, 56, 0.14);
    border-radius: 999px;
    background: #fff;
    color: #607d8b;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.parts-uuid-trigger:hover,
.parts-uuid-trigger:focus {
    color: var(--admin-primary);
    border-color: rgba(33, 150, 243, 0.3);
    box-shadow: 0 0 0 0.15rem rgba(33, 150, 243, 0.12);
    outline: none;
}

.pc-parts-inline-state-select {
    width: 8.35rem;
    min-width: 8.35rem;
    max-width: 100%;
}

.pc-parts-inline-state-select:disabled {
    cursor: not-allowed;
    opacity: 0.75;
}

.pc-parts-note-popover .popover-body {
    max-width: 24rem;
    text-align: left;
    line-height: 1.45;
}

.build-cost-preview {
    margin-bottom: 1rem;
}

.configuration-summary-copy {
    display: grid;
    gap: 0.75rem;
}

.configuration-summary-copy__textarea {
    min-height: 13rem;
    font-family: "Roboto Mono", Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    resize: vertical;
    white-space: pre;
}

.listing-template-text-input {
    min-height: 6.5rem;
    font-family: inherit;
    line-height: 1.55;
    resize: vertical;
}

.listing-template-text-input--body {
    min-height: 15rem;
}

.listing-template-placeholder-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.listing-template-placeholder-reference {
    display: grid;
    gap: 0.45rem;
}

.listing-template-placeholder-reference-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.58rem 0.78rem;
    border: 1px solid rgba(38, 50, 56, 0.12);
    border-radius: 0.75rem;
    background: rgba(248, 250, 252, 0.94);
    text-align: left;
}

.listing-template-placeholder-reference-item--static {
    cursor: default;
}

.listing-template-placeholder-reference-item:not(.listing-template-placeholder-reference-item--static) {
    cursor: pointer;
}

.listing-template-placeholder-reference-item:not(.listing-template-placeholder-reference-item--static):hover,
.listing-template-placeholder-reference-item:not(.listing-template-placeholder-reference-item--static):focus {
    border-color: rgba(33, 150, 243, 0.32);
    box-shadow: 0 0 0 0.15rem rgba(33, 150, 243, 0.12);
    outline: none;
}

.listing-template-placeholder-chip,
.listing-token-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.2;
}

.listing-template-placeholder-chip {
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: #fff;
    color: var(--admin-ink);
    cursor: pointer;
}

.listing-template-placeholder-chip:hover,
.listing-template-placeholder-chip:focus {
    border-color: rgba(33, 150, 243, 0.32);
    box-shadow: 0 0 0 0.15rem rgba(33, 150, 243, 0.12);
    outline: none;
}

.listing-token-chip {
    margin: 0.1rem 0.12rem;
    padding: 0.16rem 0.52rem;
    border: 1px solid hsl(var(--listing-token-hue, 210) 55% 72%);
    background: hsl(var(--listing-token-hue, 210) 70% 95%);
    color: hsl(var(--listing-token-hue, 210) 52% 30%);
    vertical-align: baseline;
    white-space: nowrap;
    user-select: none;
}

.listing-template-preview {
    min-height: 3rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(38, 50, 56, 0.12);
    border-radius: 0.65rem;
    background: #fff;
    white-space: pre-wrap;
    word-break: break-word;
}

.listing-template-preview--body {
    min-height: 8rem;
}

.listing-generator-warning {
    border-radius: 0.75rem;
}

.listing-generator-copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: start;
}

.listing-generator-copy-row--stack {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 640px) {
    .listing-generator-copy-row {
        grid-template-columns: 1fr;
    }
}

.page-header-card__actions .badge,
.page-header-card__actions .status-pill {
    align-self: center;
}

.auth-card form {
    margin-top: 18px;
}

.auth-card .page-notifications + form {
    margin-top: 0;
}

.page-notifications {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.page-notification {
    margin-bottom: 0;
    border-radius: 0.8rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.page-notification__body {
    display: grid;
    gap: 0.45rem;
    padding-right: 1.5rem;
}

.page-notification__title {
    display: block;
}

.page-notification__message {
    line-height: 1.5;
}

.page-notification__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.2rem;
}

.page-notification__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 50, 56, 0.12);
    background: rgba(255, 255, 255, 0.88);
    color: var(--admin-ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.page-notification__action--primary {
    background: #1565c0;
    border-color: #0d47a1;
    color: #fff;
}

.page-notification__close {
    position: absolute;
    top: 0.75rem;
    right: 0.8rem;
}

.page-notification__action:hover,
.page-notification__action:focus {
    text-decoration: none;
    color: inherit;
}

.admin-form-actions--with-option {
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-action-option {
    flex: 1 1 16rem;
    min-width: 14rem;
}

.form-action-option .form-group {
    margin-bottom: 0;
}

.form-action-option .form-text {
    margin-top: 0.25rem;
}

.technical-field-block {
    min-width: 0;
}

.technical-field-block__row {
    margin-bottom: 0.2rem;
}

.technical-field-block__warning {
    margin-top: 0;
    margin-bottom: 0.35rem;
    line-height: 1.35;
}

.form-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 860px) {
    .definition-list,
    .stats-grid,
    .split-grid {
        grid-template-columns: 1fr;
    }
}
