/* ================================================================
   DPO Dashboard Redesign — Precision Instrument Layout
   Aligned with color-palettes.css & dashboard.css design tokens
   ================================================================ */

/* ================================================================
   CRITICAL ALERTS
   ================================================================ */
.dpo-alerts .section-card {
    background: var(--dp-surface-primary);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-l1, 0 1px 3px rgba(15, 23, 42, 0.06));
    border: none;
    overflow: hidden;
}

.dpo-alerts .section-card-header {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
    background: var(--dp-surface-primary);
    border-bottom: 1px solid var(--dp-border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dpo-alerts .section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dpo-alerts .alert-item {
    display: flex;
    align-items: center;
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
    border-bottom: 1px solid var(--dp-surface-hover);
    gap: var(--gr-4, 1.058rem);
    transition: background 0.15s ease;
}

.dpo-alerts .alert-item:last-child {
    border-bottom: none;
}

.dpo-alerts .alert-item:hover {
    background: var(--dp-surface-secondary);
}

.dpo-alerts .alert-severity {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.dpo-alerts .alert-severity.critical {
    background: var(--dp-status-danger-bg);
    color: var(--dp-status-danger);
}

.dpo-alerts .alert-severity.warning {
    background: var(--dp-status-warning-bg);
    color: var(--dp-status-warning);
}

.dpo-alerts .alert-content {
    flex: 1;
    min-width: 0;
}

.dpo-alerts .alert-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    color: var(--dp-text-primary);
    margin-bottom: 2px;
}

.dpo-alerts .alert-desc {
    font-size: var(--type-xs, 0.75rem);
    color: var(--dp-text-secondary);
}

.dpo-alerts .alert-action .btn {
    font-size: var(--type-xs, 0.75rem);
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: var(--card-radius, 0.618rem);
    white-space: nowrap;
}

.dpo-alerts .alerts-clear {
    padding: var(--gr-5, 1.712rem);
    text-align: center;
    color: var(--dp-status-success);
}

.dpo-alerts .alerts-clear i {
    font-size: 1.75rem;
    margin-bottom: var(--gr-3, 0.654rem);
    display: block;
}

.dpo-alerts .alerts-clear span {
    font-size: var(--type-sm, 0.875rem);
    font-weight: 500;
}

/* ================================================================
   SERVICE HEALTH CARDS — 2x2 grid
   ================================================================ */
.dpo-service-health .section-card {
    background: var(--dp-surface-primary);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-l1, 0 1px 3px rgba(15, 23, 42, 0.06));
    border: none;
    overflow: hidden;
}

.dpo-service-health .section-card-header {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
    background: var(--dp-surface-primary);
    border-bottom: 1px solid var(--dp-border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dpo-service-health .section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dp-text-primary);
    letter-spacing: -0.005em;
}

.dpo-service-health .section-card-body {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
}

.dpo-service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gr-4, 1.058rem);
}

.dpo-service-card {
    background: var(--dp-surface-primary);
    border-radius: var(--radius-lg, 14px);
    border: none;
    box-shadow: var(--shadow-l1);
    padding: var(--gr-4, 1.058rem);
    transition: box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dpo-service-card:hover {
    box-shadow: var(--shadow-l1-hover, 0 4px 12px rgba(15, 23, 42, 0.08));
}

.dpo-service-card.disabled {
    opacity: 0.55;
}

.dpo-service-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.dpo-service-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--gr-3, 0.654rem);
}

.dpo-service-icon-name {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dpo-service-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md, 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(var(--pp-primary-rgb, 0, 122, 130), 0.10);
    color: var(--dp-interactive-primary);
}

.dpo-service-card.disabled .dpo-service-icon {
    background: var(--dp-surface-hover);
    color: var(--dp-text-tertiary);
}

.dpo-service-name {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    color: var(--dp-text-primary);
}

.dpo-service-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    letter-spacing: 0.03em;
}

.dpo-service-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.dpo-service-badge.active {
    background: var(--dp-status-success-bg);
    color: var(--dp-status-success);
}

.dpo-service-badge.disabled {
    background: var(--dp-surface-hover);
    color: var(--dp-text-secondary);
}

.dpo-service-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: var(--gr-3, 0.654rem);
}

.dpo-service-metric-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--type-xs, 0.75rem);
    color: var(--dp-text-secondary);
}

.dpo-service-metric-row i {
    width: 14px;
    text-align: center;
    color: var(--dp-text-tertiary);
    font-size: 0.7rem;
}

.dpo-score-bar .score-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.dpo-score-bar .score-label {
    font-size: var(--type-xs, 0.75rem);
    color: var(--dp-text-secondary);
    font-weight: 500;
}

.dpo-score-bar .score-value {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-xs, 0.75rem);
    font-weight: 700;
}

.dpo-score-bar .score-value.high { color: var(--dp-status-success); }
.dpo-score-bar .score-value.medium { color: var(--dp-status-warning); }
.dpo-score-bar .score-value.low { color: var(--dp-status-danger); }

.dpo-progress-mini {
    height: 6px;
    border-radius: 100px;
    background: var(--dp-surface-hover);
    overflow: hidden;
}

.dpo-progress-mini .bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dpo-progress-mini .bar.high { background: var(--dp-status-success); }
.dpo-progress-mini .bar.medium { background: var(--dp-status-warning); }
.dpo-progress-mini .bar.low { background: var(--dp-status-danger); }
.dpo-progress-mini .bar.primary { background: var(--dp-interactive-primary); }

/* ================================================================
   COMPLIANCE TRENDS
   ================================================================ */
.dpo-trends .section-card {
    background: var(--dp-surface-primary);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-l1, 0 1px 3px rgba(15, 23, 42, 0.06));
    border: none;
    overflow: hidden;
}

.dpo-trends .section-card-header {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
    background: var(--dp-surface-primary);
    border-bottom: 1px solid var(--dp-border-subtle);
}

.dpo-trends .section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dp-text-primary);
    letter-spacing: -0.005em;
}

.dpo-trends .section-card-body {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
}

.dpo-trend-row {
    display: flex;
    flex-direction: column;
    gap: var(--gr-4, 1.058rem);
}

.dpo-trend-item .trend-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.dpo-trend-item .trend-label {
    font-size: var(--type-xs, 0.75rem);
    font-weight: 500;
    color: var(--dp-text-secondary);
}

.dpo-trend-item .trend-value {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 700;
}

.dpo-progress-trend {
    height: 8px;
    border-radius: 100px;
    background: var(--dp-surface-hover);
    overflow: hidden;
}

.dpo-progress-trend .bar {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
   QUICK ACTIONS — Card Grid
   ================================================================ */
.dpo-quick-actions .section-card {
    background: var(--dp-surface-primary);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-l1, 0 1px 3px rgba(15, 23, 42, 0.06));
    border: none;
    overflow: hidden;
}

.dpo-quick-actions .section-card-header {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
    background: var(--dp-surface-primary);
    border-bottom: 1px solid var(--dp-border-subtle);
}

.dpo-quick-actions .section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dp-text-primary);
    letter-spacing: -0.005em;
}

.dpo-quick-actions .section-card-body {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
}

.dpo-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.dpo-action-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--dp-border-subtle);
    background: var(--dp-surface-primary);
    text-decoration: none;
    color: var(--dp-text-primary);
    font-size: var(--type-xs, 0.75rem);
    font-weight: 500;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1),
                color 150ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.dpo-action-item:hover {
    background: rgba(var(--pp-primary-rgb, 0, 122, 130), 0.06);
    border-color: rgba(var(--pp-primary-rgb, 0, 122, 130), 0.18);
    color: var(--dp-interactive-primary);
    box-shadow: var(--shadow-l1);
    text-decoration: none;
}

.dpo-action-item i.action-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dp-surface-selected); /* brand tint */
    color: var(--dp-interactive-primary);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.dpo-action-item .badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.45rem;
}

.dpo-action-item.full-width {
    grid-column: 1 / -1;
}

/* ================================================================
   RECENT ACTIVITY — Timeline
   ================================================================ */
.dpo-activity .section-card {
    background: var(--dp-surface-primary);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-l1, 0 1px 3px rgba(15, 23, 42, 0.06));
    border: none;
    overflow: hidden;
}

.dpo-activity .section-card-header {
    padding: var(--gr-4, 1.058rem) var(--gr-5, 1.712rem);
    background: var(--dp-surface-primary);
    border-bottom: 1px solid var(--dp-border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dpo-activity .section-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: var(--type-sm, 0.875rem);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dp-text-primary);
    letter-spacing: -0.005em;
}

.dpo-activity .section-card-body {
    padding: 0.5rem var(--gr-5, 1.712rem);
}

.dpo-activity-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dpo-activity-item {
    display: flex;
    gap: var(--gr-3, 0.654rem);
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--dp-border-subtle);
    align-items: flex-start;
}

.dpo-activity-item:last-child {
    border-bottom: none;
}

.dpo-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--dp-surface-primary);
}

.dpo-activity-dot.consent { background: var(--dp-interactive-primary); }
.dpo-activity-dot.notice  { background: var(--dp-chart-2); }
.dpo-activity-dot.alert   { background: var(--dp-status-warning); }
.dpo-activity-dot.dsr     { background: var(--dp-chart-5); }

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

.dpo-activity-title {
    font-size: var(--type-xs, 0.75rem);
    font-weight: 600;
    color: var(--dp-text-primary);
    line-height: 1.4;
}

.dpo-activity-desc {
    font-size: 0.68rem;
    color: var(--dp-text-secondary);
    line-height: 1.4;
}

.dpo-activity-time {
    font-size: 0.65rem;
    color: var(--dp-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 3px;
}

/* ================================================================
   RESPONSIVE ADJUSTMENTS
   ================================================================ */
@media (max-width: 991.98px) {
    .dpo-service-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .dpo-actions-grid {
        grid-template-columns: 1fr;
    }

    .dpo-alerts .alert-item {
        flex-wrap: wrap;
    }

    .dpo-alerts .alert-action {
        width: 100%;
        margin-top: 0.5rem;
    }

    .dpo-alerts .alert-action .btn {
        width: 100%;
    }
}

/* ================================================================
   ENTRANCE ANIMATIONS
   ================================================================ */
@keyframes dpoFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dpo-animate-in {
    animation: dpoFadeSlideUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.dpo-delay-1 { animation-delay: 0.04s; }
.dpo-delay-2 { animation-delay: 0.08s; }
.dpo-delay-3 { animation-delay: 0.12s; }
.dpo-delay-4 { animation-delay: 0.16s; }
.dpo-delay-5 { animation-delay: 0.20s; }

@media (prefers-reduced-motion: reduce) {
    .dpo-animate-in {
        animation: none;
    }
}

/* Section title icon: muted decorative (Apple HIG — color = communication;
   reserve brand teal for interactive states, not heading icons) */
.dpo-alerts .section-title > i,
.dpo-service-health .section-title > i,
.dpo-trends .section-title > i,
.dpo-quick-actions .section-title > i,
.dpo-activity .section-title > i {
    color: var(--dp-text-muted);
    opacity: 0.85;
    font-size: 13px;
}

/* ================================================================
   ENHANCED DPO DASHBOARD — Action-Oriented Layout
   ================================================================ */

/* Gauge */
.dpo-gauge-section { overflow: visible; }

/* Compliance Gauge V2 */
.dpo-gauge-card { display:flex; flex-direction:column; align-items:center; width:100%; }
.dpo-gauge-card-header { width:100%; margin-bottom:.654rem; }
.dpo-gauge-card-title { display:block; font-size:.875rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--dp-text-primary); }
.dpo-gauge-card-subtitle { display:block; font-size:.75rem; color:var(--dp-text-muted); margin-top:2px; line-height:1.4; }
.dpo-gauge-chart-wrapper { position:relative; width:100%; height:270px; max-width:280px; }
.dpo-gauge-chart-wrapper canvas { display:block; }
.dpo-gauge-score-row { display:flex; flex-direction:column; align-items:center; gap:2px; margin-top:-12px; position:relative; z-index:1; }
.dpo-gauge-score-value { font-size:2rem; font-weight:800; line-height:1; letter-spacing:-.02em; }
/* Zone colors: poor=danger, fair=warning, good=success, excellent=primary */
.dpo-gauge-score-value.poor,  .dpo-gauge-score-band.poor      { color:var(--dp-status-danger); }
.dpo-gauge-score-value.fair,  .dpo-gauge-score-band.fair      { color:var(--dp-status-warning); }
.dpo-gauge-score-value.good,  .dpo-gauge-score-band.good      { color:var(--dp-status-success); }
.dpo-gauge-score-value.excellent, .dpo-gauge-score-band.excellent { color:var(--dp-interactive-primary); }
.dpo-gauge-score-band { font-size:.75rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.dpo-gauge-legend { display:flex; flex-wrap:wrap; justify-content:center; gap:.35rem .75rem; margin-top:.654rem; width:100%; }
.dpo-gauge-legend-item { display:flex; align-items:center; gap:.3rem; font-size:.6875rem; color:var(--dp-text-secondary); white-space:nowrap; }
.dpo-gauge-legend-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.dpo-gauge-legend-item.poor .dpo-gauge-legend-dot      { background:var(--dp-status-danger); }
.dpo-gauge-legend-item.fair .dpo-gauge-legend-dot      { background:var(--dp-status-warning); }
.dpo-gauge-legend-item.good .dpo-gauge-legend-dot      { background:var(--dp-status-success); }
.dpo-gauge-legend-item.excellent .dpo-gauge-legend-dot { background:var(--dp-interactive-primary); }
@media (max-width:991.98px) {
    .dpo-gauge-chart-wrapper { max-width:240px; height:135px; }
    .dpo-gauge-score-value   { font-size:1.625rem; }
}
@media (max-width:575.98px) {
    .dpo-gauge-chart-wrapper { max-width:200px; height:115px; }
    .dpo-gauge-score-value   { font-size:1.375rem; }
}
.dpo-gauge-wrapper { position: relative; display: inline-block; }
.dpo-gauge-value {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-top: -8px;
    line-height: 1;
}
.dpo-gauge-label { font-size: 0.75rem; text-align: center; }

/* Sub-score cards */
.dpo-subscore-card {
    background: var(--dp-surface-secondary);
    border: none;
    border-radius: var(--radius-md, 10px);
    padding: 0.75rem;
}
.dpo-subscore-icon { font-size: 0.875rem; color: var(--dp-text-muted); margin-bottom: 0.25rem; }
.dpo-subscore-label { font-size: 0.6875rem; color: var(--dp-text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.dpo-subscore-value { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.375rem; }
.dpo-subscore-bar { height: 4px; border-radius: 2px; background: var(--dp-border-default); }

/* DSR Urgency Table */
.dpo-urgency-table { font-size: 0.8125rem; }
.dpo-urgency-table thead th { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dp-text-muted); background: transparent; border-bottom: 1px solid var(--dp-border-subtle); padding: 0.625rem 0.875rem; }
.dpo-urgency-table tbody td { padding: 0.625rem 0.875rem; vertical-align: middle; border-bottom: 1px solid var(--dp-border-subtle); font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }
.dpo-urgency-table tbody tr { transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1); }
.dpo-urgency-table tbody tr:hover td { background: rgba(var(--pp-primary-rgb, 0, 122, 130), 0.025); }
.dpo-avatar-initial {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(var(--pp-primary-rgb, 0, 122, 130), 0.12);
    color: var(--dp-interactive-primary);
    font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    font-feature-settings: 'tnum';
}

/* Regulation items */
.dpo-regulation-item { margin-bottom: 0; }
.dpo-regulation-item .progress { height: 6px; background: var(--dp-border-default); }

/* Risk cards */
.dpo-risk-card {
    border-radius: var(--radius-md, 10px);
    padding: 0.875rem;
    text-align: center;
    border: none;
}
.dpo-risk-card.critical { background: color-mix(in srgb, var(--dp-risk-critical) 8%, transparent); border-color: color-mix(in srgb, var(--dp-risk-critical) 30%, transparent); }
.dpo-risk-card.high     { background: color-mix(in srgb, var(--dp-risk-high) 8%, transparent);     border-color: color-mix(in srgb, var(--dp-risk-high) 30%, transparent); }
.dpo-risk-card.medium   { background: color-mix(in srgb, var(--dp-risk-medium) 8%, transparent);   border-color: color-mix(in srgb, var(--dp-risk-medium) 30%, transparent); }
.dpo-risk-card.low      { background: color-mix(in srgb, var(--dp-risk-low) 8%, transparent);      border-color: color-mix(in srgb, var(--dp-risk-low) 30%, transparent); }
.dpo-risk-count { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.dpo-risk-card.critical .dpo-risk-count { color: var(--dp-status-danger); }
.dpo-risk-card.high     .dpo-risk-count { color: var(--dp-risk-high); }
.dpo-risk-card.medium   .dpo-risk-count { color: var(--dp-risk-medium); }
.dpo-risk-card.low      .dpo-risk-count { color: var(--dp-status-success); }
.dpo-risk-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dp-text-secondary); }
.dpo-risk-sub { font-size: 0.6875rem; color: var(--dp-text-muted); margin-top: 0.125rem; }
