/* ── Dashboard Layout ── */
.dashboard-container {
  padding: 32px 40px;
  max-width: 1400px;
}

/* ── L1: Org Overview ── */
.dashboard-hero {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 32px;
  padding: 28px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.hero-gauge {
  flex-shrink: 0;
  text-align: center;
}

.hero-gauge canvas {
  display: block;
}

.hero-gauge .gauge-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.hero-info {
  flex: 1;
}

.hero-info h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.hero-info .subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-value {
  font-size: 22px;
  font-weight: 700;
}

.hero-stat .stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sparkline-container {
  width: 120px;
  height: 40px;
}

/* ── Department Cards Grid ── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.dept-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dept-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dept-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dept-name {
  font-size: 15px;
  font-weight: 600;
}

.dept-score-ring {
  position: relative;
  width: 48px;
  height: 48px;
}

.dept-score-ring canvas {
  display: block;
}

.dept-score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
}

.dept-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.dept-top-risk {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── L2: Risk Type Cards ── */
.risk-type-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.risk-type-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.risk-type-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.risk-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 18px;
}

.risk-type-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.risk-type-score {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.risk-type-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.risk-type-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 600ms ease;
}

/* ── Department detail section ── */
.dept-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.dept-detail-score {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}

.dept-detail-meta {
  display: flex;
  gap: 24px;
  margin-top: 6px;
}

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

.dept-detail-meta .meta-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Heatmap ── */
.heatmap-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.heatmap-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.heatmap-grid {
  display: grid;
  gap: 3px;
}

.heatmap-cell {
  border-radius: 4px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

.heatmap-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding-top: 4px;
}

.heatmap-row-label {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  padding-right: 8px;
}

/* ── L3: Subcategory Cards ── */
.subcat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.subcat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.subcat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.subcat-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.subcat-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── L5: Detail View ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.detail-full-width {
  grid-column: 1 / -1;
}

.matrix-5x5 {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr) auto;
  gap: 3px;
  max-width: 280px;
}

.matrix-cell {
  width: 44px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.matrix-y-label, .matrix-x-label {
  font-size: 10px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.matrix-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ── Control status ── */
.control-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}

.control-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.control-dot.effective { background: var(--success); }
.control-dot.partial { background: var(--warning); }
.control-dot.ineffective { background: var(--danger); }

/* ── Timeline/Audit trail ── */
.audit-trail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audit-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-left: 20px;
}

.audit-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.audit-item::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 18px;
  width: 2px;
  height: calc(100% + 4px);
  background: var(--border);
}

.audit-item:last-child::after { display: none; }

.audit-date {
  font-size: 11px;
  color: var(--text-tertiary);
  min-width: 80px;
}

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

.audit-by {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
