/* ============================================================
   Regulatory Radar — Console AI tab styles
   Contract Brain W5
   ============================================================ */

/* ── Wrapper ── */
.radar-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #f8fafc;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* ── Header ── */
.radar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    shrink: 0;
    gap: 12px;
    flex-shrink: 0;
}

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

.radar-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #f0fdf4);
    border: 1px solid #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    flex-shrink: 0;
}

.radar-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.2;
}

.radar-header-sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    margin: 0;
    line-height: 1;
}

.radar-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radar-btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 150ms, border-color 150ms;
}

.radar-btn-refresh:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* ── View switcher ── */
.radar-view-switcher {
    display: inline-flex;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.radar-view-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 150ms, color 150ms;
}

.radar-view-btn.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ── Content area ── */
.radar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Filter bar ── */
.radar-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    flex-shrink: 0;
}

.radar-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radar-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.radar-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.radar-chip {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 150ms;
    line-height: 1.4;
}

.radar-chip.active,
.radar-chip:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.radar-chip-critical.active { background: #dc2626; border-color: #dc2626; }
.radar-chip-medium.active   { background: #d97706; border-color: #d97706; }
.radar-chip-info.active     { background: #0ea5e9; border-color: #0ea5e9; }
.radar-chip-critical:hover  { background: #dc2626; border-color: #dc2626; color: #fff; }
.radar-chip-medium:hover    { background: #d97706; border-color: #d97706; color: #fff; }
.radar-chip-info:hover      { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }

/* ── Summary row ── */
.radar-summary-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radar-summary-count {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

.radar-loading-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    border-radius: 20px;
    animation: radarPulse 1.4s ease-in-out infinite;
}

@keyframes radarPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ── Alert feed ── */
.radar-alert-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Alert card ── */
.radar-alert-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow 150ms, border-color 150ms;
}

.radar-alert-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    border-color: #c7d2fe;
}

.radar-alert-card-new {
    border-left: 3px solid #6366f1;
}

.radar-alert-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.radar-alert-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.radar-alert-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Severity badges ── */
.radar-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.radar-badge-critical {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.radar-badge-medium {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.radar-badge-info {
    background: #f0f9ff;
    color: #0ea5e9;
    border: 1px solid #bae6fd;
}

/* ── Status pill ── */
.radar-status-pill {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.radar-status-new      { background: #eef2ff; color: #6366f1; }
.radar-status-ack      { background: #f0fdf4; color: #16a34a; }
.radar-status-resolved { background: #f8fafc; color: #475569; }
.radar-status-ignored  { background: #f8fafc; color: #94a3b8; }

/* ── New dot ── */
.radar-new-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6366f1;
    flex-shrink: 0;
    animation: radarPulse 2s ease-in-out infinite;
}

/* ── Source / domain chips ── */
.radar-alert-source {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.radar-domain-chip {
    padding: 2px 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

/* ── Impact summary ── */
.radar-alert-summary {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 8px;
}

/* ── Suggested action ── */
.radar-suggested-action {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* ── Alert footer ── */
.radar-alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.radar-alert-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.radar-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.radar-alert-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ── Action buttons ── */
.radar-btn-impact {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    cursor: pointer;
    transition: background 150ms;
}

.radar-btn-impact:hover { background: #e0e7ff; }

.radar-btn-ack {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 150ms;
}

.radar-btn-ack:hover { background: #dcfce7; }

.radar-btn-ignore {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 150ms;
}

.radar-btn-ignore:hover { background: #f1f5f9; }

/* ── Empty state ── */
.radar-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.radar-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eef2ff, #f0fdf4);
    border: 1px solid #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    margin-bottom: 14px;
}

.radar-empty h4 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.radar-empty p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
    max-width: 320px;
}

/* ── Sources table ── */
.radar-sources-table-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.radar-sources-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.radar-sources-table thead tr {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.radar-sources-table th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: left;
    white-space: nowrap;
}

.radar-source-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 100ms;
}

.radar-source-row:last-child { border-bottom: none; }
.radar-source-row:hover { background: #f8fafc; }

.radar-sources-table td {
    padding: 10px 14px;
    vertical-align: middle;
}

.radar-source-name {
    font-weight: 600;
    color: #0f172a;
}

.radar-source-jurisdiction {
    display: inline-block;
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.radar-source-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
}

.radar-source-date {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.radar-sources-empty {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}
