/* Identidad visual del panel (provisoria hasta contar con el manual de marca de Informat).
   Para cambiar colores o tipografía basta con modificar las variables de :root. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-400-normal.77bc02670657.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-500-normal.f7016cd446d2.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-600-normal.196e3cbc5fee.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/ibm-plex-sans-latin-700-normal.c277d7b83f8a.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-400-normal.79936b18df9f.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-500-normal.b1c8a895f5fd.woff2") format("woff2"); }

:root {
  /* Marca */
  --mv-accent: #0e6377;
  --mv-accent-rgb: 14, 99, 119;
  --mv-accent-dark: #0a4a59;
  --mv-attention: #b4531b;
  --mv-attention-ink: #8a3c10;
  --mv-attention-bg: #fff8f2;
  --mv-attention-border: #e7b28f;

  /* Superficies y texto */
  --mv-page-bg: #f3f5f7;
  --mv-ink: #1d2b33;
  --mv-ink-2: #33454f;
  --mv-muted: #5b6f7a;
  --mv-faint: #7d8f99;
  --mv-line: #edf1f3;

  /* Menú lateral */
  --mv-side-bg: #0f1c24;
  --mv-side-bg-2: #172a35;
  --mv-side-border: #22394a;
  --mv-side-ink: #b9c7cf;
  --mv-side-muted: #8fa3ae;
  --mv-side-width: 15.5rem;

  /* Tabler */
  --tblr-primary: var(--mv-accent);
  --tblr-primary-rgb: var(--mv-accent-rgb);
  --tblr-link-color: var(--mv-accent);
  --tblr-link-color-rgb: var(--mv-accent-rgb);
  --tblr-link-hover-color: var(--mv-accent-dark);
  --tblr-font-sans-serif: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tblr-font-monospace: "IBM Plex Mono", ui-monospace, monospace;
  --tblr-body-font-family: var(--tblr-font-sans-serif);
  --tblr-body-color: var(--mv-ink);
  --tblr-body-bg: var(--mv-page-bg);
}

body { background: var(--mv-page-bg); color: var(--mv-ink); font-family: var(--tblr-font-sans-serif); }
code, .mv-mono { font-family: var(--tblr-font-monospace); }
.mv-mono { font-size: .8125rem; }
.mv-num { font-variant-numeric: tabular-nums; }
.text-muted-2 { color: var(--mv-muted) !important; }

/* ---------- Layout ---------- */
.mv-shell { display: flex; min-height: 100vh; }
.mv-sidebar {
  flex: 0 0 var(--mv-side-width); width: var(--mv-side-width);
  background: var(--mv-side-bg); color: #fff;
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.mv-main { flex: 1 1 auto; min-width: 0; padding: 1.75rem 2rem 2.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.mv-topbar { display: none; }

.mv-brand { display: flex; align-items: center; gap: .625rem; padding: 0 .5rem; color: #fff; text-decoration: none; }
.mv-brand:hover { color: #fff; }
.mv-brand-mark {
  width: 2.125rem; height: 2.125rem; border-radius: .5625rem; background: var(--mv-accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.0625rem; color: #fff; flex: none;
}
.mv-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.mv-brand-text strong { font-size: 1rem; letter-spacing: -.01em; }
.mv-brand-text span { font-size: .75rem; color: var(--mv-side-muted); }

.mv-side-label { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mv-side-muted); }
.mv-client-picker { display: flex; flex-direction: column; gap: .375rem; padding: 0 .25rem; }
.mv-client-picker .form-select { background-color: var(--mv-side-bg-2); border-color: #24404f; color: #fff; }

.mv-nav { display: flex; flex-direction: column; gap: .125rem; margin: 0; padding: 0; list-style: none; }
.mv-nav a {
  display: flex; align-items: center; gap: .625rem; padding: .5625rem .75rem; border-radius: .5rem;
  color: var(--mv-side-ink); text-decoration: none; font-weight: 500; font-size: .875rem;
}
.mv-nav a .ti { font-size: 1.25rem; }
.mv-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.mv-nav a.active { background: rgba(255, 255, 255, .10); color: #fff; }
.mv-nav .mv-count {
  margin-left: auto; background: var(--mv-attention); color: #fff; border-radius: 999px;
  font-size: .6875rem; font-weight: 600; padding: .0625rem .5rem;
}

.mv-user { margin-top: auto; display: flex; align-items: center; gap: .625rem; padding: .75rem .5rem 0; border-top: 1px solid var(--mv-side-border); }
.mv-user .avatar { background: #24404f; color: #fff; font-weight: 600; }
.mv-user-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.mv-user-name strong { font-size: .8125rem; }
.mv-user-name span { font-size: .75rem; color: var(--mv-side-muted); }
.mv-user .btn { color: var(--mv-side-ink); margin-left: auto; }
.mv-user .btn:hover { color: #fff; background: rgba(255, 255, 255, .06); }

@media (max-width: 991.98px) {
  .mv-shell { flex-direction: column; }
  .mv-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--mv-side-bg); color: #fff; padding: .75rem 1rem; position: sticky; top: 0; z-index: 1020;
  }
  .mv-topbar .btn { color: #fff; }
  .mv-sidebar { position: static; width: 100%; height: auto; flex-basis: auto; display: none; }
  .mv-sidebar.show { display: flex; }
  .mv-sidebar .mv-brand { display: none; }
  .mv-main { padding: 1.25rem 1rem 2rem; }
}

/* ---------- Encabezado de página ---------- */
.mv-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.mv-page-head h1 { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; }
.mv-page-head .page-pretitle { color: var(--mv-muted); }
.mv-page-meta { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--mv-muted); }
.mv-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Tarjetas ---------- */
.mv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr)); gap: 1rem; }
.mv-kpi .card-body { display: flex; flex-direction: column; gap: .375rem; }
.mv-kpi .subheader { letter-spacing: .06em; }
.mv-kpi-value { font-size: 1.875rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.mv-kpi-note { font-size: .8125rem; color: var(--mv-muted); }
.mv-kpi.is-attention { border-color: var(--mv-attention-border); background: var(--mv-attention-bg); }
.mv-kpi.is-attention .subheader, .mv-kpi.is-attention .mv-kpi-value { color: var(--mv-attention-ink); }
.mv-kpi.is-attention .mv-kpi-note { color: #6e3410; }
.card-title { font-size: .9375rem; font-weight: 600; }
.card-subtitle { font-size: .8125rem; color: var(--mv-muted); margin: 0; }
.mv-split { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.mv-split > .mv-wide { flex: 999 1 34rem; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.mv-split > .mv-narrow { flex: 1 1 19rem; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.mv-split.is-stretch { align-items: stretch; }

/* ---------- Tablas ---------- */
.mv-table tbody td { padding-top: .6875rem; padding-bottom: .6875rem; }
.mv-table tr.is-uncertain > td { background: rgba(247, 103, 7, .06); }
.mv-table tr.is-error > td { background: rgba(214, 57, 57, .05); }
.mv-channel { display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; }
.mv-channel-dot { width: .5rem; height: .5rem; border-radius: 999px; flex: none; background: var(--mv-faint); }
.mv-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.mv-filters .mv-filter-fields { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.mv-filters .input-icon { width: 16.25rem; max-width: 100%; }

/* ---------- Detalle de venta ---------- */
.mv-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: .75rem; }
.mv-steps li { display: flex; align-items: center; gap: .75rem; }
.mv-step-icon { width: 2.125rem; height: 2.125rem; flex: none; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; }
.mv-step-icon.is-done { background: #e3f4ea; color: #2b8a4b; }
.mv-step-icon.is-warn { background: #fdebdc; color: var(--mv-attention); box-shadow: 0 0 0 3px #f6c9a6; }
.mv-step-icon.is-error { background: #fbe3e3; color: #c92a2a; box-shadow: 0 0 0 3px #f5c2c2; }
.mv-step-icon.is-wait { background: #eef1f3; color: var(--mv-faint); }
.mv-step-icon.is-run { background: rgba(var(--mv-accent-rgb), .12); color: var(--mv-accent); }
.mv-step-text { display: flex; flex-direction: column; line-height: 1.25; }
.mv-step-text strong { font-weight: 600; }
.mv-step-text span { font-size: .75rem; color: var(--mv-muted); }

.mv-resolve { border-color: var(--mv-attention-border); }
.mv-resolve .card-status-top { background: var(--mv-attention); }
.mv-resolve-head { display: flex; gap: .875rem; align-items: flex-start; }
.mv-resolve-head .ti { color: var(--mv-attention); font-size: 1.5rem; flex: none; }
.mv-resolve-head h2 { margin: 0 0 .25rem; font-size: 1.0625rem; font-weight: 600; }
.mv-resolve-head p { margin: 0; color: var(--mv-ink-2); max-width: 75ch; }
.mv-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr)); gap: .875rem; }
.mv-option { border: 1px solid #d9e1e5; border-radius: .625rem; padding: 1rem; display: flex; flex-direction: column; gap: .625rem; background: #fff; }
.mv-option-title { font-weight: 600; }
.mv-option p { margin: 0; font-size: .8125rem; color: var(--mv-muted); }
.mv-option .btn { align-self: flex-start; }

.mv-dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem .75rem; margin: 0; font-size: .875rem; }
.mv-dl dt { color: var(--mv-muted); font-weight: 400; }
.mv-dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.mv-totals { display: grid; grid-template-columns: auto auto; gap: .25rem 1.75rem; margin: 0; font-variant-numeric: tabular-nums; font-size: .875rem; }
.mv-totals dt { color: var(--mv-muted); font-weight: 400; }
.mv-totals dd { margin: 0; text-align: right; }
.mv-totals .is-total { font-weight: 700; color: var(--mv-ink); font-size: 1rem; }
.mv-code { max-height: 22rem; overflow: auto; background: #0f1c24; color: #d7e3ea; border-radius: .5rem; padding: .875rem 1rem; font-size: .75rem; white-space: pre-wrap; word-break: break-all; }
.mv-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mv-history li { display: grid; grid-template-columns: 1rem 1fr; gap: .75rem; position: relative; padding-bottom: 1rem; }
.mv-history li:not(:last-child)::before { content: ""; position: absolute; left: .4375rem; top: 1.125rem; bottom: 0; width: 2px; background: var(--mv-line); }
.mv-history-dot { width: 1rem; height: 1rem; border-radius: 999px; margin-top: .1875rem; border: 3px solid #fff; box-shadow: 0 0 0 1px #d9e1e5; background: var(--mv-faint); }
.mv-history-dot.is-ok { background: #2b8a4b; }
.mv-history-dot.is-warn { background: var(--mv-attention); }
.mv-history-dot.is-error { background: #c92a2a; }
.mv-history-dot.is-info { background: var(--mv-accent); }
.mv-history-head { display: flex; justify-content: space-between; gap: .5rem; }
.mv-history-head strong { font-size: .875rem; }
.mv-history-body { font-size: .8125rem; color: var(--mv-muted); overflow-wrap: anywhere; }

/* ---------- Gráficos ---------- */
.mv-chart { width: 100%; height: 15rem; }
.mv-hbars { display: flex; flex-direction: column; gap: .875rem; }
.mv-hbar { display: grid; grid-template-columns: 8rem 1fr 3.5rem; align-items: center; gap: .75rem; font-size: .875rem; }
.mv-hbar-track { height: .625rem; background: var(--mv-line); border-radius: 0 4px 4px 0; }
.mv-hbar-fill { height: 100%; background: var(--mv-accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.mv-hbar-label { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Varios ---------- */
.htmx-request .mv-loading, .htmx-request.mv-loading { opacity: .55; transition: opacity .15s; }
.mv-empty { text-align: center; color: var(--mv-muted); padding: 2.5rem 1rem; }
.mv-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--mv-side-bg); }
.mv-login .card { width: 100%; max-width: 25rem; }

/* Ajustes */
.status { white-space: nowrap; }
.mv-history-head span { white-space: nowrap; }
@media (min-width: 992px) {
  /* El menú lateral cubre todo el alto aunque la página sea más larga que la ventana. */
  .mv-shell { background: linear-gradient(to right, var(--mv-side-bg) var(--mv-side-width), var(--mv-page-bg) var(--mv-side-width)); }
}
/* Los hijos del contenido no se ensanchan por tablas anchas (las tablas hacen scroll propio). */
.mv-main > * { min-width: 0; }
.mv-col-message { min-width: 16rem; }
