/* ===== Shared PSIRT Component Styles ===== */
/* Common styles extracted from page-specific <style> blocks */

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, .06));
    background: var(--bg-elevated, rgba(255, 255, 255, .06));
    color: var(--text-secondary, #94a3b8);
    transition: all .15s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-card, #1a2236);
    color: var(--text-primary, #f1f5f9);
    border-color: var(--border-accent, rgba(59, 130, 246, .3));
}

.btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(59, 130, 246, .3);
    color: #fff;
}

.btn-success {
    background: var(--accent-success, #10b981);
    color: #fff;
    border-color: transparent;
}

.btn-success:hover {
    background: #059669;
    color: #fff;
}

.btn-danger {
    background: transparent;
    color: #ef4444;
    border-color: rgba(239, 68, 68, .3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, .1);
}

.btn-outline {
    background: rgba(255, 255, 255, .04);
    color: var(--text-secondary, #94a3b8);
    border: 1px solid rgba(255, 255, 255, .1);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--text-primary, #f1f5f9);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
}

/* ===== Alerts ===== */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
    align-items: center;
    gap: 8px;
}

.alert.visible {
    display: flex;
}

.alert-success {
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .2);
    color: #34d399;
}

.alert-error {
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .2);
    color: #f87171;
}

.alert-warning {
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .2);
    color: #fbbf24;
}

/* ===== Modals ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal-panel {
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, .06));
    border-radius: 16px;
    padding: 24px;
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    animation: modalSlideIn .2s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-panel h3 {
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-field {
    margin-bottom: 14px;
}

.modal-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-card, #1a2236);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, .06));
    color: var(--text-primary, #f1f5f9);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
    border-color: var(--accent-primary, #3b82f6);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* ===== Form Inputs ===== */
.form-input {
    width: 100%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--text-primary, #f1f5f9);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all .2s;
}

.form-input:focus {
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 5px;
}

/* ===== Role Badges ===== */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.role-badge.super_admin {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
}

.role-badge.admin {
    background: rgba(139, 92, 246, .15);
    color: #a78bfa;
}

.role-badge.analyst {
    background: rgba(59, 130, 246, .15);
    color: #60a5fa;
}

.role-badge.viewer {
    background: rgba(100, 116, 139, .15);
    color: #94a3b8;
}

.role-badge.limited {
    background: rgba(245, 158, 11, .15);
    color: #f59e0b;
}

/* ===== Empty States ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted, #64748b);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    opacity: .2;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    max-width: 400px;
    line-height: 1.6;
    margin: 0 auto;
}

/* ===== Spinner ===== */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

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

/* ===== Light Theme Overrides ===== */
.light-theme .btn {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

.light-theme .btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.light-theme .btn-primary {
    color: #fff;
    border-color: transparent;
}

.light-theme .btn-primary:hover {
    color: #fff;
}

.light-theme .btn-danger {
    background: transparent;
    color: #dc2626;
    border-color: rgba(220, 38, 38, .3);
}

.light-theme .btn-outline {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.light-theme .alert-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}

.light-theme .alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.light-theme .alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

.light-theme .modal-panel {
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .12);
}

.light-theme .modal-field input,
.light-theme .modal-field select,
.light-theme .modal-field textarea {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

.light-theme .form-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

.light-theme .form-input:focus {
    background: #fff;
    border-color: #3b82f6;
}

.light-theme .empty-state {
    color: #94a3b8;
}

.light-theme .spinner {
    border-color: rgba(0, 0, 0, .15);
    border-top-color: #3b82f6;
}