/*
 * Sala de control (escriptori de TSWpOps). CSS pla, sense passar per Tailwind:
 * Filament el publica amb `php artisan filament:assets`.
 * Colors per al tema fosc (el per defecte) i equivalents per al clar.
 */

.cr {
    --cr-panel: #ffffff;
    --cr-border: #e2e8f0;
    --cr-divider: #f1f5f9;
    --cr-hover: #f8fafc;
    --cr-text: #0f172a;
    --cr-soft: #334155;
    --cr-muted: #64748b;
    --cr-ok: #059669;
    --cr-warn: #d97706;
    --cr-bad: #dc2626;
    --cr-info: #2563eb;
    --cr-none: #e2e8f0;
    --cr-agent: #2563eb;
    --cr-human: #0f766e;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
    color: var(--cr-text);
}

.dark .cr {
    --cr-panel: #11161d;
    --cr-border: #1e2630;
    --cr-divider: #161d26;
    --cr-hover: #151c25;
    --cr-text: #e6edf3;
    --cr-soft: #c3ccd5;
    --cr-muted: #8b98a5;
    --cr-ok: #34d399;
    --cr-warn: #fbbf24;
    --cr-bad: #f87171;
    --cr-info: #93c5fd;
    --cr-none: #2a3542;
    --cr-agent: #93c5fd;
    --cr-human: #5eead4;
}

@media (max-width: 1280px) {
    .cr { grid-template-columns: minmax(0, 1fr); }
}

.cr-panel {
    border: 1px solid var(--cr-border);
    border-radius: 14px;
    background: var(--cr-panel);
    overflow: hidden;
}

.cr-panel__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--cr-border);
}

.cr-panel__title {
    margin: 0;
    flex-grow: 1;
    font-size: 15px;
    font-weight: 600;
}

.cr-side { display: flex; flex-direction: column; gap: 16px; }

.cr-mono { font-family: var(--mono-font-family), ui-monospace, monospace; }
.cr-muted { color: var(--cr-muted); }
.cr-soft { color: var(--cr-soft); }
.cr-small { font-size: 12px; }
.cr-tiny { font-size: 11px; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cr-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cr-empty { margin: 0; padding: 20px; color: var(--cr-muted); font-size: 14px; }

.cr-link { font-size: 13px; color: var(--cr-human); text-decoration: none; }
.cr-link:hover { text-decoration: underline; }

/* Taula de sites */
.cr-row {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) 52px 184px 44px 64px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--cr-divider);
    font-size: 14px;
    color: inherit;
    text-decoration: none;
}
a.cr-row:hover, a.cr-row:focus-visible { background: var(--cr-hover); outline: none; }
.cr-row:last-child { border-bottom: 0; }
.cr-row--head {
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 11px;
    color: var(--cr-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cr-site { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.cr-site__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cr-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--cr-none); }
.cr-dot--ok { background: var(--cr-ok); }
.cr-dot--warn { background: var(--cr-warn); }
.cr-dot--bad { background: var(--cr-bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cr-bad) 25%, transparent); }

.cr-days { display: flex; align-items: center; gap: 4px; min-width: 0; }
.cr-day { flex-shrink: 0; }
.cr-day { width: 12px; height: 18px; border-radius: 3px; background: var(--cr-none); }
.cr-day--remote { background: var(--cr-ok); }
.cr-day--local { background: var(--cr-warn); }
.cr-day--failed { background: var(--cr-bad); }

.cr-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}
.cr-pill--bad { background: color-mix(in srgb, var(--cr-bad) 16%, transparent); color: var(--cr-bad); }
.cr-pill--warn { background: color-mix(in srgb, var(--cr-warn) 16%, transparent); color: var(--cr-warn); }
.cr-pill--low { background: color-mix(in srgb, var(--cr-muted) 18%, transparent); color: var(--cr-soft); }

/* Incidències */
.cr-incident {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--cr-divider);
    color: inherit;
    text-decoration: none;
}
.cr-incident:last-child { border-bottom: 0; }
a.cr-incident:hover, a.cr-incident:focus-visible { background: var(--cr-hover); outline: none; }
.cr-incident__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cr-incident__title { font-size: 14px; font-weight: 500; }

.cr-bar { width: 3px; flex-shrink: 0; border-radius: 2px; background: var(--cr-none); }
.cr-bar--critical, .cr-bar--high { background: var(--cr-bad); }
.cr-bar--medium { background: var(--cr-warn); }
.cr-bar--low { background: var(--cr-info); }

/* Activitat */
.cr-feed {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 9px 18px;
    font-size: 13px;
    color: inherit;
    text-decoration: none;
}
a.cr-feed:hover, a.cr-feed:focus-visible { background: var(--cr-hover); outline: none; }
.cr-feed__time { width: 40px; flex-shrink: 0; }
.cr-feed__actor { font-weight: 500; flex-shrink: 0; }
.cr-feed__actor--agent { color: var(--cr-agent); }
.cr-feed__actor--human { color: var(--cr-human); }
.cr-feed__actor--system { color: var(--cr-soft); }
.cr-fail { color: var(--cr-bad); }

/* Xifres del resum en monoespaiada, com la resta de dades */
.fi-wi-stats-overview-stat-value { font-family: var(--mono-font-family), ui-monospace, monospace; letter-spacing: -0.02em; }
