/* ==========================================================
   eCAP Domain Color System
   Badge/chip/indicator colors that exceed MudBlazor's palette slots.
   Uses .mud-chip compound selectors for reliable specificity.
   ========================================================== */

/* --- Status Colors --- */
.mud-chip.ecap-status-open        { background-color: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; font-weight: 500; }
.mud-chip.ecap-status-submitted   { background-color: #fef3c7; color: #92400e; border: 1px solid #fcd34d; font-weight: 500; }
.mud-chip.ecap-status-upgraded    { background-color: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; font-weight: 500; }
.mud-chip.ecap-status-closed      { background-color: #dcfce7; color: #166534; border: 1px solid #86efac; font-weight: 500; }
.mud-chip.ecap-status-rejected    { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-weight: 500; }

/* --- Priority Colors --- */
.mud-chip.ecap-priority-critical  { background-color: #fee2e2; color: #991b1b; font-weight: 500; }
.mud-chip.ecap-priority-high      { background-color: #ffedd5; color: #9a3412; font-weight: 500; }
.mud-chip.ecap-priority-medium    { background-color: #fef9c3; color: #854d0e; font-weight: 500; }
.mud-chip.ecap-priority-low       { background-color: #dcfce7; color: #166534; font-weight: 500; }

/* --- Case Type Colors --- */
.mud-chip.ecap-casetype-consultation       { background-color: #fee2e2; color: #991b1b; font-weight: 500; }
.mud-chip.ecap-casetype-early-resolution   { background-color: #fef3c7; color: #92400e; font-weight: 500; }
.mud-chip.ecap-casetype-escalated-referral { background-color: #dbeafe; color: #1e40af; font-weight: 500; }

/* --- Utility/Product Colors --- */
.mud-chip.ecap-utility-electricity { background-color: #fef9c3; color: #854d0e; border: 1px solid #fef08a; font-weight: 500; }
.mud-chip.ecap-utility-gas         { background-color: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; font-weight: 500; }
.mud-chip.ecap-utility-water       { background-color: #cffafe; color: #155e75; border: 1px solid #67e8f9; font-weight: 500; }

/* --- SLA / Days Remaining (chip style with derived backgrounds) --- */
.mud-chip.ecap-sla-overdue  { background-color: #fee2e2; color: #dc2626; font-weight: 500; }
.mud-chip.ecap-sla-urgent   { background-color: #ffedd5; color: #ea580c; font-weight: 500; }
.mud-chip.ecap-sla-warning  { background-color: #fef9c3; color: #ca8a04; font-weight: 500; }
.mud-chip.ecap-sla-ontrack  { background-color: #dcfce7; color: #16a34a; font-weight: 500; }

/* --- Closure Type Colors --- */
.mud-chip.ecap-closure-nocontact    { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-weight: 500; }
.mud-chip.ecap-closure-undertakings { background-color: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; font-weight: 500; }
.mud-chip.ecap-closure-satisfied    { background-color: #dcfce7; color: #166534; border: 1px solid #bbf7d0; font-weight: 500; }
.mud-chip.ecap-closure-dissatisfied { background-color: #fee2e2; color: #991b1b; border: 1px solid #fecaca; font-weight: 500; }

/* --- Activity Log Colors --- */
.ecap-activity-response { background-color: #dbeafe; border: 1px solid #bfdbfe; }
.ecap-activity-upload   { background-color: #f3e8ff; border: 1px solid #e9d5ff; }
.ecap-activity-assign   { background-color: #ffedd5; border: 1px solid #fed7aa; }
.ecap-activity-status   { background-color: #dcfce7; border: 1px solid #bbf7d0; }

.ecap-activity-response .ecap-activity-icon { color: #2563eb; }
.ecap-activity-upload .ecap-activity-icon   { color: #9333ea; }
.ecap-activity-assign .ecap-activity-icon   { color: #ea580c; }
.ecap-activity-status .ecap-activity-icon   { color: #16a34a; }

/* --- KPI Card --- */
.ecap-kpi-card {
    background: linear-gradient(to bottom right, #ffffff, #fafafa);
    border: 1px solid #e5e5e5;
}

.ecap-kpi-icon { color: #525252; }
.ecap-kpi-number { font-weight: 500; font-variant-numeric: tabular-nums; }
.ecap-kpi-label  { font-weight: 500; }
.ecap-kpi-icon-wrap { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background-color: #edf1fd; }
.ecap-kpi-icon-wrap .mud-icon-root { font-size: 24px !important; }

/* --- Requirement Status Chips --- */
.mud-chip.ecap-req-met        { background-color: #dcfce7; color: #166534; font-weight: 500; }
.mud-chip.ecap-req-inprogress { background-color: #fef3c7; color: #92400e; font-weight: 500; }
.mud-chip.ecap-req-notstarted { background-color: #fee2e2; color: #991b1b; font-weight: 500; }
.mud-chip.ecap-req-resolved   { background-color: #dcfce7; color: #166534; font-weight: 500; }
.mud-chip.ecap-req-unresolved { background-color: #fee2e2; color: #991b1b; font-weight: 500; }
.mud-chip .mud-icon-root,
.mud-chip .mud-chip-close-button .mud-svg-icon { font-size: 14px !important; width: 14px; height: 14px; }

/* --- Consultation Case Left Border Indicator --- */
.mud-table-body > tr.ecap-consultation-border > td:first-child { box-shadow: inset 4px 0 0 0 #f87171; }

/* --- Days Left Indicator Dots --- */
.ecap-dot        { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ecap-dot-red    { background-color: #dc2626; }
.ecap-dot-orange { background-color: #ea580c; }
.ecap-dot-green  { background-color: #16a34a; }
.ecap-dot-grey   { background-color: #a3a3a3; }

/* --- Days Left Text --- */
.ecap-days-text     { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; cursor: default; font-weight: 500; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.ecap-days-overdue  { color: #dc2626; }
.ecap-days-urgent   { color: #ea580c; }
.ecap-days-warning  { color: #ca8a04; }
.ecap-days-ontrack  { color: #16a34a; }

/* --- Days Left Tooltip Card (white background) --- */
.mud-tooltip.ecap-tooltip-card {
    background-color: #ffffff !important;
    color: var(--mud-palette-text-primary) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.mud-tooltip.ecap-tooltip-card.mud-tooltip-arrow::after {
    border-top-color: #ffffff !important;
}
.ecap-tooltip-label { color: var(--mud-palette-text-secondary); font-size: 0.75rem; margin-bottom: 2px; }
.ecap-tooltip-value { color: var(--mud-palette-text-primary); font-weight: 700; font-size: 1rem; margin-bottom: 8px; }

/* --- Team Member Role Colors --- */
.mud-chip.ecap-role-admin   { background-color: #f3e8ff; color: #6b21a8; font-weight: 500; }
.mud-chip.ecap-role-officer { background-color: #dbeafe; color: #1e40af; font-weight: 500; }

/* --- Team Member Status Colors --- */
.mud-chip.ecap-member-active   { background-color: #dcfce7; color: #166534; font-weight: 500; }
.mud-chip.ecap-member-inactive { background-color: #f5f5f5; color: #525252; font-weight: 500; }
.mud-chip.ecap-member-pending  { background-color: #fef3c7; color: #92400e; font-weight: 500; }

/* --- Transparent Tab Header --- */
.mud-tabs-tabbar.ecap-tabs-transparent {
    background-color: transparent !important;
    border-bottom: 1px solid #e0e0e0;
}

/* --- Files & Evidence --- */
.ecap-section-heading       { display: flex; align-items: center; gap: 8px; }
.ecap-section-accent        { width: 4px; height: 20px; background: #3459e6; border-radius: 2px; }
.ecap-section-accent-ewosa  { width: 4px; height: 20px; background: #7c3aed; border-radius: 2px; }
.ecap-file-card             { display: flex; align-items: center; gap: 12px; }
.ecap-file-card-member      { background: #f5f7ff; }
.ecap-file-icon             { color: #3459e6; }
.ecap-file-icon-ewosa       { color: #7c3aed; }
.ecap-file-detail           { flex: 1; min-width: 0; }
.ecap-file-actions          { display: flex; align-items: center; gap: 4px; }
.mud-chip.ecap-chip-ewosa   { background-color: #f3e8ff; color: #7c3aed; font-size: 0.7rem; font-weight: 500; }

/* --- Upload Drop Zone --- */
.ecap-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 24px;
    border: 2px dashed #d4d4d4;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.ecap-dropzone:hover {
    border-color: #3459e6;
    background-color: #f5f7ff;
}
.ecap-dropzone-input { display: none; }

/* --- Closure Step Circles --- */
.ecap-step-circle    { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.875rem; font-weight: 500; flex-shrink: 0; }
.ecap-step-active    { background-color: #3459e6; color: #ffffff; }
.ecap-step-complete  { background-color: #16a34a; color: #ffffff; }
.ecap-step-locked    { background-color: #d4d4d4; color: #737373; }

/* --- Closure Step Badges --- */
.mud-chip.ecap-step-badge-complete { background-color: #dcfce7; color: #166534; font-weight: 500; }
.mud-chip.ecap-step-badge-required { background-color: #fef3c7; color: #92400e; font-weight: 500; }
.mud-chip.ecap-step-badge-locked   { background-color: #f5f5f5; color: #525252; font-weight: 500; }

/* --- Unable to Contact Panel --- */
.ecap-unable-to-contact { background-color: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 16px; }

/* --- Yes/No Toggle Buttons --- */
.ecap-toggle-btn         { min-width: 100px; }
.ecap-toggle-active      { background-color: #3459e6 !important; color: #ffffff !important; border-color: #3459e6 !important; }
.ecap-toggle-active:hover { background-color: #2a47b8 !important; }

/* --- Save Status Indicator --- */
.ecap-save-status  { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; }
.ecap-save-saving  { color: #525252; }
.ecap-save-saved   { color: #16a34a; }

/* --- Closure Panel Header --- */
.ecap-closure-panel-header { display: flex; align-items: center; gap: 12px; width: 100%; }

/* --- Closure Page Header Bar --- */
.ecap-closure-header { background-color: #edf1fd; border-radius: 8px; padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; }
.ecap-closure-header-title { font-size: 1.25rem; font-weight: 700; color: #1a1a1a; }
.ecap-closure-header-save  { font-size: 0.875rem; color: #525252; }

/* --- Evidence Reference Badges --- */
.ecap-evidence-refs { padding: 12px; background-color: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; }

/* --- Drawer Brand --- */
.ecap-drawer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
}
.mud-drawer .mud-drawer-content {
    height: auto !important;
}

/* --- AppBar Search — responsive container --- */
.ecap-appbar-search { margin-left: 12px; min-width: 480px; }
@media (max-width: 959.98px) {
    .ecap-appbar-search { margin-left: 12px; min-width: 0; flex: 1 1 auto; }
}
@media (max-width: 599.98px) {
    .ecap-appbar-search { margin-left: 8px; }
}

/* --- Global Search — make adornment icon non-interactive --- */
.ecap-global-search .mud-input-adornment-start .mud-icon-button {
    pointer-events: none;
    background: transparent !important;
    padding: 4px;
    width: 28px;
    height: 28px;
}
.ecap-global-search .mud-input-adornment-start .mud-icon-button .mud-ripple { display: none; }
.ecap-global-search .mud-input-adornment-start { margin-left: 8px; }

/* --- Profile text — hide on narrow screens --- */
.ecap-profile-text { display: flex; }
@media (max-width: 959.98px) {
    .ecap-profile-text { display: none !important; }
}

/* --- Evidence Reference Inline Styles (extracted) --- */
.mud-chip.ecap-evidence-chip  { background-color: #dcfce7; color: #166534; font-size: 0.7rem; font-weight: 500; }
.ecap-evidence-btn            { border-color: #86efac !important; color: #15803d !important; }
.ecap-evidence-icon           { color: #15803d; }
.ecap-evidence-label          { color: #166534; font-weight: 600; }

/* --- Evidence Explorer Tab Buttons --- */
.ecap-tab-active   { border-bottom: 2px solid #3459e6; color: #3459e6; border-radius: 0 !important; }
.ecap-tab-inactive { color: #737373; border-radius: 0 !important; }

/* --- Evidence Explorer Selected State --- */
.ecap-evidence-selected        { background-color: #f0fdf4; border-color: #86efac; }
.mud-chip.ecap-selected-badge  { background-color: #dcfce7; color: #15803d; font-size: 0.65rem; font-weight: 500; }
.ecap-evidence-ref-btn         { background-color: #16a34a !important; color: white !important; }

/* --- Permission Indicator Dots --- */
.ecap-perm-dot       { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ecap-perm-dot-allow { background-color: #16a34a; }
.ecap-perm-dot-deny  { background-color: #dc2626; }

/* --- Default / Fallback --- */
.mud-chip.ecap-default { background-color: #f5f5f5; color: #262626; font-weight: 500; }
