/* ============================================
   CALLSLAYER BETA - MOBILE-FIRST UI
   Design: Apple clarity + Linear focus + Stripe authority
   Updated: 2025-12-25 v2
   ============================================ */

/* Pulse Animation for Primary Actions */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

:root {
    /* Color System - Light Mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-elevated: #ffffff;
    
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-muted: rgba(37, 99, 235, 0.1);
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --accent-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --text-tertiary: #6b7280;
    
    --color-success: #059669;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --color-info: #0284c7;
    
    /* Priority Colors */
    --priority-high: #dc2626;
    --priority-high-glow: rgba(220, 38, 38, 0.2);
    --priority-medium: #d97706;
    --priority-medium-glow: rgba(217, 119, 6, 0.2);
    --priority-low: #2563eb;
    --priority-low-glow: rgba(37, 99, 235, 0.2);
    
    --border-light: #e5e7eb;
    --border-subtle: #e5e7eb;
    --border-medium: #d1d5db;
    
    --success: #059669;
    --success-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
    --warning: #d97706;
    --warning-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --error: #dc2626;
    --error-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    
    /* Layout */
    --top-bar-height: 56px;
    --action-bar-height: 72px;
    --max-content-width: 640px;
    
    /* Shadows - Lighter for light mode */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
    padding-top: var(--top-bar-height);
    padding-bottom: var(--action-bar-height);
}

body.mobile-ui {
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F3F4F6;
    --bg-elevated: #FFFFFF;
    --border-light: #E5E7EB;
    --border-subtle: #E5E7EB;
    --border-medium: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    background: var(--bg-primary);
}

body.mobile-ui .top-bar {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
}

body.mobile-ui .bottom-nav {
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
}

body.mobile-ui .card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

body.mobile-ui .card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    border-color: #E5E7EB;
}

body.mobile-ui .hub-bucket-body {
    position: relative;
    margin-left: 12px !important;
    padding-left: 18px !important;
    padding-right: 8px !important;
    padding-top: 12px !important;
    padding-bottom: 4px !important;
    border-top: 0 !important;
}

body.mobile-ui .hub-bucket-body::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: #CBD5E1; /* default slate-300 */
    border-radius: 999px;
}

/* Hub: subtle per-bucket color accents (rail, header underline, card edge) */
body.mobile-ui .hub-bucket-header {
    position: relative;
    border-left-style: solid;
    border-left-width: 3px; /* default (expanded) */
    border-left-color: transparent;
}

/* Bucket header text color (name + count) per bucket */
body.mobile-ui .hub-bucket[data-bucket="SAFE"]   .hub-bucket-name,
body.mobile-ui .hub-bucket[data-bucket="SAFE"]   [data-bucket-count="SAFE"] { color: #047857; /* emerald-700 */ }

body.mobile-ui .hub-bucket[data-bucket="UNSURE"] .hub-bucket-name,
body.mobile-ui .hub-bucket[data-bucket="UNSURE"] [data-bucket-count="UNSURE"] { color: #1d4ed8; /* blue-700 */ }

body.mobile-ui .hub-bucket[data-bucket="SPAM"]   .hub-bucket-name,
body.mobile-ui .hub-bucket[data-bucket="SPAM"]   [data-bucket-count="SPAM"] { color: #b91c1c; /* red-700 */ }

body.mobile-ui .hub-bucket[data-bucket="IGNORE"] .hub-bucket-name,
body.mobile-ui .hub-bucket[data-bucket="IGNORE"] [data-bucket-count="IGNORE"] { color: #a21caf; /* fuchsia-700 */ }

/* Vertical rail color per bucket */
body.mobile-ui .hub-bucket[data-bucket="SAFE"]   .hub-bucket-body::before { background: rgba(16, 185, 129, 0.85); }
body.mobile-ui .hub-bucket[data-bucket="UNSURE"] .hub-bucket-body::before { background: rgba(37, 99, 235, 0.85); }
body.mobile-ui .hub-bucket[data-bucket="SPAM"]   .hub-bucket-body::before { background: rgba(239, 68, 68, 0.90); }
body.mobile-ui .hub-bucket[data-bucket="IGNORE"] .hub-bucket-body::before { background: rgba(217, 70, 239, 0.90); }

/* Remove header underline accents per feedback */
body.mobile-ui .hub-bucket .hub-bucket-header::after { display: none !important; }

/* Do not show the vertical rail when bucket is open */
body.mobile-ui .hub-bucket.is-open .hub-bucket-body::before { display: none; }

/* Header: colored left edge per bucket (applies to both states) */
body.mobile-ui .hub-bucket[data-bucket="SAFE"]   .hub-bucket-header { border-left-color: rgba(16, 185, 129, 0.95); }
body.mobile-ui .hub-bucket[data-bucket="UNSURE"] .hub-bucket-header { border-left-color: rgba(37, 99, 235, 0.95); }
body.mobile-ui .hub-bucket[data-bucket="SPAM"]   .hub-bucket-header { border-left-color: rgba(239, 68, 68, 0.98); }
body.mobile-ui .hub-bucket[data-bucket="IGNORE"] .hub-bucket-header { border-left-color: rgba(217, 70, 239, 0.98); }

/* Expanded header: slimmer edge */
body.mobile-ui .hub-bucket.is-open .hub-bucket-header { border-left-width: 2px; }

/* Collapsed header: thicker edge */
body.mobile-ui .hub-bucket:not(.is-open) .hub-bucket-header { border-left-width: 2.5px; }

/* Card left-edge accent per bucket */
body.mobile-ui .hub-bucket[data-bucket="SAFE"]   .hub-card { border-left: 4px solid rgba(16, 185, 129, 0.95) !important; }
body.mobile-ui .hub-bucket[data-bucket="UNSURE"] .hub-card { border-left: 4px solid rgba(37, 99, 235, 0.95) !important; }
body.mobile-ui .hub-bucket[data-bucket="SPAM"]   .hub-card { border-left: 4px solid rgba(239, 68, 68, 0.98) !important; }
body.mobile-ui .hub-bucket[data-bucket="IGNORE"] .hub-card { border-left: 4px solid rgba(217, 70, 239, 0.98) !important; }

body.mobile-ui .hub-bucket-body .hub-card {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
}

/* Expanded buckets: make card left-edge thinner (1px) while preserving color */
body.mobile-ui .hub-bucket.is-open .hub-card { border-left-width: 1px !important; }

/* High-DPI (Retina): simulate hairline 0.5px edge for expanded cards */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body.mobile-ui .hub-bucket.is-open .hub-card { border-left-width: 0.5px !important; }
}

/* ============================================
   DASHBOARD CASE BOARD ACCENTS
   ============================================ */
body.mobile-ui.dashboard-case-board .m-section-header {
  position: relative;
  border-left-style: solid;
  border-left-width: 2px; /* default; will be overridden by collapsed rule */
  border-left-color: transparent;
}
/* Remove vestigial bottom line under each dashboard section */
body.mobile-ui.dashboard-case-board .m-section { border-bottom: none !important; }

/* Collapsed vs expanded thickness */
body.mobile-ui.dashboard-case-board .m-section:not(.is-open) .m-section-header { border-left-width: 2.5px; }
body.mobile-ui.dashboard-case-board .m-section.is-open .m-section-header { border-left-width: 2px; }

/* Section header text colors (title) */
body.mobile-ui.dashboard-case-board .m-section[data-section="case_ready"]   .m-row-title { color: #047857; }
body.mobile-ui.dashboard-case-board .m-section[data-section="sent_demand"]  .m-row-title { color: #1d4ed8; }
body.mobile-ui.dashboard-case-board .m-section[data-section="waiting_response"] .m-row-title { color: #7c3aed; }
body.mobile-ui.dashboard-case-board .m-section[data-section="gathering_evidence"] .m-row-title { color: #b45309; }
body.mobile-ui.dashboard-case-board .m-section[data-section="low_collectability"] .m-row-title { color: #b91c1c; }
body.mobile-ui.dashboard-case-board .m-section[data-section="likely_dead_end"] .m-row-title { color: #374151; }
body.mobile-ui.dashboard-case-board .m-section[data-section="resolved"] .m-row-title { color: #6b7280; }

/* Header left-edge per section (matches existing border colors) */
body.mobile-ui.dashboard-case-board .m-section[data-section="case_ready"]   .m-section-header { border-left-color: rgba(16, 185, 129, 0.95); }
body.mobile-ui.dashboard-case-board .m-section[data-section="sent_demand"]  .m-section-header { border-left-color: rgba(59, 130, 246, 0.95); }
body.mobile-ui.dashboard-case-board .m-section[data-section="waiting_response"] .m-section-header { border-left-color: rgba(139, 92, 246, 0.95); }
body.mobile-ui.dashboard-case-board .m-section[data-section="gathering_evidence"] .m-section-header { border-left-color: rgba(245, 158, 11, 0.95); }
body.mobile-ui.dashboard-case-board .m-section[data-section="low_collectability"] .m-section-header { border-left-color: rgba(239, 68, 68, 0.98); }
body.mobile-ui.dashboard-case-board .m-section[data-section="likely_dead_end"] .m-section-header { border-left-color: rgba(107, 114, 128, 0.95); }
body.mobile-ui.dashboard-case-board .m-section[data-section="resolved"] .m-section-header { border-left-color: rgba(229, 231, 235, 0.95); }

/* Open-state glow per section (subtle) */
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="case_ready"]   .m-section-header { box-shadow: 0 2px 12px rgba(16, 185, 129, 0.14) !important; border-color: rgba(16, 185, 129, 0.35) !important; }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="sent_demand"]  .m-section-header { box-shadow: 0 2px 12px rgba(59, 130, 246, 0.14) !important; border-color: rgba(59, 130, 246, 0.35) !important; }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="waiting_response"] .m-section-header { box-shadow: 0 2px 12px rgba(139, 92, 246, 0.14) !important; border-color: rgba(139, 92, 246, 0.35) !important; }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="gathering_evidence"] .m-section-header { box-shadow: 0 2px 12px rgba(245, 158, 11, 0.14) !important; border-color: rgba(245, 158, 11, 0.35) !important; }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="low_collectability"] .m-section-header { box-shadow: 0 2px 12px rgba(239, 68, 68, 0.14) !important; border-color: rgba(239, 68, 68, 0.40) !important; }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="likely_dead_end"] .m-section-header { box-shadow: 0 2px 12px rgba(107, 114, 128, 0.14) !important; border-color: rgba(107, 114, 128, 0.35) !important; }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="resolved"] .m-section-header { box-shadow: 0 2px 12px rgba(229, 231, 235, 0.14) !important; border-color: rgba(229, 231, 235, 0.40) !important; }

/* Expanded sections: thin colored left edge on rows */
/* Expanded sections: thin colored left edge on rows (explicit per section colors) */
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="case_ready"]            .m-row { border-left: 1px solid rgba(16, 185, 129, 0.95); }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="sent_demand"]           .m-row { border-left: 1px solid rgba(59, 130, 246, 0.95); }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="waiting_response"]      .m-row { border-left: 1px solid rgba(139, 92, 246, 0.95); }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="gathering_evidence"]    .m-row { border-left: 1px solid rgba(245, 158, 11, 0.95); }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="low_collectability"]    .m-row { border-left: 1px solid rgba(239, 68, 68, 0.98); }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="likely_dead_end"]       .m-row { border-left: 1px solid rgba(107, 114, 128, 0.95); }
body.mobile-ui.dashboard-case-board .m-section.is-open[data-section="resolved"]              .m-row { border-left: 1px solid rgba(229, 231, 235, 0.95); }

/* High-DPI hairline rows (0.5px) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body.mobile-ui.dashboard-case-board .m-section.is-open .m-row { border-left-width: 0.5px; }
}

/* Open-state glow uses the same identifying color per bucket */
body.mobile-ui .hub-bucket.is-open[data-bucket="SAFE"]   .hub-bucket-header { box-shadow: 0 2px 12px rgba(16, 185, 129, 0.14) !important; border-color: rgba(16, 185, 129, 0.35) !important; }
body.mobile-ui .hub-bucket.is-open[data-bucket="UNSURE"] .hub-bucket-header { box-shadow: 0 2px 12px rgba(37, 99, 235, 0.14) !important; border-color: rgba(37, 99, 235, 0.35) !important; }
body.mobile-ui .hub-bucket.is-open[data-bucket="SPAM"]   .hub-bucket-header { box-shadow: 0 2px 12px rgba(239, 68, 68, 0.14) !important; border-color: rgba(239, 68, 68, 0.40) !important; }
body.mobile-ui .hub-bucket.is-open[data-bucket="IGNORE"] .hub-bucket-header { box-shadow: 0 2px 12px rgba(217, 70, 239, 0.14) !important; border-color: rgba(217, 70, 239, 0.40) !important; }

body.mobile-ui .hub-bucket-header {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body.mobile-ui .hub-bucket-header:active {
    transform: scale(0.995);
}

body.mobile-ui [data-bucket-toggle-label] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid #E5E7EB;
    background: #F9FAFB;
    font-weight: 600 !important;
}

body.mobile-ui [data-bucket-toggle-label]::after {
    content: '▾';
    font-size: 12px;
    line-height: 1;
    color: #6B7280;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

body.mobile-ui .hub-bucket.is-open .hub-bucket-header {
    border-color: #C7D2FE !important;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.08);
}

body.mobile-ui .hub-bucket.is-open [data-bucket-toggle-label] {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
    color: #B91C1C !important;
}

body.mobile-ui .hub-bucket.is-open [data-bucket-toggle-label]::after {
    transform: rotate(180deg);
    color: #B91C1C;
}

p {
    margin: 0 0 var(--space-sm) 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

/* ============================================
   TOP BAR (STICKY)
   ============================================ */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.top-bar-content {
    max-width: var(--max-content-width);
    margin: 0 auto;
    height: 100%;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-back {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateX(-2px);
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.case-company {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.case-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.case-number {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.case-phone {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-reenrich {
    background: var(--accent-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 36px;
}

.btn-reenrich:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.btn-reenrich:active {
    transform: scale(0.98);
}

.btn-reenrich:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-reenrich:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    transform: none;
}

.status-message {
    font-weight: 600;
    border-radius: 8px;
}

.status-message.loading {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.status-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-subtle);
}

#statusPillSection {
    padding: 10px 18px;
    font-size: 16px;
    font-weight: 700;
}

.status-pill:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.status-pill.priority-high {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--priority-high);
    box-shadow: 0 0 12px var(--priority-high-glow);
}

.status-pill.priority-medium {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--priority-medium);
    box-shadow: 0 0 12px var(--priority-medium-glow);
}

.status-pill.priority-low {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--priority-low);
    box-shadow: 0 0 12px var(--priority-low-glow);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px currentColor;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-pill.ready .status-dot {
    background: var(--success);
}

.status-pill.pending .status-dot {
    background: var(--warning);
}

.status-pill.needs-forensics {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.status-pill.needs-forensics .status-dot {
    background: rgb(59, 130, 246);
}

.confidence-badge.needs-forensics {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: rgb(59, 130, 246);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    padding-bottom: 160px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-secondary);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    padding: var(--space-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
    border-color: rgba(148, 163, 184, 0.2);
}

/* ============================================
   CASE VIEW (BETA) - MOBILE REFINEMENT
   Scope: Case view panels in /beta?group_id=...
   Constraints: CSS-only, no DOM/JS/copy changes
   ============================================ */

@media (max-width: 420px) {
    /* Page rhythm: calm, consistent padding and spacing between panels */
    .main-content {
        padding: 20px 16px;
        gap: 20px;
    }

    /* Panels feel contained (slightly tighter radius + softer border/shadow) */
    #impactCard,
    #nextStepsCard,
    #ccrCard,
    #ccrOutboxCard,
    #caseIntelligenceCard,
    #enforcementAuditPanel .card,
    #carrierAccountabilityPanel .card {
        border-radius: 14px;
        border-color: rgba(148, 163, 184, 0.10);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 26px rgba(15, 23, 42, 0.18);
    }

    /* Reduce “shouting” in case-only headers/subheads */
    #caseIntelligenceCard .section-subtitle,
    #caseIntelligenceCard .overview-label {
        text-transform: none;
        letter-spacing: 0.02em;
        font-weight: 600;
        color: var(--text-tertiary);
    }

    /* Avoid side drift on hover inside case facts */
    #caseIntelligenceCard .overview-item:hover .overview-value {
        transform: none;
        color: var(--text-primary);
    }

    /* Better containment for CCR status surfaces */
    #ccrCard .ccr-status-panel,
    #ccrOutboxCard .ccr-status-panel {
        border-radius: 14px;
        border-color: rgba(148, 163, 184, 0.10);
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 10px 24px rgba(15, 23, 42, 0.16);
    }
}

/* Mobile/touch devices: remove floaty hover motion on case panels */
@media (hover: none) and (pointer: coarse) {
    #impactCard:hover,
    #nextStepsCard:hover,
    #ccrCard:hover,
    #ccrOutboxCard:hover,
    #caseIntelligenceCard:hover,
    #enforcementAuditPanel .card:hover,
    #carrierAccountabilityPanel .card:hover {
        transform: none;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 26px rgba(15, 23, 42, 0.18);
        border-color: rgba(148, 163, 184, 0.10);
    }
}

.card-impact {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.collapse-icon {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.card.collapsible.open .collapse-icon {
    transform: rotate(180deg);
}

/* ============================================
   IMPACT BAR (HERO)
   ============================================ */

.impact-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.impact-damages {
    flex: 1;
}

.damages-amount {
    font-size: 32px;
    font-weight: 700;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: var(--space-xs);
    text-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    position: relative;
    z-index: 1;
}

.damages-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.impact-violations {
    text-align: right;
}

.violations-count {
    font-size: 20px;
    font-weight: 700;
    background: var(--warning-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
}

.violations-range {
    font-size: 12px;
    color: var(--text-tertiary);
}

.btn-expand {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: var(--space-sm);
    min-height: 48px;
}

.btn-expand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.btn-expand:hover {
    color: var(--text-primary);
}

.btn-expand:hover::after {
    width: 100%;
}

.expand-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.btn-expand.open .expand-icon {
    transform: rotate(180deg);
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.expandable-content.open {
    max-height: 1000px;
    margin-top: var(--space-md);
    opacity: 1;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease 0.1s;
}

.reasoning-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.reasoning-text:last-child {
    margin-bottom: 0;
}

/* ============================================
   CASE OVERVIEW
   ============================================ */

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overview-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overview-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.overview-item:hover .overview-value {
    color: var(--accent-primary);
    transform: translateX(2px);
}

.overview-item:hover .overview-label {
    color: var(--text-primary);
}

/* ============================================
   FORENSICS
   ============================================ */

.forensics-section {
    margin-bottom: var(--space-lg);
}

.forensics-section:last-child {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.forensics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.forensics-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.forensics-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.forensics-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.evidence-summary {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.snippets-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.snippet {
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    border-left: 2px solid var(--accent-primary);
}

.empty-state {
    font-size: 13px;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ============================================
   CCR PANEL
   ============================================ */

.ccr-status {
    margin-bottom: var(--space-md);
}

.ccr-state {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.ccr-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

.ccr-explanation {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.ccr-explanation:last-of-type {
    margin-bottom: var(--space-md);
}

.ccr-subtext {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    font-style: italic;
}

.ccr-benefits {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0;
}

.ccr-benefits li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-left: var(--space-md);
    margin-bottom: var(--space-xs);
    position: relative;
}

.ccr-benefits li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-warning);
    font-weight: bold;
}

/* ============================================
   DEMAND READINESS
   ============================================ */

.demand-status {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.demand-state {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.demand-explanation {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* ============================================
   USER DISCOVERY
   ============================================ */

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card.collapsible.open .collapsible-content {
    max-height: 1000px;
    margin-top: var(--space-md);
}

.helper-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group textarea {
    resize: vertical;
}

.helper-links {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.helper-link {
    font-size: 13px;
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.helper-link:hover {
    color: var(--accent-hover);
}

/* ============================================
   CONFIRMATION PROMPTS
   ============================================ */

.confirmation-prompt {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.confirmation-question {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.confirmation-buttons {
    display: flex;
    gap: var(--space-sm);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 12px var(--space-md);
    border: none;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
}

.btn-success {
    background: var(--color-success);
    color: #ffffff;
}

.btn-success:hover {
    background: #047857;
}

.btn-confirm {
    flex: 1;
    background: var(--success);
    color: white;
}

.btn-confirm:hover {
    background: #059669;
}

.btn-neutral {
    flex: 1;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-neutral:hover {
    background: var(--bg-elevated);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: calc(var(--action-bar-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 99;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.fab.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   CONTEXTUAL ACTIONS (Above Nav)
   ============================================ */

.contextual-actions {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    max-width: var(--max-content-width);
    width: 100%;
    background: transparent;
    z-index: 99;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scrollbar-width: none;
    box-sizing: border-box;
}

.contextual-actions::-webkit-scrollbar {
    display: none;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn-primary {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn-primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.action-btn-primary:active {
    transform: scale(0.96) translateY(0);
}

.action-btn-secondary {
    background: rgba(71, 85, 105, 0.8);
    color: #ffffff;
    border-color: rgba(148, 163, 184, 0.3);
}

.action-btn-secondary:hover {
    background: rgba(71, 85, 105, 1);
    border-color: var(--accent-primary);
    color: #ffffff;
}

.action-btn-danger {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.action-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.action-btn-danger:active {
    transform: scale(0.96) translateY(0);
}

.action-btn-success {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

.action-btn-success:hover {
    background: #047857;
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.action-btn-success:active {
    transform: scale(0.96) translateY(0);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: var(--max-content-width);
    width: 100%;
    height: 72px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    z-index: 100;
    backdrop-filter: blur(10px);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px var(--space-sm);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 56px;
    position: relative;
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 3px 3px;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-item.active .nav-label {
    font-weight: 700;
}

.btn-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.action-btn-primary .btn-text {
    font-weight: 700;
    font-size: 14px;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-intro {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.modal-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.modal-note {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-tertiary);
    font-style: italic;
    margin-top: var(--space-lg);
    padding: var(--space-sm);
    background: var(--accent-muted);
    border-radius: 6px;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

.coached-list {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0;
}

.coached-list li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: var(--space-xs) 0 var(--space-xs) var(--space-md);
    position: relative;
}

.coached-list li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-info);
    font-weight: bold;
}

.coached-list.warning li:before {
    content: '⚠';
    color: var(--color-warning);
}

.impasse-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.btn-large {
    padding: var(--space-md) var(--space-lg);
    font-size: 15px;
    min-height: 56px;
}

.brief-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: var(--space-lg) 0 var(--space-sm) 0;
}

.brief-section-title:first-child {
    margin-top: 0;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-medium);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-primary);
}

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.tile {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tile:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.tile-primary {
    border-color: rgba(34, 197, 94, 0.3);
}

.tile-warning {
    border-color: rgba(245, 158, 11, 0.3);
}

.tile-info {
    border-color: rgba(0, 212, 255, 0.3);
}

.tile-info .tile-value {
    color: var(--accent-primary);
}

.tile-secondary {
    border-color: rgba(148, 163, 184, 0.2);
}

.tile-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.tile-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.sort-controls {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    padding-bottom: var(--space-xs);
}

.sort-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

.sort-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.sort-btn:hover::before {
    width: 200%;
    height: 200%;
}

.sort-btn:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.sort-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.4);
}

.sort-btn:active {
    transform: translateY(0);
}

.groups-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.group-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.group-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.group-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.group-card:hover::after {
    opacity: 1;
}

.group-card:active {
    transform: translateY(-2px);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.group-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.confidence-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.confidence-high {
    background: rgba(34, 197, 94, 0.15);
    color: var(--color-success);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.confidence-high:hover {
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.confidence-medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.confidence-medium:hover {
    background: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.confidence-low {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-tertiary);
    border-color: rgba(148, 163, 184, 0.3);
}

.group-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.activity-badge {
    margin-top: var(--space-sm);
    margin-left: auto;
    margin-right: auto;
    padding: 6px 10px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--color-info);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    width: fit-content;
    text-align: center;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
    }
    50% { 
        box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
    }
}

.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.error-state {
    color: var(--error);
}

/* ============================================
   RESPONSIVE (DESKTOP)
   ============================================ */

@media (min-width: 768px) {
    .main-content {
        padding: var(--space-lg);
    }
    
    .overview-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .impact-bar {
        gap: var(--space-xl);
    }
    
    .damages-amount {
        font-size: 24px;
    }
    
    .action-bar {
        justify-content: center;
        gap: var(--space-md);
    }
    
    .action-btn {
        max-width: 160px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

/* ============================================
   HELP BUTTON
   ============================================ */

.help-btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    padding: 0;
}

.help-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: scale(1.1);
}

.help-btn:active {
    transform: scale(0.95);
}

/* ============================================
   CCR STATUS PANEL (PHASE A - READ-ONLY)
   ============================================ */

.ccr-status-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.ccr-status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ccr-status-icon {
    font-size: 24px;
}

.ccr-status-headline {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ccr-status-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.ccr-timestamp {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.ccr-attribution {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ccr-attribution-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ccr-attribution div {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ccr-error {
    margin-top: 12px;
    padding: 12px;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.ccr-error-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-danger);
    margin-bottom: 8px;
}

.ccr-error div {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Status-specific styling */
.ccr-status-panel[data-status="not_sent"] {
    border-left: 4px solid var(--text-tertiary);
}

.ccr-status-panel[data-status="monitoring"] {
    border-left: 4px solid var(--color-info);
}

.ccr-status-panel[data-status="triggered"] {
    border-left: 4px solid var(--color-warning);
}

.ccr-status-panel[data-status="sent"] {
    border-left: 4px solid var(--accent-primary);
}

.ccr-status-panel[data-status="responded"] {
    border-left: 4px solid var(--color-success);
}

.ccr-status-panel[data-status="no_response"] {
    border-left: 4px solid var(--color-warning);
}

.ccr-status-panel[data-status="escalated"] {
    border-left: 4px solid var(--priority-high);
}

.ccr-status-panel[data-status="closed"] {
    border-left: 4px solid var(--text-tertiary);
    opacity: 0.8;
}
