/* === DASHBOARD CSS — Compliance status dashboard for ComplyAI === */

/* Override page padding to account for fixed navbar */
.dash-main {
  padding: 80px 20px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

/* === STATUS BANNER === */
.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.status-banner.status--ok {
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.status-banner.status--warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-banner.status--critical {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: banner-pulse 3s ease-in-out infinite;
}

@keyframes banner-pulse {
  0%, 100% { border-color: rgba(239, 68, 68, 0.2); }
  50% { border-color: rgba(239, 68, 68, 0.5); }
}

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

.status-dot-lg {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status--ok .status-dot-lg { background: #14B8A6; box-shadow: 0 0 10px rgba(20,184,166,0.6); }
.status--warning .status-dot-lg { background: #F59E0B; box-shadow: 0 0 10px rgba(245,158,11,0.6); }
.status--critical .status-dot-lg { background: #EF4444; box-shadow: 0 0 10px rgba(239,68,68,0.6); animation: dot-pulse 1.5s ease-in-out infinite; }

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

.status-label {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.status-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.status-right {
  text-align: right;
  flex-shrink: 0;
}

.business-name {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.last-updated {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* === DASH GRID === */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  margin-bottom: 20px;
}

.dash-col-primary { display: flex; flex-direction: column; gap: 20px; }
.dash-col-secondary { display: flex; flex-direction: column; gap: 20px; }

/* === PANELS === */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title-row h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* === BADGES === */
.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 100px;
}

.badge--red {
  background: rgba(239,68,68,0.12);
  color: #F87171;
  border: 1px solid rgba(239,68,68,0.2);
}

.badge--green {
  background: rgba(20,184,166,0.12);
  color: #2DD4BF;
  border: 1px solid rgba(20,184,166,0.2);
}

.badge--count {
  background: rgba(96,165,250,0.12);
  color: #60A5FA;
  border: 1px solid rgba(96,165,250,0.2);
}

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  text-align: center;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === VIOLATIONS LIST === */
.violation-list, .alerts-list, .checks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.violation-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(239,68,68,0.04);
  border: 1px solid rgba(239,68,68,0.1);
  transition: background 0.2s;
}

.violation-item:hover {
  background: rgba(239,68,68,0.08);
}

.violation--critical { border-color: rgba(239,68,68,0.25); }
.violation--high { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.04); }
.violation--medium { border-color: rgba(245,158,11,0.15); }

.violation-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.violation--critical .violation-dot { background: #EF4444; }
.violation--high .violation-dot { background: #F59E0B; }
.violation--medium .violation-dot { background: #FCD34D; }
.violation--low .violation-dot { background: #94A3B8; }

.violation-body {
  flex: 1;
  min-width: 0;
}

.violation-reg {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  margin-bottom: 2px;
}

.violation-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.violation-due {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* === SEVERITY BADGES === */
.sev-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  align-self: center;
}

.sev--critical { background: rgba(239,68,68,0.15); color: #F87171; }
.sev--high { background: rgba(245,158,11,0.15); color: #FCD34D; }
.sev--medium { background: rgba(245,158,11,0.08); color: #FBBF24; }
.sev--low { background: rgba(148,163,184,0.12); color: #94A3B8; }

/* === ALERTS LIST === */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(245,158,11,0.03);
  border: 1px solid rgba(245,158,11,0.08);
}

.alert-indicator {
  width: 3px;
  min-height: 40px;
  border-radius: 2px;
  background: var(--accent-amber);
  flex-shrink: 0;
  opacity: 0.6;
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.alert-content {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.alert-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  align-self: center;
}

/* === SCORE CARD === */
.panel--score {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(29,78,216,0.08) 100%);
  border-color: rgba(29,78,216,0.15);
}

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

.score-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.score-meter {
  flex: 1;
  height: 6px;
  background: rgba(148,163,184,0.12);
  border-radius: 100px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, #14B8A6 0%, #2DD4BF 100%);
  border-radius: 100px;
  transition: width 0.6s ease;
}

.score-pct {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #2DD4BF;
  flex-shrink: 0;
}

.score-breakdown {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.breakdown-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.breakdown-item:not(:last-child) {
  border-right: 1px solid var(--border);
}

.breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown--ok .breakdown-dot { background: #14B8A6; }
.breakdown--pending .breakdown-dot { background: #F59E0B; }
.breakdown--violation .breakdown-dot { background: #EF4444; }

.breakdown-count {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 16px;
}

.breakdown-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* === CHECKS LIST === */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(12,27,51,0.3);
  transition: border-color 0.2s, background 0.2s;
}

.check-item:hover {
  border-color: rgba(96,165,250,0.2);
  background: rgba(29,78,216,0.04);
}

.check--compliant { border-left: 3px solid #14B8A6; }
.check--pending { border-left: 3px solid #F59E0B; }
.check--violation, .check--overdue { border-left: 3px solid #EF4444; }

.check-sev--critical { border-color: rgba(239,68,68,0.15); }
.check-sev--high { border-color: rgba(245,158,11,0.15); }

.check-status-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(148,163,184,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-body { flex: 1; min-width: 0; }

.check-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.check-reg {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #60A5FA;
}

.check-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.check-due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.check-due.due--overdue {
  color: #F87171;
}

/* === QUICK ACTIONS === */
.quick-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
}

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

.action-btn--primary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
}

.action-btn--secondary {
  background: rgba(29,78,216,0.1);
  color: #60A5FA;
  border-color: rgba(29,78,216,0.2);
}

.action-btn--secondary:hover {
  background: rgba(29,78,216,0.2);
}

.action-btn--outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.action-btn--outline:hover {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === STICKY DASHBOARD HEADER === */
.dash-sticky-bar {
  position: sticky;
  top: 60px;
  z-index: 50;
  background: rgba(12, 27, 51, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  margin: -8px -20px 20px;
  padding: 0 20px;
  display: none;
}

@media (min-width: 640px) {
  .dash-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
  }
}

.dash-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.dash-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.dash-breadcrumb a:hover { color: var(--accent-amber); }

.dash-breadcrumb .sep {
  color: var(--text-muted);
  font-size: 10px;
}

.dash-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-teal);
  box-shadow: 0 0 6px rgba(20, 184, 166, 0.8);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dash-clock {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* === CHECK FILTER TABS === */
.check-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.check-filters::-webkit-scrollbar { display: none; }

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-decoration: none;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.filter-tab.active {
  background: rgba(29, 78, 216, 0.12);
  border-color: rgba(29, 78, 216, 0.25);
  color: #60A5FA;
}

.filter-tab .tab-count {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
}

.filter-tab.active .tab-count {
  background: rgba(29, 78, 216, 0.2);
}

/* === SCORE CARD — ARC GAUGE (full donut) === */
.score-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.score-gauge-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.score-gauge-svg {
  width: 120px;
  height: 120px;
  overflow: visible;
  transform: rotate(-90deg);
}

.arc-track {
  fill: none;
  stroke: rgba(148, 163, 184, 0.1);
  stroke-linecap: round;
}

.arc-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s ease;
}

.score-gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}

.score-gauge-pct {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.score-gauge-sub {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-meta-label {
  font-size: 12px;
  color: var(--text-muted);
}

.score-meta-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* === STATUS TIMELINE === */
.status-timeline {
  padding: 0 20px 16px;
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-dot--ok       { background: #14B8A6; }
.timeline-dot--pending { background: #F59E0B; }
.timeline-dot--violation { background: #EF4444; }

.timeline-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.timeline-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 6px;
}

.timeline-step.status--ok .timeline-dot { box-shadow: 0 0 6px rgba(20, 184, 166, 0.5); }
.timeline-step.status--pending .timeline-dot { box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.timeline-step.status--critical .timeline-dot { box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }

/* === VIOLATION ACCORDION === */
.violation-item {
  position: relative;
  cursor: pointer;
}

.violation-expand {
  display: none;
  padding: 8px 0 4px 20px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.violation-item.expanded .violation-expand {
  display: block;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-col-primary { order: -1; }
  .dash-col-secondary { order: 0; }

  .score-breakdown {
    flex-wrap: wrap;
  }

  .breakdown-item {
    flex: 1 1 30%;
  }

  .breakdown-item:nth-child(2) {
    border-right: none;
    border-top: 1px solid var(--border);
  }

  .breakdown-item:nth-child(3) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 600px) {
  .dash-main { padding: 76px 16px 40px; }

  .status-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .status-right { text-align: left; }

  .quick-actions { gap: 8px; }
  .action-btn { flex: 1; justify-content: center; font-size: 12px; padding: 10px 12px; }

  .violation-body, .check-body { min-width: 0; }
  .sev-badge { font-size: 9px; }

  .dash-sticky-bar { display: none !important; }
}