/* ============================================================================
   EXECUTIVE RIGHT RAIL — Global Styles
   AC: SF-RP-001 through SF-RP-010

   This file is loaded globally (index.html) so styles apply across all three
   Quick Add modal components without being blocked by Blazor CSS isolation scoping.
   ============================================================================ */

/* ============================================================================
   QUICK ADD MODALS — Base Styles (SF-RP-005, SF-RP-009, SF-RP-010)
   Moved here from QuickAddTaskModal.razor.css to share across all three modals.
   ============================================================================ */

.qa-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: var(--sf-4);
}

.qa-modal {
    background: #ffffff;
    border-radius: var(--sf-radius, 8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.qa-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sf-4) var(--sf-4) var(--sf-3);
    border-bottom: 1px solid var(--sf-neutral-200, #e5e7eb);
}

.qa-modal__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sf-neutral-800, #1f2937);
    margin: 0;
}

.qa-modal__close {
    background: none;
    border: none;
    padding: var(--sf-1);
    cursor: pointer;
    color: var(--sf-neutral-400, #9ca3af);
    border-radius: var(--sf-radius-sm, 4px);
    transition: color 0.12s ease;
}

.qa-modal__close:hover { color: var(--sf-neutral-700, #374151); }

.qa-modal__close:focus-visible {
    outline: 2px solid var(--sf-primary-blue, #4f46e5);
    outline-offset: 2px;
}

.qa-modal__body {
    padding: var(--sf-4);
    display: flex;
    flex-direction: column;
    gap: var(--sf-3);
}

.qa-modal__field {
    display: flex;
    flex-direction: column;
    gap: var(--sf-1);
}

.qa-modal__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sf-neutral-700, #374151);
}

.qa-modal__input {
    padding: var(--sf-2) var(--sf-3);
    border: 1px solid var(--sf-neutral-300, #d1d5db);
    border-radius: var(--sf-radius-sm, 4px);
    font-size: 0.85rem;
    color: var(--sf-neutral-800, #1f2937);
    background: #ffffff;
    width: 100%;
    transition: border-color 0.12s ease;
}

.qa-modal__input:focus {
    outline: none;
    border-color: var(--sf-primary-blue, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.qa-modal__inline-error {
    font-size: 0.78rem;
    color: var(--sf-danger, #dc2626);
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--sf-radius-sm, 4px);
    padding: var(--sf-2) var(--sf-3);
}

.qa-modal__footer {
    display: flex;
    align-items: center;
    gap: var(--sf-2);
    padding: var(--sf-3) var(--sf-4) var(--sf-4);
    border-top: 1px solid var(--sf-neutral-100, #f3f4f6);
}

.qa-modal__btn-primary {
    padding: var(--sf-2) var(--sf-4);
    background: var(--sf-primary-blue, #4f46e5);
    color: #ffffff;
    border: none;
    border-radius: var(--sf-radius-sm, 4px);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--sf-2);
    transition: background 0.12s ease;
}

.qa-modal__btn-primary:hover:not(:disabled) { background: #4338ca; }

.qa-modal__btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.qa-modal__btn-primary:focus-visible {
    outline: 2px solid var(--sf-primary-blue, #4f46e5);
    outline-offset: 2px;
}

.qa-modal__btn-secondary {
    padding: var(--sf-2) var(--sf-3);
    background: none;
    border: 1px solid var(--sf-neutral-200, #e5e7eb);
    border-radius: var(--sf-radius-sm, 4px);
    font-size: 0.82rem;
    color: var(--sf-neutral-600, #4b5563);
    cursor: pointer;
    transition: background 0.12s ease;
}

.qa-modal__btn-secondary:hover { background: var(--sf-neutral-50, #f9fafb); }

.qa-modal__btn-secondary:focus-visible {
    outline: 2px solid var(--sf-primary-blue, #4f46e5);
    outline-offset: 2px;
}

/* ============================================================================
   THEME OVERRIDES — Light Theme
   ============================================================================ */

.theme-light .rail-column {
    background: #f8fafc !important;
    border-left-color: #e2e8f0 !important;
}

.theme-light .rr-section__heading {
    color: #1e293b !important;
    border-bottom-color: #e2e8f0 !important;
}

.theme-light .na-row__title,
.theme-light .sig-row__title,
.theme-light .hs-row__name {
    color: #1e293b !important;
}

.theme-light .na-row__meta,
.theme-light .sig-row__meta,
.theme-light .hs-row__due {
    color: #64748b !important;
}

.theme-light .na-row,
.theme-light .sig-row,
.theme-light .hs-row {
    border-bottom-color: #f1f5f9 !important;
}

.theme-light .na-row:hover,
.theme-light .sig-row:hover,
.theme-light .hs-row:hover {
    background: #f1f5f9 !important;
}

.theme-light .qa-add-btn {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

.theme-light .qa-add-btn:hover {
    background: #eef2ff !important;
    border-color: #4f46e5 !important;
    color: #4338ca !important;
}

.theme-light .qa-modal {
    background: #ffffff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

.theme-light .qa-modal__header {
    border-bottom-color: #e5e7eb !important;
}

.theme-light .qa-modal__input {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    color: #1f2937 !important;
}

/* ============================================================================
   THEME OVERRIDES — Dark Theme
   ============================================================================ */

.theme-dark .rail-column {
    background: #1e2330 !important;
    border-left-color: #374151 !important;
}

.theme-dark .rr-section__heading {
    color: #e2e8f0 !important;
    border-bottom-color: #374151 !important;
}

.theme-dark .na-row__title,
.theme-dark .sig-row__title,
.theme-dark .hs-row__name {
    color: #f1f5f9 !important;
}

.theme-dark .na-row__meta,
.theme-dark .sig-row__meta,
.theme-dark .hs-row__due {
    color: #9ca3af !important;
}

.theme-dark .na-row,
.theme-dark .sig-row,
.theme-dark .hs-row {
    border-bottom-color: #2d3748 !important;
}

.theme-dark .na-row:hover,
.theme-dark .sig-row:hover,
.theme-dark .hs-row:hover {
    background: #2d3748 !important;
}

.theme-dark .rr-empty-state {
    color: #9ca3af !important;
}

/* Signal badges — dark theme */
.theme-dark .sig-badge--overdue {
    background: #450a0a !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

.theme-dark .sig-badge--blocked {
    background: #431407 !important;
    color: #fdba74 !important;
    border-color: #7c2d12 !important;
}

.theme-dark .sig-badge--waiting {
    background: #1e3a5f !important;
    color: #93c5fd !important;
    border-color: #1e40af !important;
}

.theme-dark .sig-badge--next48h {
    background: #1a2e1a !important;
    color: #86efac !important;
    border-color: #166534 !important;
}

/* Quick Add panel — dark theme */
.theme-dark .qa-add-btn {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

.theme-dark .qa-add-btn:hover {
    background: #374151 !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* Quick Add modals — dark theme */
.theme-dark .qa-modal-backdrop {
    background: rgba(0, 0, 0, 0.6) !important;
}

.theme-dark .qa-modal {
    background: #1f2937 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

.theme-dark .qa-modal__header {
    border-bottom-color: #374151 !important;
}

.theme-dark .qa-modal__title {
    color: #f1f5f9 !important;
}

.theme-dark .qa-modal__close {
    color: #9ca3af !important;
}

.theme-dark .qa-modal__close:hover {
    color: #e5e7eb !important;
}

.theme-dark .qa-modal__body {
    background: #1f2937 !important;
}

.theme-dark .qa-modal__label {
    color: #d1d5db !important;
}

.theme-dark .qa-modal__input {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #f1f5f9 !important;
}

.theme-dark .qa-modal__input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.theme-dark .qa-modal__footer {
    border-top-color: #2d3748 !important;
    background: #1f2937 !important;
}

.theme-dark .qa-modal__btn-secondary {
    border-color: #374151 !important;
    color: #d1d5db !important;
}

.theme-dark .qa-modal__btn-secondary:hover {
    background: #374151 !important;
}

/* ============================================================================
   THEME OVERRIDES — Default (OS dark-mode preference)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .theme-default .rail-column {
        background: #1e2330 !important;
        border-left-color: #374151 !important;
    }

    .theme-default .rr-section__heading {
        color: #e2e8f0 !important;
        border-bottom-color: #374151 !important;
    }

    .theme-default .na-row__title,
    .theme-default .sig-row__title,
    .theme-default .hs-row__name {
        color: #f1f5f9 !important;
    }

    .theme-default .na-row__meta,
    .theme-default .sig-row__meta,
    .theme-default .hs-row__due {
        color: #9ca3af !important;
    }

    .theme-default .na-row:hover,
    .theme-default .sig-row:hover,
    .theme-default .hs-row:hover {
        background: #2d3748 !important;
    }

    .theme-default .qa-modal {
        background: #1f2937 !important;
    }

    .theme-default .qa-modal__header {
        border-bottom-color: #374151 !important;
    }

    .theme-default .qa-modal__title {
        color: #f1f5f9 !important;
    }

    .theme-default .qa-modal__input {
        background: #111827 !important;
        border-color: #374151 !important;
        color: #f1f5f9 !important;
    }

    .theme-default .qa-add-btn {
        background: #1f2937 !important;
        border-color: #374151 !important;
        color: #e5e7eb !important;
    }
}
