/* MBTECH Operations Platform — tema (colores de la presentación comercial MBTECH OPS) */
:root {
  --mb-navy: #071827;
  --mb-navy-2: #0d2438;
  --mb-navy-3: #14324c;
  --mb-cyan: #00aeef;
  --mb-green: #20d69b;
  --mb-amber: #f2b84b;
  --mb-red: #e5484d;
  --mb-bg: #f4f6fa;
  --mb-card: #ffffff;
  --mb-border: #e2e8ef;
  --mb-text: #0f2133;
  --mb-muted: #5d6f82;
  --bs-primary: #0094cc;
  --bs-primary-rgb: 0, 148, 204;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --bs-body-color: var(--mb-text);
  --bs-border-color: var(--mb-border);
}

body { background: var(--mb-bg); font-size: .925rem; -webkit-font-smoothing: antialiased; }
a { color: #0083b8; }
.btn-primary { --bs-btn-bg: #0094cc; --bs-btn-border-color: #0094cc; --bs-btn-hover-bg: #007aa8; --bs-btn-hover-border-color: #007aa8; }
.btn-outline-primary { --bs-btn-color: #0083b8; --bs-btn-border-color: #0094cc; --bs-btn-hover-bg: #0094cc; --bs-btn-hover-border-color: #0094cc; }

/* Layout */
.mb-shell { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--mb-navy) 268px, var(--mb-bg) 268px); }
.mb-sidebar { width: 268px; flex: 0 0 268px; background: linear-gradient(180deg, #08192a 0%, #0a2135 100%); color: #b9c8d8; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #24435f transparent; }
.mb-brand { display: flex; align-items: center; gap: .65rem; padding: 1.05rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.06); text-decoration: none; }
.mb-brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--mb-cyan), var(--mb-green)); display: grid; place-items: center; color: var(--mb-navy); font-weight: 800; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,174,239,.25); }
.mb-brand-name { color: #fff; font-weight: 700; letter-spacing: .02em; line-height: 1.1; }
.mb-brand-name small { display: block; color: #7f97ad; font-weight: 500; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.mb-nav { padding: .6rem .6rem 2rem; }
.mb-nav-home { display: grid; gap: 2px; padding-bottom: .3rem; }
.mb-link, .mb-mod-pages a { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; color: #c3d2e0; text-decoration: none; border-radius: 9px; font-size: .875rem; }
.mb-link:hover, .mb-mod-pages a:hover { background: rgba(255,255,255,.05); color: #fff; }
.mb-link.active { background: rgba(0,174,239,.14); color: #fff; }
.mb-link i { font-size: 1rem; opacity: .85; width: 1.1rem; text-align: center; }
.mb-count { margin-left: auto; background: var(--mb-red); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; }
.mb-nav-section { padding: 1rem .75rem .35rem; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #5f7a93; font-weight: 700; }
.mb-mod { border-radius: 10px; margin-bottom: 2px; }
.mb-mod[open] { background: rgba(255,255,255,.035); }
.mb-mod > summary { list-style: none; display: flex; align-items: center; gap: .6rem; padding: .42rem .6rem; border-radius: 10px; cursor: pointer; color: #d5e1ec; font-size: .875rem; font-weight: 550; user-select: none; }
.mb-mod > summary::-webkit-details-marker { display: none; }
.mb-mod > summary:hover { background: rgba(255,255,255,.05); color: #fff; }
.mb-mod > summary.current { color: #fff; }
.mb-mod-ico { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--mod) 24%, transparent); color: color-mix(in srgb, var(--mod) 55%, #fff); font-size: .9rem; }
.mb-mod > summary.current .mb-mod-ico { background: var(--mod); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--mod) 45%, transparent); }
.mb-mod-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-chev { font-size: .7rem; opacity: .5; transition: transform .15s; }
.mb-mod[open] .mb-chev { transform: rotate(180deg); }
.mb-soon { font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #cfe8a8; background: rgba(132,204,22,.15); border-radius: 999px; padding: .08rem .4rem; }
.mb-mod-pages { display: grid; gap: 1px; padding: .15rem 0 .45rem 1.35rem; margin-left: .95rem; border-left: 1px solid rgba(255,255,255,.08); }
.mb-mod-pages a { padding: .36rem .6rem; font-size: .84rem; color: #aebfcf; }
.mb-mod-pages a i { font-size: .9rem; opacity: .7; }
.mb-mod-pages a.active { color: #fff; background: color-mix(in srgb, var(--mod) 22%, transparent); box-shadow: inset 3px 0 0 var(--mod); }
.mb-main { flex: 1; min-width: 0; }
.mb-topbar { background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--mb-border); padding: .6rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 10; }
.mb-topbar .tenant { font-weight: 600; }
.mb-content { padding: 1.25rem 1.5rem 3rem; max-width: 1560px; }
.mb-page-title { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.mb-page-title h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.mb-page-title .sub { color: var(--mb-muted); font-size: .85rem; margin-top: .15rem; }
.env-badge { font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }

/* Banda del módulo (identidad + migas + pestañas) en cada pantalla */
.mb-band { background: linear-gradient(100deg, color-mix(in srgb, var(--mod) 9%, #fff) 0%, #fff 55%); border: 1px solid var(--mb-border); border-left: 4px solid var(--mod); border-radius: 14px; padding: .7rem 1rem .1rem; margin-bottom: 1.15rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.mb-band-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding-bottom: .55rem; }
.mb-band-mod { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--mb-text); font-weight: 700; font-size: 1rem; line-height: 1.1; }
.mb-band-mod small { display: block; font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--mod) 80%, #000); }
.mb-band .mb-mod-ico { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; background: var(--mod); color: #fff; font-size: 1.05rem; box-shadow: 0 3px 10px color-mix(in srgb, var(--mod) 35%, transparent); }
.mb-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .8rem; color: var(--mb-muted); }
.mb-crumbs a { color: var(--mb-muted); text-decoration: none; }
.mb-crumbs a:hover { color: var(--mb-text); text-decoration: underline; }
.mb-crumbs i { font-size: .6rem; opacity: .6; }
.mb-crumbs span { color: var(--mb-text); font-weight: 600; }
.mb-tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; border-top: 1px solid color-mix(in srgb, var(--mod) 14%, var(--mb-border)); margin: 0 -1rem; padding: 0 .75rem; }
.mb-tabs::-webkit-scrollbar { display: none; }
.mb-tabs a { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; padding: .6rem .7rem .55rem; font-size: .84rem; color: var(--mb-muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 550; }
.mb-tabs a:hover { color: var(--mb-text); }
.mb-tabs a.active { color: color-mix(in srgb, var(--mod) 85%, #000); border-bottom-color: var(--mod); }

/* Cards / KPIs */
.mb-card { background: var(--mb-card); border: 1px solid var(--mb-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.mb-card > .mb-card-h { padding: .8rem 1rem; border-bottom: 1px solid var(--mb-border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.mb-card > .mb-card-h h2 { font-size: .95rem; font-weight: 650; margin: 0; }
.mb-card > .mb-card-b { padding: 1rem; }
/* Tarjeta plegable (details): el encabezado abre y cierra; cerrada no lleva línea inferior */
details.mb-card > summary.mb-card-h { cursor: pointer; list-style: none; }
details.mb-card > summary.mb-card-h::-webkit-details-marker { display: none; }
details.mb-card > summary.mb-card-h::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--mb-muted); transition: transform .15s; }
details.mb-card[open] > summary.mb-card-h::after { transform: rotate(180deg); }
details.mb-card:not([open]) > summary.mb-card-h { border-bottom: 0; }
.kpi { background: #fff; border: 1px solid var(--mb-border); border-radius: 14px; padding: .9rem 1rem; height: 100%; position: relative; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.kpi .lbl { color: var(--mb-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .val { font-size: 1.75rem; font-weight: 750; line-height: 1.15; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--mb-muted); font-size: .78rem; }
.kpi.accent-cyan { border-top: 3px solid var(--mb-cyan); }
.kpi.accent-green { border-top: 3px solid var(--mb-green); }
.kpi.accent-amber { border-top: 3px solid var(--mb-amber); }
.kpi.accent-red { border-top: 3px solid var(--mb-red); }

/* Tables */
.table-mb { margin: 0; font-size: .86rem; }
.table-mb thead th { background: #f7f9fb; color: var(--mb-muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--mb-border); white-space: nowrap; }
.table-mb td { vertical-align: middle; }
.table-mb tr.group-row td { background: #eef4f8; font-weight: 650; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Estados */
.st { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
/* En una fila flex sin alineación propia la insignia no se estira a la altura del texto vecino */
.d-flex:not([class*="align-items-"]) > .st { align-self: flex-start; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-green { background: #e3f9f1; color: #0d8a5f; }
.st-amber { background: #fdf3df; color: #a36a00; }
.st-red { background: #fde8e8; color: #b42318; }
.st-blue { background: #e0f4fd; color: #0072a3; }
.st-gray { background: #eef1f4; color: #55667a; }
.st-purple { background: #efe9fd; color: #6a3fc9; }

.pct-bar { height: 6px; background: #edf1f5; border-radius: 3px; overflow: hidden; min-width: 70px; }
.pct-bar > span { display: block; height: 100%; background: var(--mb-green); }
.pct-bar.warn > span { background: var(--mb-amber); }
.pct-bar.bad > span { background: var(--mb-red); }

.light { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.light.green { background: var(--mb-green); } .light.yellow { background: var(--mb-amber); } .light.red { background: var(--mb-red); } .light.na { background: #c9d3dd; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filters .form-control, .filters .form-select { font-size: .85rem; }
.filters input[type=date] { width: 150px; }
.mb-page-title .filters { flex-wrap: nowrap; }
@media (max-width: 900px) { .mb-page-title .filters { flex-wrap: wrap; } .mb-shell { background: var(--mb-bg); } }
.empty { text-align: center; color: var(--mb-muted); padding: 2.2rem 1rem; }
.empty i { font-size: 1.8rem; display: block; margin-bottom: .4rem; opacity: .6; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.2rem; border-left: 2px solid var(--mb-border); margin-left: .35rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .25rem; width: 10px; height: 10px; border-radius: 50%; background: var(--mb-cyan); }
.timeline .t { font-size: .75rem; color: var(--mb-muted); }

.nav-tabs .nav-link { font-size: .86rem; color: var(--mb-muted); }
.nav-tabs .nav-link.active { font-weight: 600; color: var(--mb-text); }

.chart-bars { display: flex; align-items: end; gap: 4px; height: 120px; }
.chart-bars .bar { flex: 1; background: var(--mb-cyan); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart-bars .bar.extra { background: var(--mb-amber); }
.chart-labels { display: flex; gap: 4px; font-size: .65rem; color: var(--mb-muted); }
.chart-labels span { flex: 1; text-align: center; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: radial-gradient(circle at 20% 20%, #0f3a5c 0, var(--mb-navy) 60%); color: #d6e4f0; padding: 3.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero h1 { color: #fff; font-weight: 750; font-size: 2.2rem; max-width: 30rem; }
.login-hero .mods { display: flex; flex-wrap: wrap; gap: .5rem; }
.login-hero .mods span { border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: .25rem .75rem; font-size: .8rem; }
.login-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-form form { width: 100%; max-width: 360px; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; }
  .mb-sidebar { position: fixed; left: -280px; z-index: 30; transition: left .2s; box-shadow: 0 0 40px rgba(0,0,0,.35); } .mb-sidebar.open { left: 0; }
  .mb-content { padding: 1rem; }
}

/* PWA marcación */
.app-shell { max-width: 520px; margin: 0 auto; min-height: 100vh; background: #fff; }
.app-header { background: var(--mb-navy); color: #fff; padding: .9rem 1rem; display: flex; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 5; }
.app-list .item { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--mb-border); text-decoration: none; color: inherit; }
.app-avatar { width: 42px; height: 42px; border-radius: 50%; background: #e6eef5; display: grid; place-items: center; font-weight: 700; color: #33546f; flex: 0 0 42px; }
.cam-box { background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; position: relative; }
.cam-box video, .cam-box img { width: 100%; height: 100%; object-fit: cover; }
.big-btn { padding: 1rem; font-size: 1.1rem; font-weight: 700; border-radius: 12px; }
/* v1.19 · Kiosco de marcación */
.kiosk-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.kiosk-pad .btn { padding: 1.1rem 0; font-size: 1.6rem; font-weight: 700; border-radius: 14px; }
.kiosk-pad #kOk { font-size: 1.15rem; }
/* Bootstrap (.d-grid, .d-flex) gana a [hidden]: en la app el atributo siempre oculta */
.app-shell [hidden] { display: none !important; }

/* Gráficas SVG del servidor */
.svg-chart { width: 100%; height: auto; display: block; }
.svg-chart text { font-size: 10px; fill: #5d6f82; font-family: inherit; }
.svg-chart .grid { stroke: #e9eef3; stroke-width: 1; }

/* Referencia de API */
.api-op { border-top: 1px solid var(--mb-border); }
.api-op:first-child { border-top: 0; }
.api-op > summary { display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.api-op > summary::-webkit-details-marker { display: none; }
.api-op > summary:hover { background: #f7fafc; }
.api-op[open] > summary { background: #f2f7fb; }
.api-m { font-size: .68rem; font-weight: 700; letter-spacing: .04em; border-radius: 4px; padding: .12rem .45rem; min-width: 46px; text-align: center; }
.api-get { background: #e3f4fb; color: #006f99; }
.api-post { background: #e2f8ef; color: #0b7a55; }
.api-path { font-size: .82rem; color: var(--mb-text); }
.api-sum { color: var(--mb-muted); font-size: .85rem; }
.api-body { padding: .4rem 1rem .8rem 4.6rem; }

/* Salud del sistema */
.health-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.health-ok { background: var(--mb-green); }
.health-warn { background: var(--mb-amber); }
.health-bad { background: var(--mb-red); }

/* Tonos de indicadores */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; background: #94a3b8; }
.dot.tone-ok { background: var(--mb-green); } .dot.tone-warn { background: var(--mb-amber); }
.dot.tone-bad { background: var(--mb-red); } .dot.tone-info { background: #60a5fa; }

/* Inicio por módulos */
.home-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; padding: 1.6rem 1.8rem; margin-bottom: 1.6rem; border-radius: 18px; color: #d6e4f0;
  background: radial-gradient(circle at 85% 10%, rgba(0,174,239,.35) 0, transparent 40%), radial-gradient(circle at 10% 120%, rgba(32,214,155,.25) 0, transparent 45%), linear-gradient(120deg, #071827, #0f3150); }
.home-hero h1 { color: #fff; font-weight: 750; font-size: 1.7rem; margin: .15rem 0 .35rem; }
.home-hero p { margin: 0; max-width: 46rem; color: #b8cadb; }
.home-date { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: #8fb0cc; font-weight: 600; }
.home-hero-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.fam-title { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mb-muted); font-weight: 700; margin: 0 0 .7rem; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1rem; }
.modcard { --mod: #0094cc; display: flex; flex-direction: column; gap: .35rem; background: #fff; border: 1px solid var(--mb-border); border-radius: 16px; padding: 1rem 1.05rem .85rem; text-decoration: none; color: var(--mb-text); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.modcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--mod); }
.modcard:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--mod) 55%, transparent); border-color: color-mix(in srgb, var(--mod) 40%, var(--mb-border)); color: var(--mb-text); }
.modcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .2rem; }
.modcard-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: linear-gradient(135deg, var(--mod), color-mix(in srgb, var(--mod) 70%, #000)); box-shadow: 0 6px 16px -6px var(--mod); }
.modcard-count { font-size: .72rem; color: var(--mb-muted); font-weight: 600; background: #f1f5f9; border-radius: 999px; padding: .1rem .55rem; }
.modcard h3 { font-size: 1.02rem; font-weight: 700; margin: .2rem 0 0; }
.modcard p { font-size: .83rem; color: var(--mb-muted); margin: 0; line-height: 1.4; }
.modcard-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .5rem; padding-top: .6rem; border-top: 1px dashed var(--mb-border); }
.modcard-kpis .mk { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.modcard-kpis .mk strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.modcard-kpis .mk strong small { font-size: .74rem; color: var(--mb-muted); font-weight: 600; }
.modcard-kpis .mk > span { display: flex; align-items: center; gap: .35rem; font-size: .72rem; color: var(--mb-muted); line-height: 1.2; }
.modcard-kpis .mk .dot { width: 7px; height: 7px; flex-basis: 7px; }
.modcard-foot { margin-top: auto; padding-top: .6rem; font-size: .8rem; font-weight: 650; color: color-mix(in srgb, var(--mod) 85%, #000); }
.modcard-foot i { transition: transform .15s; }
.modcard:hover .modcard-foot i { transform: translateX(3px); }
.modcard.soon { background: repeating-linear-gradient(135deg, #fff, #fff 10px, #fafcf7 10px, #fafcf7 20px); border-style: dashed; }
.modcard.soon .modcard-ico { filter: saturate(.8); }
.soon-tag { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #3f6212; background: #ecfccb; border-radius: 999px; padding: .15rem .55rem; }
.admin-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.admin-strip a { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--mb-border); border-radius: 10px; padding: .45rem .75rem; text-decoration: none; color: var(--mb-text); font-size: .84rem; }
.admin-strip a:hover { border-color: #94a3b8; }
.admin-strip i { color: #64748b; }
.side-sticky { position: sticky; top: 4.5rem; }
.alert-row { padding: .65rem 1rem; border-bottom: 1px solid var(--mb-border); border-left: 3px solid #cbd5e1; }
.alert-row:last-child { border-bottom: 0; }
.alert-row.sev-critical { border-left-color: var(--mb-red); } .alert-row.sev-warning { border-left-color: var(--mb-amber); }
.alert-row.sev-info { border-left-color: #60a5fa; }

/* Página de módulo */
.mod-hero { --mod: #0094cc; position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 1.6rem; padding: 1.5rem 1.7rem; border-radius: 18px; margin-bottom: 1.2rem; color: #fff;
  background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.18) 0, transparent 38%), linear-gradient(120deg, color-mix(in srgb, var(--mod) 92%, #000), color-mix(in srgb, var(--mod) 55%, #071827)); box-shadow: 0 14px 34px -18px var(--mod); }
.mod-hero-ico { width: 68px; height: 68px; border-radius: 18px; display: grid; place-items: center; font-size: 2rem; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); }
.mod-hero-txt { flex: 1; min-width: 260px; }
.mod-hero-kicker { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; opacity: .8; }
.mod-hero h1 { font-size: 1.65rem; font-weight: 780; margin: .1rem 0 .25rem; }
.mod-hero .lead-line { font-size: 1rem; font-weight: 600; margin: 0 0 .35rem; opacity: .95; }
.mod-hero .desc { font-size: .87rem; margin: 0; max-width: 60rem; opacity: .85; line-height: 1.5; }
.mkpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .85rem; }
.mkpi { display: block; background: #fff; border: 1px solid var(--mb-border); border-radius: 14px; padding: .85rem 1rem; text-decoration: none; color: var(--mb-text); box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: border-color .15s, box-shadow .15s; }
a.mkpi:hover { border-color: color-mix(in srgb, var(--mod) 45%, var(--mb-border)); box-shadow: 0 6px 18px -10px var(--mod); color: var(--mb-text); }
.mkpi-lbl { display: flex; align-items: center; gap: .4rem; font-size: .74rem; color: var(--mb-muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.mkpi-val { font-size: 1.7rem; font-weight: 760; line-height: 1.15; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.mkpi-val small { font-size: .95rem; color: var(--mb-muted); font-weight: 600; }
.mkpi-hint { font-size: .78rem; color: var(--mb-muted); }
.sec-title { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mb-muted); font-weight: 700; margin: 0 0 .7rem; }
.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.fn-card { display: flex; align-items: center; gap: .85rem; background: #fff; border: 1px solid var(--mb-border); border-radius: 14px; padding: .9rem 1rem; text-decoration: none; color: var(--mb-text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.fn-card:hover { border-color: color-mix(in srgb, var(--mod) 45%, var(--mb-border)); transform: translateY(-1px); box-shadow: 0 8px 20px -14px var(--mod); color: var(--mb-text); }
.fn-ico { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; color: color-mix(in srgb, var(--mod) 85%, #000); background: color-mix(in srgb, var(--mod) 12%, #fff); }
.fn-txt { flex: 1; min-width: 0; display: grid; }
.fn-txt strong { font-size: .92rem; }
.fn-txt span { font-size: .8rem; color: var(--mb-muted); line-height: 1.35; }
.fn-go { color: #94a3b8; transition: transform .15s, color .15s; }
.fn-card:hover .fn-go { transform: translateX(3px); color: var(--mod); }
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; counter-reset: none; }
.flow li { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--mb-border); border-radius: 999px; padding: .35rem .85rem .35rem .4rem; font-size: .84rem; position: relative; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -.55rem; color: #94a3b8; font-size: .8rem; }
.flow li { margin-right: .35rem; }
.flow .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: #fff; background: var(--mod); }
.conn-list { display: grid; gap: .6rem; }
.conn { display: flex; gap: .75rem; align-items: flex-start; background: #fff; border: 1px solid var(--mb-border); border-left: 4px solid var(--mod); border-radius: 12px; padding: .7rem .85rem; text-decoration: none; color: var(--mb-text); }
a.conn:hover { box-shadow: 0 6px 16px -12px var(--mod); color: var(--mb-text); }
.conn > span:last-child { display: grid; }
.conn strong { font-size: .88rem; }
.conn > span:last-child > span { font-size: .8rem; color: var(--mb-muted); line-height: 1.35; }
.conn-ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--mod); font-size: .9rem; }
.conn.ext { --mod: #94a3b8; border-left-style: dashed; background: #f8fafc; }
.planned { list-style: none; margin: 0; padding: 1rem 1.1rem .6rem; display: grid; gap: .55rem; }
.planned li { display: flex; gap: .55rem; font-size: .9rem; }
.planned i { color: var(--mod); }

/* Tablero ejecutivo: indicadores con su módulo */
.kpi.mod { border-top: 3px solid var(--mod); }
.kpi .kpi-mod { display: inline-block; margin-bottom: .4rem; font-size: .66rem; font-weight: 700; letter-spacing: .04em; color: color-mix(in srgb, var(--mod) 85%, #000); background: color-mix(in srgb, var(--mod) 12%, #fff); border-radius: 999px; padding: .1rem .5rem; text-decoration: none; }
.kpi .kpi-mod:hover { background: color-mix(in srgb, var(--mod) 22%, #fff); }

/* Login */
.login-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .55rem; max-width: 40rem; }
.login-mods div { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); font-size: .84rem; color: #e2edf6; }
.login-mods .mb-mod-ico { width: 26px; height: 26px; flex-basis: 26px; background: var(--mod); color: #fff; font-size: .8rem; }

@media (max-width: 600px) {
  .mb-topbar { padding: .5rem .75rem; gap: .6rem; }
  .mb-topbar .tenant { min-width: 0; max-width: 46vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .85rem; }
  .mb-topbar .uname { display: none; }
  .home-hero { padding: 1.2rem; } .home-hero h1 { font-size: 1.35rem; }
  .mod-hero { padding: 1.2rem; } .mod-hero h1 { font-size: 1.35rem; } .mod-hero-ico { width: 52px; height: 52px; font-size: 1.5rem; }
  .mb-band-top .mb-crumbs { display: none; }
}

/* Pendientes por cubrir: de la venta a lo cubierto */
.pend-flow { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .55rem; background: #fff; border: 1px solid var(--mb-border); border-radius: 14px; padding: .65rem .8rem; }
.pend-flow > .bi { color: var(--mb-muted); }
.pf-step { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .65rem; border-radius: 999px; background: #f4f6fa; color: var(--mb-text); font-size: .84rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
a.pf-step:hover { border-color: var(--mb-border); color: var(--mb-text); }
.pf-step.on { background: var(--mb-navy-3); color: #fff; }
.pf-step b { min-width: 1.5rem; text-align: center; padding: 0 .4rem; border-radius: 999px; background: rgba(15,33,51,.08); font-size: .78rem; }
.pf-step.on b { background: rgba(255,255,255,.22); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #94a3b8; vertical-align: middle; }
.dot-red { background: #b42318; } .dot-amber { background: #d08700; } .dot-blue { background: #0072a3; }

/* Expediente del colaborador */
.person-photo { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; border: 1px solid var(--mb-border); background: #fff; }
.person-photo.empty-photo { display: grid; place-items: center; font-size: 1.8rem; color: #94a3b8; background: #f4f6fa; }
.flow-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; font-size: .84rem; }
.flow-strip > .bi { color: var(--mb-muted); }
.fs-step { display: inline-flex; gap: .35rem; align-items: center; padding: .3rem .6rem; border-radius: 999px; background: #f4f6fa; color: var(--mb-muted); }
.fs-step.done { background: #e3f9f1; color: #0d8a5f; font-weight: 600; }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }
@media (max-width: 600px) { .pend-flow > .bi { display: none; } .flow-strip > .bi { display: none; } }

/* v1.20 · Comercial: mapa para ubicar el servicio y su geocerca */
.step-n { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--mb-cyan, #0094cc); color: #fff; font-size: .8rem; font-weight: 700; margin-right: .35rem; vertical-align: 1px; }
.minimap { position: relative; height: 340px; overflow: hidden; border-radius: 10px; border: 1px solid var(--mb-border, #dbe3ea); background: #e8eef3; cursor: crosshair; touch-action: none; user-select: none; }
.minimap.dragging { cursor: grabbing; }
.minimap-layer, .minimap-overlay { position: absolute; inset: 0; }
.minimap-layer img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.minimap-overlay { pointer-events: none; }
.minimap-pin { position: absolute; width: 18px; height: 18px; margin: -18px 0 0 -9px; border-radius: 50% 50% 50% 0; background: #e11d48; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.minimap-pin::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; left: 6px; top: 6px; }
.minimap-circle { position: absolute; border-radius: 50%; border: 2px solid #0094cc; background: rgba(0, 148, 204, .18); }
.minimap-zoom { position: absolute; z-index: 3; top: 10px; left: 10px; display: grid; gap: 4px; }
.minimap-zoom .btn { width: 32px; height: 32px; padding: 0; font-size: 1.1rem; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.minimap-attr { position: absolute; z-index: 3; right: 0; bottom: 0; background: rgba(255,255,255,.85); font-size: .7rem; padding: 1px 6px; border-top-left-radius: 6px; }
.minimap-empty { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(255,255,255,.92); border-radius: 8px; padding: .5rem .8rem; font-size: .85rem; color: #45586b; text-align: center; max-width: 80%; pointer-events: none; }
.quote-tot td { padding: .2rem .5rem; } .quote-tot .lbl { color: var(--mb-muted, #5d6f82); text-align: right; } .quote-tot .tot td { font-weight: 700; border-top: 1px solid var(--mb-border, #dbe3ea); }
