.nui-mgmt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12000;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: nuiMgmtFadeIn 0.15s ease-out;
}

@keyframes nuiMgmtFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nui-mgmt-content {
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: nuiMgmtSlideUp 0.15s ease-out;
}

@keyframes nuiMgmtSlideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header */
.nui-mgmt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.nui-mgmt-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.nui-mgmt-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1;
}

.nui-mgmt-close:hover {
    background-color: #e9ecef;
    color: #333;
}

/* Toolbar */
.nui-mgmt-toolbar {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.nui-mgmt-search {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nui-mgmt-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.nui-mgmt-add-btn {
    background-color: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.nui-mgmt-add-btn:hover {
    background-color: #218838;
}

/* Error */
.nui-mgmt-error {
    margin: 0.5rem 1.5rem;
    padding: 0.5rem 1rem;
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 4px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Table container */
.nui-mgmt-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

/* Scrollbar styling */
.nui-mgmt-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.nui-mgmt-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.nui-mgmt-table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.nui-mgmt-table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Table */
.nui-mgmt-table {
    width: 100%;
    border-collapse: collapse;
}

.nui-mgmt-table thead {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.nui-mgmt-table th {
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nui-mgmt-th-id {
    width: 60px;
    text-align: center;
}

.nui-mgmt-th-status {
    width: 80px;
    text-align: center;
}

.nui-mgmt-th-actions {
    width: 50px;
    text-align: center;
}

.nui-mgmt-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.95rem;
    color: #333;
}

.nui-mgmt-td-id {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}

.nui-mgmt-td-status {
    text-align: center;
}

.nui-mgmt-td-actions {
    text-align: center;
}

/* Row states */
.nui-mgmt-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.nui-mgmt-row:hover {
    background-color: #f0f0ff;
}

.nui-mgmt-row--selected {
    background-color: #e8eaff;
}

.nui-mgmt-row--selected:hover {
    background-color: #dcdeff;
}

.nui-mgmt-row--inactive {
    opacity: 0.6;
}

.nui-mgmt-row--inactive td {
    text-decoration: line-through;
    color: #999;
}

.nui-mgmt-row--inactive .nui-mgmt-td-id,
.nui-mgmt-row--inactive .nui-mgmt-td-status,
.nui-mgmt-row--inactive .nui-mgmt-td-actions {
    text-decoration: none;
}

/* Active badge */
.nui-mgmt-active-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.nui-mgmt-active-badge--active {
    background-color: #d4edda;
    color: #155724;
}

.nui-mgmt-active-badge--active:hover {
    background-color: #c3e6cb;
}

.nui-mgmt-active-badge--inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.nui-mgmt-active-badge--inactive:hover {
    background-color: #f5c6cb;
}

/* Edit button in row */
.nui-mgmt-edit-btn {
    background: none;
    border: 1px solid #dee2e6;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    color: #666;
}

.nui-mgmt-edit-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #333;
}

/* Empty state */
.nui-mgmt-empty {
    text-align: center;
    padding: 2rem !important;
    color: #999;
    font-style: italic;
}

/* Footer */
.nui-mgmt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
}

.nui-mgmt-footer-info {
    font-size: 0.85rem;
    color: #666;
}

.nui-mgmt-footer-actions {
    display: flex;
    gap: 0.5rem;
}

.nui-mgmt-footer-edit-btn {
    background: none;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nui-mgmt-footer-edit-btn:hover {
    background-color: #667eea;
    color: white;
}

.nui-mgmt-delete-btn {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nui-mgmt-delete-btn:hover {
    background-color: #dc3545;
    color: white;
}

.nui-mgmt-select-btn {
    background-color: #667eea;
    color: white;
    padding: 0.4rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.nui-mgmt-select-btn:hover:not(:disabled) {
    background-color: #5568d3;
}

.nui-mgmt-select-btn:disabled {
    background-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}
