/* ============================================================
   CARETTA SHELL (Faza 2) — bara de sus + navigație pe rol.
   Un singur fișier CSS pentru shell; NU stilizează modulele.
   Culori de brand OFICIALE (confirmate 31.07.2026): roșu #E0004D,
   navy #003349. Nu introduce alte scheme.
   ============================================================ */
:root {
    --shell-red: #E0004D;
    --shell-navy: #003349;
    --shell-ok: #16a34a;
    --shell-warn: #f59e0b;
    --shell-crit: #dc2626;
}

/* ── Bara de sus — element PROPRIU, full-width, deasupra header-ului cu titlu.
   Înălțime stabilă: nu depinde de lungimea titlului modulului (aia făcea
   elementele să „fugă" la fiecare navigare). ── */
.shell-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    min-height: 52px;
    padding: 8px 14px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: var(--shell-navy);
    box-sizing: border-box;
}
.shell-spacer { flex: 1 1 auto; }
.shell-topbar .shell-fresh {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: #dbe7ee;
}
.shell-topbar .shell-search input {
    background: rgba(255, 255, 255, 0.95);
    border-color: transparent;
}
.shell-topbar .shell-user-chip { background: rgba(255, 255, 255, 0.10); }

/* Deconectare + temă în bară: stilurile lor vechi (fond alb/text închis) erau
   invizibile pe navy — în bară primesc contur alb, lizibil în ambele teme. */
.shell-topbar .shell-bar-btn {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    padding: 7px 12px !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.shell-topbar .shell-bar-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: #fff !important;
}
.shell-topbar .shell-bar-btn i { color: #fff; }

/* Filtrele globale mutate în ecranul activ (sub strip-ul de taburi): pe view-urile
   cu grid trebuie să ocupe TOATĂ lățimea, nu o singură coloană; în containerele
   randate de JS (ex. „Ziua mea") — lățime întreagă. */
.dashboard-view > #global-filters-container { grid-column: 1 / -1; }
.dashboard-view #global-filters-container { width: 100%; box-sizing: border-box; }
.shell-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--shell-navy);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.15;
    white-space: nowrap;
}
.shell-user-chip i { color: var(--shell-red); }
.shell-user-name { font-weight: 700; }
.shell-user-role {
    display: block;
    font-size: 0.68rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Semafor prospețime date */
.shell-fresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #d3d9e0);
    background: var(--card-bg, #fff);
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    cursor: default;
}
.shell-fresh-item { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.shell-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background: #94a3b8; /* necunoscut */
}
.shell-dot.ok   { background: var(--shell-ok); }
.shell-dot.warn { background: var(--shell-warn); }
.shell-dot.crit { background: var(--shell-crit); }

/* Căutare globală partener */
.shell-search { position: relative; }
.shell-search input {
    width: 210px;
    padding: 7px 10px 7px 30px;
    border: 1px solid var(--border-color, #d3d9e0);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    color: var(--text-color, #0f172a);
    font-size: 0.8rem;
}
.shell-search input:focus {
    outline: 2px solid var(--shell-red);
    outline-offset: 0;
    border-color: var(--shell-red);
}
.shell-search > i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    pointer-events: none;
}

/* ── Navigație: grupuri colapsabile ── */
.menu .menu-group-title.shell-group-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.menu .menu-group-title.shell-group-toggle:hover { color: var(--shell-red); }
.shell-group-chevron { transition: transform 0.15s ease; font-size: 0.7em; }
.menu-group.shell-collapsed .shell-group-chevron { transform: rotate(-90deg); }
.menu-group.shell-collapsed a[data-target] { display: none !important; }

/* ── Eticheta de sursă (ⓘ) ── */
.shell-src-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 0.72rem;
    cursor: pointer;
    vertical-align: middle;
    padding: 0;
}
.shell-src-badge:hover { color: var(--shell-red); }
.shell-src-pop {
    position: absolute;
    z-index: 4000;
    max-width: 330px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #d3d9e0);
    background: var(--card-bg, #fff);
    color: var(--text-color, #0f172a);
    box-shadow: 0 10px 28px rgba(0, 51, 73, 0.22);
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: left;
}
.shell-src-pop h4 {
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: var(--shell-navy);
    border-left: 3px solid var(--shell-red);
    padding-left: 8px;
}
.shell-src-pop p { margin: 0 0 8px; }
.shell-src-pop dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
.shell-src-pop dt { font-weight: 700; color: var(--text-muted, #64748b); white-space: nowrap; }
.shell-src-pop dd { margin: 0; }

/* Dark mode (aceeași clasă folosită de app: body.dark-mode) */
body.dark-mode .shell-fresh,
body.dark-mode .shell-search input,
body.dark-mode .shell-src-pop {
    background: var(--card-bg, #16202b);
    border-color: var(--border-color, #2b3a4a);
    color: var(--text-color, #e2e8f0);
}
body.dark-mode .shell-src-pop h4 { color: #7dd3fc; }
body.dark-mode .shell-user-chip { background: #072435; }

/* ── SINTEZĂ (Faza 4): 8 carduri + 3 blocuri context, fără scroll pe 1920×1080 ── */
.sz-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
.sz-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #d3d9e0);
    background: var(--card-bg, #fff);
    color: var(--text-color, #0f172a);
    text-align: left;
    cursor: pointer;
    min-height: 118px;
}
.sz-card:hover { border-color: var(--shell-red); box-shadow: 0 4px 14px rgba(0, 51, 73, 0.12); }
.sz-head { display: flex; align-items: center; gap: 6px; }
.sz-titlu {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #64748b);
    flex: 1 1 auto;
}
.sz-dot { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; flex: none; }
.sz-ok .sz-dot { background: var(--shell-ok); }
.sz-warn .sz-dot { background: var(--shell-warn); }
.sz-crit .sz-dot { background: var(--shell-crit); }
.sz-val { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.sz-val small { font-size: 0.7rem; font-weight: 600; color: var(--text-muted, #64748b); }
.sz-sub { font-size: 0.78rem; font-weight: 600; color: var(--text-muted, #64748b); margin-left: 8px; }
.sz-cmp { font-size: 0.74rem; color: var(--text-muted, #64748b); }
.sz-spark { width: 100%; height: 26px; color: var(--shell-navy); opacity: 0.75; margin-top: auto; }
body.dark-mode .sz-spark { color: #7dd3fc; }
.sz-spark-gol { height: 26px; margin-top: auto; }
.sz-ctx-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.sz-ctx {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #d3d9e0);
    background: var(--card-bg, #fff);
}
.sz-ctx h3 {
    margin: 0 0 8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--shell-navy);
    border-left: 3px solid var(--shell-red);
    padding-left: 8px;
}
body.dark-mode .sz-ctx h3 { color: #7dd3fc; }
.sz-ctx ul { list-style: none; margin: 0; padding: 0; }
.sz-ctx li {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px dashed var(--border-color, #e2e8f0);
    font-size: 0.8rem;
}
.sz-ctx li:last-child { border-bottom: none; }
.sz-ctx li b { flex: 1 1 auto; }
.sz-ctx li small { flex-basis: 100%; color: var(--text-muted, #64748b); }
.sz-neg { color: var(--shell-crit); font-weight: 700; }
.sz-gol { font-size: 0.8rem; color: var(--text-muted, #64748b); margin: 0; }
.sz-meta { font-size: 0.72rem; color: var(--text-muted, #64748b); margin: 10px 0 0; }
@media (max-width: 1200px) { .sz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sz-ctx-row { grid-template-columns: 1fr; } }
@media (max-width: 600px)  { .sz-grid { grid-template-columns: 1fr; } }

/* Mobil: nu înghesuim header-ul — căutarea trece pe lățime întreagă */
@media (max-width: 820px) {
    .shell-search input { width: 150px; }
    .shell-user-role { display: none; }
}
