/* =========================================================
   MarketView - Lanțuri & Retaileri
   ========================================================= */
.lt-kpis { grid-template-columns: 1.25fr repeat(7, minmax(0, 1fr)); }
.lt-kpis .ms-kpi em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }
.lt-kpis .ms-kpi .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lt-grid {
    display: grid; gap: 10px; margin-bottom: 10px;
    grid-template-columns: 380px minmax(0, 1fr) 400px;
    grid-template-rows: auto auto;
}
.lt-dist { grid-column: 1; grid-row: 1; }
.lt-evo { grid-column: 1; grid-row: 2; }
.lt-map-card { grid-column: 2; grid-row: 1 / span 2; position: relative; padding: 0; overflow: hidden; min-height: 470px; background: #e9eef4; }
.lt-detail { grid-column: 3; grid-row: 1 / span 2; position: static; max-height: none; }
.lt-detail .ms-detail-body { max-height: 300px; }

/* Distribuție */
.lt-dist-body { grid-template-columns: 150px minmax(0, 1fr); gap: 14px; }
.lt-dist .donut-wrap { height: 150px; }
.lt-legend td { padding: 3.5px 2px; font-size: 12px; }
.lt-legend td:first-child { max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-legend td:nth-child(2) { font-weight: 700; }

/* Hartă */
.lt-map-head {
    position: absolute; top: 10px; left: 10px; z-index: 600; display: flex; align-items: center; gap: 4px;
    background: #fff; border-radius: 8px; padding: 2px 2px 2px 12px; box-shadow: 0 2px 10px rgba(16,24,40,.15);
}
.lt-map-head h3 { font-size: 14px; font-weight: 700; white-space: nowrap; }
.lt-chain-select select { box-shadow: none; font-size: 14px; padding: 6px 30px 6px 6px; }
#ltMap { position: absolute; inset: 0; background: #e9eef4; font-family: Inter, sans-serif; }
.lt-map-legend { position: absolute; top: 10px; right: 10px; z-index: 600; min-width: 110px; }
.lt-controls { right: 10px; bottom: 12px; }
.lt-label { position: absolute; transform: translate(-50%, -50%); text-align: center; pointer-events: none; font-family: Inter, sans-serif; line-height: 1.1; white-space: nowrap; }
.lt-label b { display: block; font-size: 10.5px; font-weight: 800; }
.lt-label span { font-size: 10.5px; font-weight: 600; }
.lt-label.light { color: #fff; }
.lt-label.dark { color: #3b1d1d; }

/* Panou lanț */
.lt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lt-tiles > div { border: 1px solid var(--border); border-radius: 8px; padding: 8px; min-width: 0; }
.lt-tiles small { display: block; font-size: 10.5px; color: #1f5fbf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-tiles b { display: block; font-size: 19px; font-weight: 800; margin-top: 4px; white-space: nowrap; }
.lt-tiles .green b { color: var(--green); }
.lt-tiles .orange small, .lt-tiles .orange b { color: #f08a0c; }
.lt-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lt-tiles-3 b { font-size: 16px; }
.lt-dl { grid-template-columns: 110px minmax(0, 1fr); }
.lt-dl a { float: none; font-weight: 500; }
.lt-detail .ms-banner .bb { width: 56px; height: 56px; font-size: 26px; border-width: 3px; }

/* Listă + laterale */
.lt-bottom { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.lt-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lt-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lt-tops .card-head h3 { font-size: 13px; }
.lt-tops .hbar { grid-template-columns: 78px minmax(0, 1fr) 34px; font-size: 12px; padding: 4px 0; }
.lt-tops .hbar > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-tops .hbar-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.lt-list-search { margin: 0; width: 220px; }
.lt-list-search input { height: 30px; font-size: 12px; }
.lt-table tbody tr.is-brand td:nth-child(3) { padding-left: 18px; }
.lt-table tbody tr.is-brand td:nth-child(3)::before { content: '↳ '; color: #9aa6b8; }
.lt-table .cov { display: inline-block; min-width: 54px; text-align: center; padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 11px; }
.lt-table .cov.c1 { background: #fde2e1; color: #b42318; }
.lt-table .cov.c2 { background: #fff1d6; color: #b54708; }
.lt-table .cov.c3 { background: #fef7c3; color: #854d0e; }
.lt-table .cov.c4 { background: #dcfae6; color: #067647; }
.lt-table .cov.c5 { background: #b7f0cb; color: #05603a; }
.lt-table tbody tr.selected { background: #eaf2ff !important; }
.lt-table th a { cursor: pointer; }
.lt-color { padding: 2px 4px; height: 34px; }
.lt-delete { margin-right: auto; color: var(--red); }

/* Responsive */
@media (max-width: 1700px) {
    .lt-grid { grid-template-columns: 330px minmax(0, 1fr) 360px; }
    .lt-dist-body { grid-template-columns: 120px minmax(0, 1fr); }
    .lt-dist .donut-wrap { height: 120px; }
}
@media (max-width: 1500px) {
    .lt-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lt-grid { grid-template-columns: 320px minmax(0, 1fr); }
    .lt-detail { grid-column: 1 / -1; grid-row: auto; }
    .lt-detail .ms-detail-body { max-height: none; }
    .lt-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .lt-grid { grid-template-columns: minmax(0, 1fr); }
    .lt-dist, .lt-evo, .lt-map-card, .lt-detail { grid-column: 1; grid-row: auto; }
    .lt-map-card { min-height: 420px; }
    .lt-tops { grid-template-columns: 1fr; }
    .lt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Ecrane cu meniu lateral (sub 1700px): lista pe toată lățimea, topurile și vânzările dedesubt */
@media (max-width: 1700px) {
    .lt-grid { grid-template-columns: 340px minmax(0, 1fr) 350px; }
    .lt-dist .card-head { flex-wrap: wrap; }
    .lt-bottom { grid-template-columns: minmax(0, 1fr); }
    .lt-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); }
    .lt-tops { display: contents; }
    .lt-evo .card-head h3 { font-size: 13px; }
}
@media (max-width: 1100px) { .lt-side { grid-template-columns: minmax(0, 1fr); } }

/* Legenda hărții */
.lt-map-legend { background: rgba(255,255,255,.96); border-radius: 8px; padding: 8px 12px; box-shadow: 0 2px 10px rgba(16,24,40,.15); font-size: 11.5px; }
.lt-map-legend h5 { margin: 0 0 5px; font-size: 11.5px; font-weight: 700; }
.lt-map-legend .lg-row { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; }
.lt-map-legend .lg-row i { width: 11px; height: 11px; flex-shrink: 0; }

/* Tabel: coloane înguste pentru bifă și număr, nume pe un rând */
.lt-table th:nth-child(1), .lt-table td:nth-child(1) { width: 26px; }
.lt-table th:nth-child(2), .lt-table td:nth-child(2) { width: 26px; }
.lt-table td:nth-child(3) { white-space: nowrap; min-width: 150px; }
.lt-table td:nth-child(5) { min-width: 110px; }
.lt-table td:nth-child(11) { white-space: nowrap; }
