/* =========================================================
   MarketView - Echipa de vânzări
   ========================================================= */
.tm-kpis .al-kpi { cursor: default; }
.tm-kpis .al-kpi .change { display: block; font-size: 12px; margin-top: 2px; }
.al-ic.orange2 { background: #f97316; } .al-ic.purple { background: #a855f7; } .al-ic.sky { background: #38bdf8; }

.tm-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr) 430px; gap: 10px; margin-bottom: 10px; align-items: stretch; }
.tm-filters { position: static; }
.tm-period { display: flex; align-items: center; gap: 8px; height: 34px; border: 1px solid #d5dce6; border-radius: 6px; padding: 0 10px; font-size: 12.5px; background: #f8fafc; }
.tm-filters small { display: block; font-size: 10.5px; margin-top: 4px; }

/* Hartă */
.tm-map-card { position: relative; padding: 0; overflow: hidden; min-height: 470px; }
#tmMap { position: absolute; inset: 0; background: #e9eef4; font-family: Inter, sans-serif; }
.tm-view { position: absolute; top: 10px; right: 10px; z-index: 600; box-shadow: 0 2px 10px rgba(16,24,40,.15); }
.tm-legend {
    position: absolute; top: 52px; right: 10px; z-index: 600; 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; max-height: calc(100% - 120px); overflow-y: auto;
}
.tm-legend h5 { margin: 0 0 5px; font-size: 12px; }
.tm-legend div { display: flex; align-items: center; gap: 7px; padding: 2px 0; cursor: pointer; white-space: nowrap; }
.tm-legend div:hover { color: var(--primary); }
.tm-legend div.active { font-weight: 700; }
.tm-legend i { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.tm-avatar {
    position: absolute; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font: 800 12px Inter, sans-serif; color: #fff;
    border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer; transition: transform .15s;
}
.tm-avatar:hover, .tm-avatar.selected { transform: translate(-50%, -50%) scale(1.2); }
.tm-avatar.selected { box-shadow: 0 0 0 3px var(--primary), 0 2px 8px rgba(0,0,0,.35); }
.tm-code { position: absolute; transform: translate(-50%, -50%); font: 700 10.5px Inter, sans-serif; color: #1f2d44; pointer-events: none; text-shadow: 0 0 3px rgba(255,255,255,.8); }
.tm-map-card.satellite .tm-code { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); }

/* Panou agent */
.tm-detail { position: static; max-height: none; }
.tm-detail .ms-detail-body { max-height: 390px; }
.tm-detail-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px 8px; }
.tm-detail-head h2 { font-size: 18px; font-weight: 800; }
.tm-detail-head h2 i { font-size: 10px; vertical-align: 3px; margin-right: 4px; }
.tm-profile { display: grid; grid-template-columns: 78px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 12px; }
.tm-avatar-lg { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; }
.tm-contact { font-size: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tm-contact small { color: var(--muted); font-size: 11.5px; }
.tm-contact div { display: flex; gap: 7px; align-items: center; min-width: 0; }
.tm-contact i { color: var(--primary); width: 13px; }
.tm-contact a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-facts { margin: 0; font-size: 12px; }
.tm-facts dt { color: var(--muted); font-size: 11px; }
.tm-facts dd { margin: 0 0 6px; font-weight: 600; }
.tm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.tm-tiles > div { display: flex; gap: 8px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 8px; min-width: 0; }
.tm-tiles b { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.tm-tiles small { display: block; font-size: 10.5px; color: #4b5669; }
.tm-tiles .change { font-size: 11px; }
.tm-tile-ic { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.tm-tile-ic.green { background: #e7f7ec; color: var(--green); } .tm-tile-ic.purple { background: #f3e8ff; color: #a855f7; }
.tm-tile-ic.red { background: var(--red-soft); color: var(--red); }
.tm-evo-head { margin: 6px 0 4px; }
.tm-evo-head h3 { font-size: 12.5px; }
.tm-outcomes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tm-visits li { padding-bottom: 10px; }
.tm-obj td { vertical-align: middle; }
.tm-obj .bar { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.tm-obj .bar .progress { flex: 1; min-width: 50px; }

/* Jos */
.tm-bottom { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 10px; align-items: start; }
.tm-perf .segmented-light button { padding: 4px 8px; font-size: 11px; }
.tm-perf-row { display: grid; grid-template-columns: 26px 120px minmax(0, 1fr) 70px; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; cursor: pointer; }
.tm-perf-row:hover { color: var(--primary); }
.tm-perf-row.selected { font-weight: 700; }
.tm-perf-row .av { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 9.5px; font-weight: 800; }
.tm-perf-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-perf-row .track { height: 14px; background: #eef2f7; border-radius: 3px; overflow: hidden; }
.tm-perf-row .fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 3px; transition: width .4s; }
.tm-perf-row .v { text-align: right; font-variant-numeric: tabular-nums; }
.tm-table td { white-space: nowrap; }
.tm-table tbody tr { cursor: pointer; }
.tm-table tbody tr.selected { background: #eaf2ff !important; }
.tm-table .terr { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.tm-table .pbar { display: flex; align-items: center; gap: 6px; }
.tm-table .pbar .progress { flex: 1; height: 10px; }
.tm-table .pbar small { width: 34px; text-align: right; }

/* Modal */
.tm-modal { width: 720px; }
.tm-counties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; max-height: 190px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.tm-counties .check { font-size: 12px; }

@media (max-width: 1700px) {
    .tm-grid { grid-template-columns: 195px minmax(0, 1fr) 400px; }
    .tm-bottom { grid-template-columns: 380px minmax(0, 1fr); }
    .tm-perf-row { grid-template-columns: 26px 100px minmax(0, 1fr) 62px; }
}
@media (max-width: 1400px) {
    .tm-grid { grid-template-columns: 195px minmax(0, 1fr); }
    .tm-detail { grid-column: 1 / -1; }
    .tm-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .tm-grid { grid-template-columns: minmax(0, 1fr); }
    .tm-map-card { min-height: 420px; }
    .tm-profile { grid-template-columns: 72px minmax(0, 1fr); }
    .tm-facts { grid-column: 1 / -1; }
    .tm-counties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tm-kpis b { white-space: nowrap; }
.tm-kpis .tm-unit { display: inline; font-size: 13px; font-weight: 600; color: var(--text); margin-left: 3px; }

