/**
 * SENTINELA SPRINGA - CSS Dedicato
 * UI-010 S343 -- Design che porta rispetto.
 *
 * Variabili semantiche: colori per stato riconciliazione.
 * Coerente con il tema del portale (dark mode, accenti verdi).
 */

:root {
    --sentinela-matched: #22c55e;
    --sentinela-mismatch: #ef4444;
    --sentinela-unmatched: #f59e0b;
    --sentinela-manual: #8b5cf6;
    --sentinela-resolved: #06b6d4;
}

/* Hero zone -- il numero grande che dice "respira" o "agisci" */
.sentinela-hero {
    text-align: center;
    padding: 20px 0 8px;
}

.sentinela-hero-number {
    font-size: 3em;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.sentinela-hero-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Progress bar */
.sentinela-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-tertiary, rgba(255,255,255,0.05));
    margin-bottom: 16px;
}

.sentinela-bar-matched { background: var(--sentinela-matched); }
.sentinela-bar-mismatch { background: var(--sentinela-mismatch); }
.sentinela-bar-unmatched { background: var(--sentinela-unmatched); }
.sentinela-bar-manual { background: var(--sentinela-manual); }

/* KPI Cards */
.sentinela-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.sentinela-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    border-left: 3px solid var(--border-color);
    transition: transform 0.15s ease;
}

.sentinela-card:hover {
    transform: translateY(-1px);
}

.sentinela-card-matched { border-left-color: var(--sentinela-matched); }
.sentinela-card-mismatch { border-left-color: var(--sentinela-mismatch); }
.sentinela-card-unmatched { border-left-color: var(--sentinela-unmatched); }
.sentinela-card-manual { border-left-color: var(--sentinela-manual); }
.sentinela-card-resolved { border-left-color: var(--sentinela-resolved); }

.sentinela-card-count {
    font-size: 1.6em;
    font-weight: 700;
}

.sentinela-card-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* UI-010 M1 S344: Section container */
.sentinela-section {
    margin-bottom: 16px;
}

/* UI-010 M3 S344: Legenda sotto progress bar */
.sentinela-healthbar-legend {
    display: flex;
    gap: 12px;
    justify-content: center;
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sentinela-healthbar-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* Record table */
.sentinela-section-header {
    margin: 0 0 8px 0;
    font-size: 0.9em;
}

.sentinela-th-center {
    text-align: center;
}

.sentinela-detail {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.sentinela-action-cell {
    text-align: center;
    white-space: nowrap;
}

.sentinela-action-cell .sentinela-btn + .sentinela-btn {
    margin-left: 4px;
}

.sentinela-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.sentinela-table th {
    padding: 6px 8px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.sentinela-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.05));
}

.sentinela-table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* V4 link */
.sentinela-v4-link {
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
}

.sentinela-v4-link:hover {
    opacity: 0.8;
}

/* Aging badge */
.sentinela-aging {
    font-size: 0.8em;
    font-weight: 600;
    text-align: center;
}

.sentinela-aging-ok { color: var(--text-secondary); }
.sentinela-aging-warn { color: var(--sentinela-unmatched); }
.sentinela-aging-critical { color: var(--sentinela-mismatch); }

/* Action buttons */
.sentinela-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid;
    background: transparent;
    cursor: pointer;
    font-size: 0.78em;
    transition: opacity 0.15s;
}

.sentinela-btn:hover {
    opacity: 0.8;
}

.sentinela-btn-resolve {
    border-color: var(--sentinela-matched);
    color: var(--sentinela-matched);
}

.sentinela-btn-link {
    border-color: var(--sentinela-matched);
    color: var(--sentinela-matched);
}

.sentinela-btn-ignore {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

/* Modal overlay */
.sentinela-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sentinela-modal {
    background: var(--bg-primary, #1a1a2e);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.sentinela-modal h3 {
    color: var(--text-primary);
    margin: 0 0 12px 0;
    font-size: 1em;
}

/* Refresh button */
.sentinela-refresh-btn {
    padding: 8px 24px;
    border-radius: 6px;
    border: 1px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
}

.sentinela-refresh-btn:hover {
    background: rgba(var(--accent-color-rgb, 34,197,94), 0.1);
}

/* UI-010 M5 S344: Season report card */
.sentinela-season-report {
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(0,0,0,0.1);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sentinela-season-report-label {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.sentinela-season-report-verdict {
    font-size: 1.2em;
    font-weight: 700;
}

.sentinela-season-report-stats {
    text-align: right;
    font-size: 0.85em;
}

/* UI-010 M6 S344: Filtro stagione select */
.sentinela-season-filter {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85em;
}

/* LINK-002 S344: Badge SPRING nel portale (caparra/GIR linkati a SPRING) */
/* F9 fix: min-size per tap target mobile (WCAG 44px) */
.badge-spring {
    display: inline-block;
    font-size: 0.65em;
    font-weight: 700;
    padding: 2px 5px;
    margin-left: 3px;
    min-width: 18px;
    min-height: 18px;
    line-height: 14px;
    text-align: center;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-radius: 3px;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s;
}
.badge-spring:hover {
    background: rgba(59, 130, 246, 0.3);
}
