/* Groups / systems */
.inventory-select-column {
    width: 42px;
    text-align: center;
}

.inventory-select-column input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.collection-bulk-bar {
    position: sticky;
    top: 10px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 0;
    padding: 12px 14px;
    border: 1px solid #3b82f6;
    border-radius: 10px;
    background: #0f1d33;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.collection-bulk-bar[hidden] { display: none; }

.collection-cell {
    min-width: 160px;
    max-width: 260px;
}

.collection-badge {
    display: inline-flex;
    align-items: center;
    max-width: 240px;
    margin: 2px 4px 2px 0;
    padding: 3px 7px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
}

.collection-badge-system {
    background: #312e81;
    color: #e0e7ff;
    border: 1px solid #4f46e5;
}

.collection-badge-group {
    background: #164e63;
    color: #cffafe;
    border: 1px solid #0891b2;
}

.collection-badge:hover { filter: brightness(1.12); }

.collection-dialog {
    width: min(820px, calc(100vw - 28px));
    max-height: min(820px, calc(100vh - 28px));
    padding: 0;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #111827;
    color: #e5e7eb;
    box-shadow: 0 24px 70px rgba(0,0,0,.55);
}

.collection-dialog::backdrop { background: rgba(0, 0, 0, 0.68); }
.collection-dialog-shell { margin: 0; }
.collection-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #273449;
}
.collection-dialog-header h2 { margin: 0 0 4px; }
.collection-dialog-body {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
    max-height: 58vh;
    overflow: auto;
}
.collection-dialog-actions {
    justify-content: flex-end;
    padding: 14px 20px 18px;
    border-top: 1px solid #273449;
}
.collection-dialog > form > .error { margin: 0 20px 12px; }
.collection-dialog-message { line-height: 1.5; }
.collection-selected-details summary { cursor: pointer; }
.collection-selected-details ul { margin: 8px 0 0 20px; }
.collection-create-form { display: grid; gap: 12px; }
.collection-roles-title { margin-top: 4px; }
.collection-role-list { display: grid; gap: 8px; }
.collection-role-row {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr);
    gap: 10px;
    align-items: center;
}
.collection-role-row > span { overflow-wrap: anywhere; }
.collection-ai-reason { line-height: 1.45; }
.collection-move-warning { margin: 0; }

.drawer-collection-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.collection-member-edit {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(100px, .6fr) auto;
    gap: 8px;
    align-items: center;
}
.collection-members-card { margin-top: 16px; }
.collection-history { margin-top: 16px; }
.collection-history > summary { cursor: pointer; }
.collection-history-table-wrap { margin-top: 14px; }
.danger-zone { margin-top: 16px; border-color: #7f1d1d; }

@media (max-width: 800px) {
    .collection-bulk-bar { position: static; align-items: flex-start; flex-direction: column; }
    .collection-role-row { grid-template-columns: 1fr; }
    .collection-member-edit { grid-template-columns: 1fr; }
    .collection-cell { min-width: 120px; }
}
