:root {
  --min-morado:       #7c3aed;
  --min-morado-oscuro:#16103a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f5f3fc;
}

div#mcirc {
    background: #f5f3fc;
}
/* ── Mapa: una sola pantalla en desktop ─────────────────── */
@media (min-width: 1024px) {
  .mcirc { height: 100vh; max-height: 100vh; overflow: hidden; }
  .mcirc__body { flex: 1; min-height: 0; height: auto; align-items: stretch; }
  .mcirc__sidebar, .mcirc__stats {
    overflow-y: auto; min-height: 0; height: auto;
    align-self: stretch; scrollbar-width: thin;
    scrollbar-color: #cdbff0 transparent;
  }
  .mcirc__sidebar::-webkit-scrollbar,
  .mcirc__stats::-webkit-scrollbar { width: 6px; }
  .mcirc__sidebar::-webkit-scrollbar-thumb,
  .mcirc__stats::-webkit-scrollbar-thumb { background: #cdbff0; border-radius: 3px; }
  .mcirc__main { min-height: 0; }
  .mcirc__main-header { padding: 12px 24px 10px; }
  .mcirc__leaflet { flex: 1 1 0; height: auto; min-height: 0; }
  .mcirc__chart-wrap, .mcirc__tabla-wrap { overflow-y: auto; min-height: 0; }
}

/* ── Header top ─────────────────────────────────────────── */
.mcirc__header-top {
  background: #f5f3fc;
  padding: 20px 32px 0;
  text-align: center;
}
.mcirc__header-top .mcirc__main-title {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 900;
  color: #16103a;
  letter-spacing: -0.5px;
  line-height: 1;
}

/* ── Tabs ───────────────────────────────────────────────── */
.mcirc__tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f3fc;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  padding: 12px 32px 14px;
  gap: 0;
  border-bottom: 1px solid #e8e4f4;
}
.mcirc__tabs::-webkit-scrollbar { display: none; }

.mcirc__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 20px;
  border: none;
  border-right: 1px solid #e0d8f4;
  background: none;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  gap: 3px;
  transition: color 0.15s;
}
.mcirc__tab:first-child { padding-left: 0; }
.mcirc__tab:last-of-type { border-right: none; }
.mcirc__tab:hover .mcirc__tab-count { color: #7c3aed; }
.mcirc__tab-count {
  font-size: 28px;
  font-weight: 900;
  color: #b0a8cc;
  line-height: 1;
  transition: color 0.15s;
}
.mcirc__tab--active .mcirc__tab-count { color: #16103a; }
.mcirc__tab-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #b0a8cc;
  transition: color 0.15s;
}
.mcirc__tab--active .mcirc__tab-label { color: #7c3aed; }
.mcirc__tab--active { position: relative; }
.mcirc__tab--active::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: #7c3aed;
  border-radius: 2px;
}

/* ── Body principal ─────────────────────────────────────── */
.mcirc__body {
  display: flex;
  align-items: flex-start;
  min-height: 540px;
  background: #f5f3fc;
}

/* ── Sidebar ────────────────────────────────────────────── */
.mcirc__sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #ede8f8;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 10px 20px;
}

.mcirc__card {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(81,45,168,0.12);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.mcirc__card--purple { background: #16103a; color: #fff; }
.mcirc__card--white  { background: #fff; color: #16103a; }

.mcirc__card--white .mcirc__sec-label       { color: rgba(81,45,168,0.45); }
.mcirc__card--white .mcirc__lectura-nombre  { color: #16103a; }
.mcirc__card--white .mcirc__vista-bloque    { background: #f0edf8; }
.mcirc__card--white .mcirc__vista-right     { color: rgba(81,45,168,0.55); }
.mcirc__card--white .mcirc__vista-nombre    { color: #16103a; }
.mcirc__card--white .mcirc__capa-pill       { background: #f0edf8; border-color: #ddd8f4; color: #512da8; }
.mcirc__card--white .mcirc__capa-pill:hover { background: #e8e2f8; color: #311b92; }
.mcirc__card--white .mcirc__capa-pill--active { background: #512da8; border-color: #512da8; color: #fff; }
.mcirc__card--white .mcirc__filtro--rutas   { color: #666; }
.mcirc__card--white .mcirc__filtro-cnt      { color: #9580c8; }
.mcirc__card--white .mcirc__detalle-nombre  { color: #16103a; }
.mcirc__card--white .mcirc__detalle-lugar   { color: #9580c8; }
.mcirc__card--white .mcirc__detalle-desc    { color: #666; }
.mcirc__card--white .mcirc__detalle-close   { color: #c0b0e8; }
.mcirc__card--white .mcirc__detalle-close:hover { color: #512da8; }

.mcirc__mod-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(180,160,255,0.7);
  margin-bottom: 8px;
}
.mcirc__sidebar-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
  color: #fff;
  letter-spacing: -0.3px;
}
.mcirc__sidebar-desc {
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255,255,255,0.58);
}

.mcirc__sidebar-tabs {
  display: flex;
  gap: 5px;
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(81,45,168,0.12);
  flex-shrink: 0;
}
.mcirc__sidebar-tab {
  flex: 1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #8a7fb8;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mcirc__sidebar-tab:hover { color: #512da8; background: #f4f0fc; }
.mcirc__sidebar-tab--active { background: #512da8; color: #fff; }

.mcirc__sec-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(180,160,255,0.55);
}

.mcirc__lectura-activa { display: flex; flex-direction: column; gap: 3px; }
.mcirc__lectura-nombre { font-size: 14px; font-weight: 800; color: #fff; letter-spacing: 0.3px; }
.mcirc__vista-bloque {
  background: var(--min-morado-oscuro);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.mcirc__vista-right { font-size: 11px; color: rgba(255,255,255,0.6); }
.mcirc__vista-nombre { font-size: 13px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }

.mcirc__capa-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mcirc__capa-pill {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 99px;
  color: rgba(255,255,255,0.75);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mcirc__capa-pill:hover { background: rgba(255,255,255,0.14); color: #fff; }
.mcirc__capa-pill--active { background: #fff; border-color: #fff; color: #16103a; }

.mcirc__filtro--rutas {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  user-select: none;
  transition: color 0.15s;
}
.mcirc__filtro--rutas:hover { color: #fff; }
.mcirc__filtro-check {
  appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.mcirc__filtro-check:checked { background: var(--min-morado); border-color: var(--min-morado); }
.mcirc__filtro-check:checked::after {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5l3 4L11 1' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/10px no-repeat;
}
.mcirc__filtro-dot--line { width:10px; height:10px; border-radius:2px; display:flex; align-items:center; justify-content:center; background:#94a3b8; flex-shrink:0; }
.mcirc__filtro-dot--line span { display:block; width:10px; height:2px; background:rgba(255,255,255,0.7); border-radius:1px; }
.mcirc__filtro-txt { flex: 1; }
.mcirc__filtro-cnt { font-size:11px; font-weight:700; color:rgba(180,160,255,0.7); }

.mcirc__dept-select {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  color: rgba(255,255,255,0.88);
  padding: 9px 32px 9px 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  font-family: inherit; cursor: pointer; outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.5)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 8px;
}
.mcirc__dept-select:focus { border-color: rgba(180,160,255,0.6); }
.mcirc__dept-select option { background: #1e1548; color: #fff; }

.mcirc__detalle { position: relative; display: flex; flex-direction: column; gap: 5px; }
.mcirc__detalle-close {
  position: absolute; top:10px; right:10px;
  background:none; border:none; color:rgba(255,255,255,0.45);
  cursor:pointer; font-size:13px; line-height:1; padding:2px 4px; transition:color 0.15s;
}
.mcirc__detalle-close:hover { color: #fff; }
.mcirc__detalle-tipo { display:inline-block; font-size:9px; font-weight:700; letter-spacing:1px; color:#fff; padding:2px 8px; border-radius:99px; align-self:flex-start; }
.mcirc__detalle-nombre { font-size:13px; font-weight:700; color:#fff; line-height:1.4; padding-right:20px; }
.mcirc__detalle-lugar { font-size:11px; color:rgba(180,160,255,0.8); font-weight:500; }
.mcirc__detalle-desc { font-size:11px; color:rgba(255,255,255,0.58); line-height:1.6; }

.mcirc__vacios-tags { display:flex; flex-wrap:wrap; gap:6px; }
.mcirc__vacio-tag {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  font-size: 9.5px; font-weight:600;
  color: rgba(255,255,255,0.55);
  padding: 3px 8px; letter-spacing:0.3px;
}
.mcirc__vacio-tag--more { background:rgba(180,160,255,0.12); color:rgba(180,160,255,0.8); border-color:rgba(180,160,255,0.2); }

/* ── Contenido principal ────────────────────────────────── */
.mcirc__main { flex:1; min-width:0; display:flex; flex-direction:column; }

.mcirc__main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0edf8;
  flex-shrink: 0;
  gap: 16px;
}
.mcirc__main-title { font-size:18px; font-weight:800; color:#16103a; letter-spacing:-0.3px; line-height:1.25; }
.mcirc__main-desc { font-size:12px; color:#888; line-height:1.6; margin-top:4px; }

.mcirc__view-btns { display:flex; gap:4px; flex-shrink:0; background:#f4f0fa; border-radius:8px; padding:4px; }
.mcirc__view-btn {
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
  background:none; border:none; border-radius:6px; cursor:pointer; color:#9585c8;
  transition: background 0.15s, color 0.15s;
}
.mcirc__view-btn svg { width:18px; height:18px; }
.mcirc__view-btn:hover { background:rgba(255,255,255,0.7); color:var(--min-morado); }
.mcirc__view-btn--active { background:#fff; color:var(--min-morado); }

/* ── Mapa Leaflet ───────────────────────────────────────── */
.mcirc__map-card { flex:1; display:flex; flex-direction:column; padding:14px 24px 0; gap:0; min-height:0; position:relative; }
.mcirc__leaflet {
  height: calc(100vh - 380px);
  min-height: 420px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e8e4f4;
  box-shadow: 0 2px 16px rgba(81,45,168,0.07);
}
.mcirc__leaflet--pan { cursor: grab !important; }
.mcirc__leaflet--pan:active { cursor: grabbing !important; }

.mcirc__pan-ctrl-btn {
  width:36px!important; height:36px!important; background:#fff!important; border:none!important;
  border-radius:10px!important; box-shadow:0 2px 12px rgba(81,45,168,0.18)!important;
  cursor:pointer!important; display:flex!important; align-items:center!important; justify-content:center!important;
  color:#512da8!important; transition:background 0.15s,color 0.15s!important; padding:0!important;
}
.mcirc__pan-ctrl-btn svg { width:17px; height:17px; pointer-events:none; }
.mcirc__pan-ctrl-btn:hover { background:#f0edf8!important; color:#311b92!important; }
.mcirc__pan-ctrl-btn--active { background:#512da8!important; color:#fff!important; }
.mcirc__nodo-icon { background:none!important; border:none!important; }

.mcirc__leaflet .leaflet-control-zoom { border:none!important; box-shadow:0 2px 12px rgba(81,45,168,0.18)!important; border-radius:10px!important; overflow:hidden; }
.mcirc__leaflet .leaflet-control-zoom-in,
.mcirc__leaflet .leaflet-control-zoom-out {
  width:36px!important; height:36px!important; line-height:36px!important; font-size:18px!important;
  font-weight:300!important; color:#512da8!important; background:#fff!important; border:none!important;
  border-bottom:1px solid #ede8f8!important; transition:background 0.15s,color 0.15s!important;
  display:flex!important; align-items:center!important; justify-content:center!important;
}
.mcirc__leaflet .leaflet-control-zoom-out { border-bottom:none!important; }
.mcirc__leaflet .leaflet-control-zoom-in:hover,
.mcirc__leaflet .leaflet-control-zoom-out:hover { background:#f0edf8!important; color:#311b92!important; }
.mcirc__leaflet .leaflet-container { cursor:default!important; }

.mcirc-dept-tip {
  background:#16103a; border:none; border-radius:6px; color:#fff;
  font-size:11.5px; font-weight:600; padding:5px 10px;
  box-shadow:0 2px 10px rgba(0,0,0,0.25); font-family:'Segoe UI',system-ui,sans-serif;
}
.mcirc-dept-tip::before { display:none; }

.mcirc__leyenda { display:flex; align-items:center; gap:20px; padding:12px 4px 16px; flex-wrap:wrap; }
.mcirc__leyenda-title { font-size:9px; font-weight:700; letter-spacing:2px; color:#bbb; margin-right:4px; }
.mcirc__leyenda-item { display:flex; align-items:center; gap:5px; font-size:11px; color:#888; }
.mcirc__leyenda-dot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.mcirc__leyenda-diamond { flex-shrink:0; display:block; }
.mcirc__leyenda-dash { width:16px; height:2px; background:repeating-linear-gradient(90deg,#94a3b8 0,#94a3b8 4px,transparent 4px,transparent 7px); flex-shrink:0; }

/* ── Grafico ────────────────────────────────────────────── */
.mcirc__chart-wrap, .mcirc__tabla-wrap { flex:1; overflow-y:auto; padding:20px 24px; }
.mcirc__chart-title { margin-bottom:20px; }
.mcirc__sec-label-dark { font-size:9px; font-weight:700; letter-spacing:2px; color:#9585c8; display:block; margin-bottom:4px; }
.mcirc__chart-title h3 { font-size:20px; font-weight:800; color:#16103a; letter-spacing:-0.3px; }
.mcirc__chart-list { display:flex; flex-direction:column; gap:14px; }
.mcirc__chart-row { display:flex; align-items:flex-start; gap:14px; }
.mcirc__chart-rank { font-size:13px; font-weight:800; color:rgba(180,160,255,0.6); min-width:20px; text-align:center; padding-top:2px; }
.mcirc__chart-info { flex:1; display:flex; flex-direction:column; gap:4px; }
.mcirc__chart-top { display:flex; justify-content:space-between; align-items:baseline; }
.mcirc__chart-dept { font-size:14px; font-weight:700; color:#16103a; }
.mcirc__chart-cnt { font-size:14px; font-weight:800; color:var(--min-morado); }
.mcirc__chart-cnt small { font-size:9px; font-weight:600; color:#bbb; text-transform:uppercase; letter-spacing:1px; }
.mcirc__chart-bar { height:6px; background:#f0edf8; border-radius:3px; overflow:hidden; }
.mcirc__chart-fill { height:100%; background:var(--min-morado); border-radius:3px; transition:width 0.4s ease; }
.mcirc__chart-pct { font-size:10px; color:#bbb; letter-spacing:0.3px; }

/* ── Tabla ──────────────────────────────────────────────── */
.mcirc__tabla-scroll { overflow-x:auto; border:1px solid #ede8f8; border-radius:10px; margin-top:16px; }
.mcirc__tabla { width:100%; border-collapse:collapse; font-size:13px; }
.mcirc__tabla thead tr { background:#f8f6fe; }
.mcirc__tabla th { padding:10px 16px; text-align:left; font-size:9px; font-weight:700; letter-spacing:1.5px; color:#9585c8; white-space:nowrap; border-bottom:1px solid #ede8f8; }
.mcirc__tabla td { padding:10px 16px; border-bottom:1px solid #f5f3fc; color:#444; }
.mcirc__tabla tbody tr:last-child td { border-bottom:none; }
.mcirc__tabla tbody tr:hover td { background:#f8f6fe; }
.mcirc__tabla-row--active td { background:#f0edf8; }
.mcirc__tabla-dept { font-weight:700; color:#16103a; }
.mcirc__tabla-total { font-weight:800; color:var(--min-morado); }

/* ── Panel lectura rapida ───────────────────────────────── */
.mcirc__stats {
  width: 220px;
  flex-shrink: 0;
  background: #f5f3fc;
  border-left: 1px solid #e8e4f4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 0 16px;
}
.mcirc__lectura-rapida { background:var(--min-morado-oscuro); padding:18px 16px; display:flex; flex-direction:column; gap:6px; margin-bottom:4px; }
.mcirc__lectura-rapida .mcirc__sec-label { color:rgba(180,160,255,0.7); }
.mcirc__lr-titulo { font-size:15px; font-weight:800; color:#fff; line-height:1.3; letter-spacing:-0.2px; }
.mcirc__lr-cobertura { display:flex; flex-direction:column; gap:4px; margin-top:4px; }
.mcirc__lr-pct { font-size:36px; font-weight:900; color:#fff; line-height:1; }
.mcirc__lr-lbl { font-size:9px; font-weight:700; letter-spacing:2px; color:rgba(255,255,255,0.55); text-transform:uppercase; }
.mcirc__lr-bar { height:5px; background:rgba(255,255,255,0.15); border-radius:3px; overflow:hidden; margin:4px 0 2px; }
.mcirc__lr-bar-fill { height:100%; background:#10b981; border-radius:3px; transition:width 0.4s ease; }
.mcirc__lr-sub { font-size:10px; color:rgba(255,255,255,0.55); line-height:1.4; }

.mcirc__stat-card { background:#fff; border:1px solid #ede8f8; border-radius:8px; padding:10px 14px; display:flex; flex-direction:column; gap:4px; margin:0 10px; }
.mcirc__stat-num { font-size:28px; font-weight:800; color:#16103a; line-height:1; }
.mcirc__stat-meta { display:flex; align-items:center; gap:6px; }
.mcirc__stat-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.mcirc__stat-label { font-size:10.5px; color:#888; line-height:1.3; }
.mcirc__stat-card--rutas { border-color:#e2e8f0; }

.mcirc__stat-total { margin:4px 10px 0; padding:12px; background:var(--min-morado); border-radius:8px; display:flex; flex-direction:column; align-items:center; gap:2px; }
.mcirc__stat-total-num { font-size:32px; font-weight:800; color:#fff; line-height:1; }
.mcirc__stat-total-lbl { font-size:9px; font-weight:700; letter-spacing:1.5px; color:rgba(255,255,255,0.7); text-transform:uppercase; }

.mcirc__stat-footer { margin:4px 10px 0; font-size:10.5px; color:#999; line-height:1.7; padding:10px 12px; background:#fff; border:1px solid #ede8f8; border-radius:8px; }
.mcirc__stat-footer strong { color:#444; }

@media (min-width: 1024px) {
  .mcirc__stats { gap:4px; }
  .mcirc__lectura-rapida { padding:12px 16px; gap:3px; margin-bottom:2px; }
  .mcirc__lr-pct { font-size:26px; }
  .mcirc__stat-card { padding:6px 12px; gap:2px; }
  .mcirc__stat-num { font-size:21px; }
  .mcirc__stat-label { font-size:9.5px; }
  .mcirc__stat-total { padding:9px; margin-top:2px; }
  .mcirc__stat-total-num { font-size:24px; }
  .mcirc__stat-footer { padding:8px 12px; font-size:10px; line-height:1.55; margin-top:2px; }
}

/* ── MENU DE RUTAS (región → departamentos) ──────────────── */
.mcirc__region-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.mcirc__region-group {
  border-bottom:1px solid #f0ecfa;
  padding-bottom:4px;
}

.mcirc__region-head {
  display:flex; align-items:center; gap:8px; width:100%;
  padding:9px 8px; border-radius:6px;
}
.mcirc__region-head:hover { background:#f7f5fd; }
.mcirc__region-head--open { background:#f2eefb; }

.mcirc__region-check {
  accent-color:#7c3aed; cursor:pointer;
  width:15px; height:15px; flex-shrink:0; margin:0;
}
.mcirc__region-toggle {
  display:flex; align-items:center; gap:8px; flex:1;
  cursor:pointer; font-size:13px; font-weight:600; color:#16103a;
}
.mcirc__region-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.mcirc__region-name { flex:1; text-align:left; }
.mcirc__region-arrow { color:#9585c8; font-size:11px; }





.mcirc__dept-check {
  display:flex; align-items:center; gap:8px;
  padding:6px 8px 6px 26px; cursor:pointer;
  font-size:12.5px; color:#4b4470; border-radius:6px;
}
.mcirc__dept-check:hover { background:#f7f5fd; }
.mcirc__dept-check input { accent-color:#7c3aed; cursor:pointer; width:14px; height:14px; }
.mcirc__dept-name { flex:1; }


/* Barra de scroll discreta */
.mcirc__region-list::-webkit-scrollbar { width: 6px; }
.mcirc__region-list::-webkit-scrollbar-track { background: transparent; }
.mcirc__region-list::-webkit-scrollbar-thumb {
  background: #d4cbe8;
  border-radius: 3px;
}
.mcirc__region-list::-webkit-scrollbar-thumb:hover { background: #b8a9dc; }



.mcirc__circuito-group { border-bottom:1px solid #e8e0f5; padding-bottom:6px; margin-bottom:4px; }
.mcirc__circuito-head {
  display:flex; align-items:center; gap:8px; width:100%;
  padding:10px 8px; border-radius:6px;
}
.mcirc__circuito-head:hover { background:#f5f2fc; }
.mcirc__circuito-head--open { background:#efe9fa; }
.mcirc__circuito-name {
  flex:1; text-align:left; font-size:13px; font-weight:700;
  color:#16103a; text-transform:uppercase; letter-spacing:.02em;
}
.mcirc__region-group--nested { margin-left:16px; border-bottom:none; }
.mcirc__dept-check--nested { padding-left:42px; }


.mcirc-ruta-tip { max-width:260px !important; font-size:12px; line-height:1.45; white-space:normal; }



.leaflet-tooltip.mcirc-ruta-tip {
  max-width: 280px !important;
  min-width: 180px !important;
  width: auto !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  padding: 8px 10px !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

.mcirc__clear-all {
  -webkit-appearance:none; appearance:none;
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 14px; border:none; border-radius:999px;
  background:#fff; color:#6d28d9; cursor:pointer;
  font-family:inherit; font-size:13px; font-weight:600;
  box-shadow:0 2px 8px rgba(0,0,0,.10);
  transition:background .15s, color .15s;
}
.mcirc__clear-all:hover { background:#f5f0fc; color:#5b21b6; }
.mcirc__clear-all svg { width:15px; height:15px; }



/* ═══════════════════════════════════════════════════════════
   CONTENCIÓN DE ANCHO — SharePoint + componente
   (aplica en todos los tamaños)
   ═══════════════════════════════════════════════════════════ */
.ms-webpart-zone.ms-fullWidth,
#MSOZoneCell_WebPartWPQ7,
.ms-webpart-chrome-vertical,
.ms-WPBody,
.ms-rtestate-field {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.mcirc {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

.mcirc__body   { min-width: 0; max-width: 100%; }
.mcirc__main   { flex: 1 1 0; min-width: 0; max-width: 100%; }
.mcirc__map-card,
.mcirc__leaflet { min-width: 0; max-width: 100%; }

/* z-index bajo para no tapar widgets flotantes de SharePoint */
.mcirc__map-card { z-index: 0; }
.mcirc__leaflet  { z-index: 0; }
.mcirc__leaflet .leaflet-pane,
.mcirc__leaflet .leaflet-control { z-index: 1 !important; }
.mcirc__leaflet .leaflet-top,
.mcirc__leaflet .leaflet-bottom  { z-index: 2 !important; }

/* Párrafo descriptivo del header */
.mcirc__header-top p {
  font-size: 13px;
  color: #6b6390;
  line-height: 1.6;
  margin-top: 8px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ≥1600px  → desktop amplio (anchos originales)
   1024–1599 → desktop mediano (paneles compactos)
   ≤1023px  → móvil + tablet (mapa + rutas)
   ≤480px   → móvil pequeño
   ═══════════════════════════════════════════════════════════ */

/* ── DESKTOP MEDIANO (1024px – 1599px) ─────────────────────
   Reduce paneles laterales para que quepan los 3 bloques */
@media (min-width: 1024px) and (max-width: 1599px) {
  .mcirc__sidebar { width: 240px; padding: 8px 8px 16px; }
  .mcirc__stats   { width: 180px; }

  .mcirc__card          { padding: 12px 14px; gap: 6px; }
  .mcirc__sidebar-title { font-size: 16px; margin-bottom: 6px; }
  .mcirc__sidebar-desc  { font-size: 11px; line-height: 1.5; }
  .mcirc__sidebar-tab   { font-size: 11px; padding: 7px 6px; }
  .mcirc__capa-pill     { font-size: 9px; padding: 4px 9px; }

  .mcirc__lectura-rapida { padding: 10px 12px; }
  .mcirc__lr-titulo      { font-size: 13px; }
  .mcirc__lr-pct         { font-size: 22px; }
  .mcirc__stat-card      { padding: 6px 10px; margin: 0 8px; }
  .mcirc__stat-num       { font-size: 18px; }
  .mcirc__stat-label     { font-size: 9px; }
  .mcirc__stat-total     { margin: 3px 8px 0; padding: 8px; }
  .mcirc__stat-total-num { font-size: 20px; }
  .mcirc__stat-footer    { margin: 3px 8px 0; padding: 7px 10px; font-size: 9.5px; }

  .mcirc__map-card    { padding: 10px 16px 0; }
  .mcirc__main-header { padding: 10px 16px 8px; }
  .mcirc__main-title  { font-size: 16px; }
  .mcirc__main-desc   { font-size: 11px; }

  .mcirc__tab       { padding: 5px 14px; }
  .mcirc__tab-count { font-size: 22px; }
}

/* ── DESKTOP ANGOSTO (1024px – 1279px): aún más compacto ─── */
@media (min-width: 1024px) and (max-width: 1279px) {
  .mcirc__sidebar       { width: 210px; }
  .mcirc__stats         { width: 160px; }
  .mcirc__sidebar-title { font-size: 14px; }
  .mcirc__capa-pill     { font-size: 8.5px; padding: 3px 7px; }
  .mcirc__stat-num      { font-size: 16px; }
  .mcirc__lr-pct        { font-size: 20px; }
}

/* ── MÓVIL + TABLET (≤1023px) ──────────────────────────────
   Solo: contadores + título + mapa + menú de rutas */
@media (max-width: 480px) {

  /* Contención de ancho */
  html, body { overflow-x: hidden; max-width: 100%; }
  .mcirc {
    height: auto;
    max-height: none;
    overflow: visible;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  .mcirc__body,
  .mcirc__main { width: 100%; max-width: 100%; min-width: 0; }

  /* Header */
  .mcirc__header-top { padding: 14px 16px 0; }
  .mcirc__header-top .mcirc__main-title { font-size: clamp(22px, 6vw, 30px); }
  .mcirc__header-top p { font-size: 12px; margin-top: 6px; }

  /* Contadores: los 4 caben repartidos, botón Limpiar en su línea */
  .mcirc__tabs {
    width: 100%;
    max-width: 100%;
    padding: 10px 8px 12px;
    justify-content: space-between;
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .mcirc__tab {
    padding: 6px 4px;
    flex: 1 1 0;
    min-width: 0;
  }
  .mcirc__tab-count { font-size: 17px; }
  .mcirc__tab-label {
    font-size: 7px;
    letter-spacing: 0;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
  .mcirc__clear-all {
    flex: 1 1 100%;
    order: 10;
    justify-content: center;
    margin-top: 8px;
  }

  /* Body en columna: mapa primero, rutas después */
  .mcirc__body { flex-direction: column; min-height: 0; }

  /* Contenido principal (mapa) */
  .mcirc__main        { order: 1; }
  .mcirc__main-header { padding: 14px 16px 12px; flex-wrap: wrap; }
  .mcirc__main-title  { font-size: 16px; }
  .mcirc__view-btns   { display: none; }

  .mcirc__map-card {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px 0;
    min-width: 0;
  }
  .mcirc__leaflet {
    width: 100%;
    max-width: 100%;
    height: 60vh;
    min-height: 340px;
    max-height: none;
  }
  .mcirc__leyenda { gap: 12px; padding: 10px 4px 14px; }

  /* Sidebar: solo el panel de RUTAS, debajo del mapa */
  .mcirc__sidebar {
    display: flex;
    width: 100%;
    order: 2;
    padding: 12px;
  }
  .mcirc__sidebar .mcirc__card--purple { display: none; }
  .mcirc__sidebar-tabs                 { display: none; }
  #panelCapas,
  #panelTerritorio,
  #detalleCard                         { display: none !important; }
  #panelRutas                          { display: block !important; }
  .mcirc__region-list                  { max-height: 300px; }

  /* Panel de stats oculto en móvil */
  .mcirc__stats { display: none; }

  /* Vistas gráfico/tabla con padding reducido */
  .mcirc__chart-wrap,
  .mcirc__tabla-wrap { padding: 16px; }
}

/* ── MÓVIL PEQUEÑO (≤480px) ────────────────────────────────*/
@media (max-width: 480px) {
  .mcirc__leaflet   { height: 52vh; min-height: 280px; }
  .mcirc__tab       { padding: 5px 3px; }
  .mcirc__tab-count { font-size: 15px; }
  .mcirc__tab-label { font-size: 6.5px; }
  .mcirc__map-card  { padding: 8px 8px 0; }
  .mcirc__sidebar   { padding: 10px 8px; }
}




