/* ==========================================================================
 * CARETTA — VIZITE: banda „in 5 secunde" (vz-*)
 * ==========================================================================
 * Audit 29.08.2026: modulul raspundea cu 14 KPI-uri, 6 grafice si 5 tabele la o
 * intrebare cu TREI raspunsuri — ce am facut, ce am planificat si nu am facut,
 * ce am de facut. Banda asta e primul lucru de pe ecran si singura care da acele
 * trei cifre; restul coboara sub „vezi detaliile".
 *
 * Tokenii vin din design-system (ca in css/dashboard-premium.css, prefix g-*),
 * deci dark mode iese singur. Brand: navy #003349 + rosu #E0004D.
 * ========================================================================== */

.vz-pulse {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.vz-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 12px 14px 26px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    border: 1px solid var(--border-subtle, #e3e8ef);
    border-left: 3px solid var(--text-faint, #9ca3af);
    border-radius: 8px;
    background: var(--bg-surface, #fff);
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.vz-card:hover { box-shadow: 0 2px 10px rgba(0, 51, 73, .08); }
/* „Am facut" e doar informativ: nu are cursor de buton si nu se lumineaza la hover. */
.vz-card.vz-static { cursor: default; }
.vz-card.vz-static:hover { box-shadow: none; }
.vz-card:focus-visible { outline: 2px solid var(--caretta-red, #E0004D); outline-offset: 2px; }
.vz-card.is-active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--caretta-navy, #003349) 22%, transparent); }

.vz-facut { border-left-color: var(--signal-on-track, #10b981); }
.vz-ratat { border-left-color: var(--signal-action, #dc2626); }
.vz-azi   { border-left-color: var(--caretta-navy, #003349); }
/* Zero restante = nu mai tipa rosu degeaba. */
.vz-ratat.is-zero { border-left-color: var(--signal-on-track, #10b981); }

.vz-k {
    display: flex; align-items: center; gap: 6px;
    font-size: .68rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-soft, #6b7280);
}
.vz-k i { font-size: .72rem; }
.vz-facut .vz-k i { color: var(--signal-on-track, #10b981); }
.vz-ratat .vz-k i { color: var(--signal-action, #dc2626); }
.vz-ratat.is-zero .vz-k i { color: var(--signal-on-track, #10b981); }
.vz-azi   .vz-k i { color: var(--caretta-red, #E0004D); }

.vz-n {
    font-size: 2.1rem; font-weight: 800; line-height: 1.02;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
    color: var(--text-strong, #0f172a);
}
.vz-u { font-size: .78rem; font-weight: 600; color: var(--text-default, #1f2937); }
.vz-foot { margin-top: 4px; font-size: .7rem; color: var(--text-soft, #6b7280); }
.vz-foot b { color: var(--text-strong, #0f172a); }

/* Bara „cat din ce trebuia inchis pana azi chiar e inchis" */
.vz-prog {
    position: relative; height: 5px; border-radius: 3px; margin-top: 8px;
    background: var(--bg-subtle, #f1f4f9); overflow: hidden;
}
body.dark-mode .vz-prog { background: rgba(255, 255, 255, .08); }
.vz-prog i {
    position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px;
    background: var(--signal-on-track, #10b981);
}
.vz-prog i.warn { background: var(--signal-watch, #f59e0b); }
.vz-prog i.crit { background: var(--signal-action, #dc2626); }

/* Primele randuri, direct in card: o cifra fara nume nu e o informatie. */
.vz-mini { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.vz-mini li {
    display: flex; align-items: baseline; gap: 6px;
    font-size: .72rem; color: var(--text-soft, #6b7280);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vz-mini li b {
    flex: 0 0 auto; font-variant-numeric: tabular-nums;
    color: var(--text-strong, #0f172a); font-weight: 700;
}
.vz-mini li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-go {
    position: absolute; right: 12px; bottom: 9px;
    font-size: .68rem; font-weight: 700; color: var(--caretta-red, #E0004D);
}
.vz-card:not(.has-rows) .vz-go { display: none; }

/* ── Detaliul deschis de pe un card ──────────────────────────────────────── */
.vz-detail {
    border: 1px solid var(--border-subtle, #e3e8ef);
    border-radius: 8px; background: var(--bg-surface, #fff);
    margin-bottom: 12px; overflow: hidden;
}
.vz-detail:empty, .vz-detail.hidden { display: none; }
.vz-detail-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-bottom: 1px solid var(--border-subtle, #e3e8ef);
    background: var(--bg-subtle, #f7f9fc);
}
body.dark-mode .vz-detail-head { background: rgba(255, 255, 255, .04); }
.vz-detail-head h4 { margin: 0; font-size: .82rem; font-weight: 800; color: var(--text-strong, #0f172a); }
.vz-detail-head p { margin: 0; flex: 1 1 auto; font-size: .72rem; color: var(--text-soft, #6b7280); }
.vz-detail-close {
    border: 0; background: none; cursor: pointer; padding: 2px 6px;
    color: var(--text-soft, #6b7280); font-size: .9rem;
}
.vz-detail-close:hover { color: var(--caretta-red, #E0004D); }
.vz-rows { max-height: 340px; overflow: auto; }
.vz-row {
    display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto;
    gap: 4px 10px; align-items: center;
    padding: 8px 12px; border-bottom: 1px solid var(--border-subtle, #e3e8ef);
    font-size: .78rem;
}
.vz-row:last-child { border-bottom: 0; }
.vz-row:hover { background: var(--bg-surface-hover, #f4f8fc); }
body.dark-mode .vz-row:hover { background: rgba(255, 255, 255, .04); }
.vz-row-when { font-variant-numeric: tabular-nums; color: var(--text-soft, #6b7280); font-size: .74rem; }
.vz-row-main { min-width: 0; }
.vz-row-main b { display: block; font-weight: 700; color: var(--text-strong, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-row-main span { display: block; font-size: .72rem; color: var(--text-soft, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-late {
    display: inline-block; padding: 0 6px; border-radius: 999px;
    font-size: .64rem; font-weight: 800; white-space: nowrap;
    background: color-mix(in srgb, var(--signal-action, #dc2626) 14%, transparent);
    color: var(--signal-action, #dc2626);
}
.vz-late.mild { background: color-mix(in srgb, var(--signal-watch, #f59e0b) 18%, transparent); color: #b7791f; }
body.dark-mode .vz-late.mild { color: #fbbf24; }
.vz-row-btn {
    border: 1px solid var(--border-subtle, #e3e8ef); background: var(--bg-subtle, #f6f8fb);
    color: var(--text-soft, #6b7280); border-radius: 6px; cursor: pointer;
    padding: 4px 9px; font: inherit; font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.vz-row-btn:hover { border-color: var(--caretta-red, #E0004D); color: var(--caretta-red, #E0004D); }
.vz-detail-foot { padding: 7px 12px; font-size: .7rem; color: var(--text-faint, #9ca3af); }

/* ── Randul de cifre secundare, discret ──────────────────────────────────── */
.vz-second {
    display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
    padding: 8px 12px; margin-bottom: 12px;
    border: 1px solid var(--border-subtle, #e3e8ef); border-radius: 8px;
    background: var(--bg-surface, #fff);
    font-size: .74rem; color: var(--text-soft, #6b7280);
}
.vz-second:empty { display: none; }
.vz-second em { font-style: normal; }
.vz-second b { font-variant-numeric: tabular-nums; color: var(--text-strong, #0f172a); font-weight: 800; }

/* ── Sectiuni pliate: graficele si tabelele nu mai sunt ecranul principal ─── */
.vz-fold { margin-bottom: 12px; border: 1px solid var(--border-subtle, #e3e8ef); border-radius: 8px; background: var(--bg-surface, #fff); }
.vz-fold > summary {
    cursor: pointer; list-style: none; padding: 9px 12px;
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-soft, #6b7280);
}
.vz-fold > summary::-webkit-details-marker { display: none; }
.vz-fold > summary::before { content: '\f0d7'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-right: 7px; }
.vz-fold[open] > summary::before { content: '\f0d8'; }
.vz-fold[open] > summary { border-bottom: 1px solid var(--border-subtle, #e3e8ef); }
.vz-fold > summary:hover { color: var(--caretta-red, #E0004D); }
.vz-fold-body { padding: 12px; }
.vz-fold-body > .charts-row:last-child,
.vz-fold-body > .card:last-child,
.vz-fold-body > .vdb-section:last-child { margin-bottom: 0; }

/* Filtrele nu mai sunt primul lucru de pe ecran: stau pliate, ca in restul appului. */
.vz-filtre { margin-bottom: 12px; }
.vz-filtre > summary {
    cursor: pointer; list-style: none;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 11px; border: 1px solid var(--border-subtle, #e3e8ef); border-radius: 7px;
    background: var(--bg-subtle, #f6f8fb); color: var(--text-soft, #6b7280);
    font-size: .74rem; font-weight: 700;
}
.vz-filtre > summary::-webkit-details-marker { display: none; }
.vz-filtre > summary:hover { border-color: var(--caretta-red, #E0004D); color: var(--caretta-red, #E0004D); }
.vz-filtre > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: .62rem; }
.vz-filtre[open] > summary::after { content: '\f077'; }
.vz-filtre[open] > summary { margin-bottom: 10px; }

/* ── Ecrane mai mici ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .vz-pulse { grid-template-columns: minmax(0, 1fr); }
    .vz-n { font-size: 1.75rem; }
    .vz-row { grid-template-columns: 78px minmax(0, 1fr) auto; }
    .vz-row-btn { grid-column: 1 / -1; justify-self: start; }
    /* Titlul si nota nu incap pe acelasi rand la 375px: nota trece dedesubt. */
    .vz-detail-head { flex-wrap: wrap; }
    .vz-detail-head h4 { flex: 1 1 auto; }
    .vz-detail-head p { flex: 1 1 100%; order: 3; }
    .vz-second { gap: 4px 14px; }
}

/* ── Tabelul de vizite, dupa reducerea la 7 coloane ──────────────────────── */
.visit-list-time { color: var(--text-soft, #6b7280); font-variant-numeric: tabular-nums; font-size: .78em; }
/* Randul „planificat, ziua a trecut, nimic bifat" — se vede si in lista, nu doar in banda. */
#visits-body tr.visit-row-missed td:first-child { box-shadow: inset 2px 0 0 var(--signal-action, #dc2626); }

/* Randul de cifre din Planificator foloseste acelasi limbaj ca in celelalte doua ecrane. */
.vplan-kpi-line em { white-space: nowrap; }
