/* marketing/home — campañas y prospectos */

:root {
    --mh-paper: #eef1f5;
    --mh-sheet: #ffffff;
    --mh-ink: #15202c;
    --mh-slate: #5a6676;
    --mh-mist: #8a95a3;
    --mh-line: #dde2e9;
    --mh-line-soft: #edf0f4;
    --mh-gold: #c49a16;
    --mh-gold-ink: #7a5e05;
    --mh-gold-wash: #faf3dc;
    --mh-danger: #b42318;
    --mh-danger-wash: #fdecea;
    --mh-ok: #1d7446;
    --mh-ok-wash: #e6f4ec;
    --mh-radius-lg: 14px;
    --mh-radius: 8px;
    --mh-font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.mh-body {
    min-height: 100vh;
    margin: 0;
    background: var(--mh-paper);
    color: var(--mh-ink);
    font-family: var(--mh-font);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

.mh-main {
    width: min(1400px, 90%);
    margin: 40px auto 64px;
}

.mh-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Tabs: el encabezado de la página ---------- */

.mh-body .mh-tabs {
    display: flex;
    gap: 36px;
    border-bottom: 1px solid var(--mh-line);
}

.mh-body .mh-tab {
    position: relative;
    padding: 0 0 12px;
    background: none;
    border: 0;
    color: var(--mh-mist);
    font: 600 clamp(26px, 3.4vw, 38px) / 1.1 var(--mh-font);
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mh-body .mh-tab:hover {
    color: var(--mh-slate);
}

.mh-body .mh-tab[aria-selected="true"] {
    color: var(--mh-ink);
}

.mh-body .mh-tab[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--mh-gold);
}

.mh-intro {
    max-width: 62ch;
    margin: 14px 0 24px;
    color: var(--mh-slate);
}

/* ---------- Hoja ---------- */

.mh-sheet {
    background: var(--mh-sheet);
    border: 1px solid var(--mh-line);
    border-radius: var(--mh-radius-lg);
}

.mh-sheet[hidden] {
    display: none;
}

/* ---------- Campos ---------- */

.mh-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--mh-line-soft);
}

.mh-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.mh-field--grow {
    flex: 1 1 260px;
}

.mh-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--mh-slate);
    font-size: 13px;
    font-weight: 500;
}

.mh-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: var(--mh-sheet);
    border: 1px solid var(--mh-line);
    border-radius: var(--mh-radius);
    color: var(--mh-ink);
    font: 400 14px / 1 var(--mh-font);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.mh-input {
    padding-right: 34px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6676' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
}

.mh-input:hover {
    border-color: #c5ccd6;
}

.mh-input:focus {
    outline: none;
    border-color: var(--mh-gold);
    box-shadow: 0 0 0 3px rgba(196, 154, 22, 0.22);
}

.mh-input[aria-invalid="true"] {
    border-color: var(--mh-danger);
}

.mh-input.is-active {
    border-color: var(--mh-gold);
}

.mh-search {
    position: relative;
    display: block;
}

.mh-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--mh-mist);
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.mh-search .mh-input {
    padding-left: 38px;
}

/* ---------- Botones ---------- */

.mh-body .mh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--mh-radius);
    font: 600 14px / 1 var(--mh-font);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mh-body .mh-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mh-body .mh-btn--primary {
    background: var(--mh-ink);
    color: #fff;
}

.mh-body .mh-btn--primary:hover {
    background: #26364a;
}

.mh-body .mh-btn--ghost {
    background: transparent;
    border-color: var(--mh-line);
    color: var(--mh-ink);
}

.mh-body .mh-btn--ghost:hover {
    background: var(--mh-paper);
}

.mh-body .mh-btn[disabled],
.mh-body .mh-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.mh-body .mh-btn.is-spinning svg {
    animation: mh-spin 0.8s linear infinite;
}

.mh-body .mh-btn:focus-visible,
.mh-body .mh-tab:focus-visible,
.mh-link:focus-visible,
.mh-body .mh-chip:focus-visible,
.mh-body .mh-page:focus-visible,
.mh-body .mh-action:focus-visible,
.mh-body .mh-help:focus-visible {
    outline: 2px solid var(--mh-gold);
    outline-offset: 2px;
}

/* ---------- Resumen de resultados ---------- */

.mh-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 16px 24px;
}

.mh-count {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mh-body .mh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mh-body .mh-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 8px 0 10px;
    background: var(--mh-gold-wash);
    border: 1px solid #ecdcaa;
    border-radius: 999px;
    color: var(--mh-gold-ink);
    font: 500 13px / 1 var(--mh-font);
    cursor: pointer;
}

.mh-body .mh-chip svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.mh-body .mh-chip:hover {
    border-color: var(--mh-gold);
}

.mh-body .mh-chip--clear {
    background: transparent;
    border-color: transparent;
    color: var(--mh-slate);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mh-summary__actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ---------- Tabla ---------- */

.mh-body .mh-table-wrap {
    overflow-x: auto;
    border-top: 1px solid var(--mh-line-soft);
}

.mh-body .mh-table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    font-size: 14px;
}

.mh-body .mh-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 16px;
    background: #f7f8fa;
    border-bottom: 1px solid var(--mh-line);
    color: var(--mh-slate);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.mh-body .mh-table th:first-child,
.mh-body .mh-table td:first-child {
    padding-left: 24px;
}

.mh-body .mh-table th:last-child,
.mh-body .mh-table td:last-child {
    padding-right: 24px;
}

.mh-body .mh-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--mh-line-soft);
    vertical-align: top;
}

.mh-body .mh-table tbody tr:last-child td {
    border-bottom: 0;
}

.mh-body .mh-table tbody tr:hover td {
    background: #fafbfc;
}

.mh-body .mh-table--prospectos td:nth-child(1) {
    min-width: 230px;
}

.mh-table--prospectos td:nth-child(2) {
    min-width: 170px;
}

.mh-table--campanias td:nth-child(1) {
    min-width: 200px;
}

.mh-body .mh-table .mh-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mh-body .mh-table tr.is-disabled td > *:not(.mh-row-actions) {
    opacity: 0.55;
}

.mh-primary {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mh-secondary {
    display: block;
    color: var(--mh-slate);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.mh-missing {
    color: var(--mh-mist);
    font-style: italic;
}

.mh-link {
    color: inherit;
    text-decoration: none;
    border-radius: 3px;
}

.mh-link:hover {
    color: var(--mh-gold-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mh-body .mh-count-link {
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.mh-url {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.mh-body .mh-code {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    background: var(--mh-paper);
    border: 1px solid var(--mh-line);
    border-radius: 6px;
    color: var(--mh-ink);
    font: 600 12.5px / 1 var(--mh-font);
    letter-spacing: 0.01em;
    cursor: pointer;
}

.mh-body .mh-code:hover {
    border-color: var(--mh-gold);
    background: var(--mh-gold-wash);
}

.mh-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.mh-badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.mh-badge--ok {
    color: var(--mh-ok);
}

.mh-badge--off {
    color: var(--mh-mist);
}

.mh-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.mh-body .mh-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid var(--mh-line);
    border-radius: 6px;
    color: var(--mh-ink);
    font: 500 13px / 1 var(--mh-font);
    white-space: nowrap;
    cursor: pointer;
}

.mh-body .mh-action svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mh-body .mh-action:hover {
    background: var(--mh-paper);
}

.mh-body .mh-action--danger:hover {
    background: var(--mh-danger-wash);
    border-color: #f3c3bd;
    color: var(--mh-danger);
}

/* Estados de tabla */

.mh-state td {
    padding: 56px 24px !important;
    text-align: center;
    background: none !important;
}

.mh-state__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
}

.mh-state__hint {
    margin: 0 0 14px;
    color: var(--mh-slate);
}

.mh-skeleton td span {
    display: block;
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--mh-line-soft), #f6f7f9, var(--mh-line-soft));
    background-size: 200% 100%;
    animation: mh-shimmer 1.2s ease-in-out infinite;
}

.mh-skeleton td span + span {
    width: 60%;
    margin-top: 8px;
}

/* ---------- Paginación ---------- */

.mh-body .mh-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding: 14px 24px;
    border-top: 1px solid var(--mh-line);
    color: var(--mh-slate);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.mh-body .mh-pager:empty {
    display: none;
}

.mh-body .mh-pager__size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mh-body .mh-pager__size .mh-input {
    width: auto;
    height: 32px;
    min-width: 72px;
}

.mh-body .mh-pages {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.mh-body .mh-page {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--mh-ink);
    font: 500 14px / 1 var(--mh-font);
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.mh-body .mh-page:hover:not([disabled]):not([aria-current]) {
    background: var(--mh-paper);
}

.mh-body .mh-page[aria-current="page"] {
    background: var(--mh-gold-wash);
    border-color: var(--mh-gold);
    color: var(--mh-gold-ink);
    font-weight: 700;
    cursor: default;
}

.mh-body .mh-page[disabled] {
    color: #b8c0ca;
    cursor: default;
}

.mh-body .mh-page--nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mh-body .mh-page--nav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.mh-gap {
    padding: 0 4px;
    color: var(--mh-mist);
}

/* ---------- Nueva campaña ---------- */

.mh-create {
    padding: 22px 24px;
    background: #f9fafb;
    border-bottom: 1px solid var(--mh-line);
    border-radius: var(--mh-radius-lg) var(--mh-radius-lg) 0 0;
}

.mh-create__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-bottom: 14px;
}

.mh-create__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.mh-create__hint {
    margin: 0;
    color: var(--mh-slate);
    font-size: 14px;
}

.mh-create__fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 16px;
}

.mh-create__fields > .mh-field:first-child {
    flex: 0 1 220px;
}

.mh-create__submit {
    height: 40px;
}

.mh-body .mh-help {
    width: 18px;
    height: 18px;
    padding: 0;
    background: var(--mh-sheet);
    border: 1px solid var(--mh-line);
    border-radius: 50%;
    color: var(--mh-slate);
    font: 700 11px / 1 var(--mh-font);
    cursor: pointer;
}

.mh-popover {
    max-width: 320px;
    margin: auto;
    padding: 16px 18px;
    background: var(--mh-sheet);
    border: 1px solid var(--mh-line);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(21, 32, 44, 0.16);
    color: var(--mh-ink);
    font-size: 14px;
}

.mh-popover p {
    margin: 0;
    font-weight: 600;
}

.mh-popover dl {
    margin: 10px 0;
}

.mh-popover dl div {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 8px;
    padding: 4px 0;
}

.mh-popover dt {
    color: var(--mh-gold-ink);
    font-weight: 700;
}

.mh-popover dd {
    margin: 0;
    color: var(--mh-slate);
}

.mh-popover .mh-popover__foot {
    color: var(--mh-slate);
    font-weight: 400;
}

/* ---------- Página de un solo apartado (distribuidores, etc.) ---------- */

.mh-heading {
    display: inline-block;
    position: relative;
    margin: 0;
    padding-bottom: 12px;
    font: 600 clamp(26px, 3.4vw, 38px) / 1.1 var(--mh-font);
    letter-spacing: -0.02em;
}

.mh-heading::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--mh-gold);
}

.mh-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.mh-fieldset legend {
    margin-bottom: 6px;
    padding: 0;
}

/* Control segmentado (radios) */

.mh-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    background: var(--mh-paper);
    border-radius: 10px;
}

.mh-seg__option {
    position: relative;
    cursor: pointer;
}

.mh-seg__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mh-seg__option span {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: 7px;
    color: var(--mh-slate);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.mh-seg__option:hover span {
    color: var(--mh-ink);
}

.mh-seg__option input:checked + span {
    background: var(--mh-sheet);
    box-shadow: 0 1px 2px rgba(21, 32, 44, 0.12), 0 0 0 1px var(--mh-line);
    color: var(--mh-ink);
    font-weight: 600;
}

.mh-seg__option input:focus-visible + span {
    outline: 2px solid var(--mh-gold);
    outline-offset: 1px;
}

.mh-range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px 16px;
}

.mh-range[hidden] {
    display: none;
}

.mh-range .mh-btn {
    height: 40px;
}

/* Reparto por respuesta: filtro + barra proporcional */

.mh-split {
    padding: 18px 24px 4px;
}

.mh-split__options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.mh-body .mh-split__option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--mh-line);
    border-radius: 10px;
    color: var(--mh-ink);
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mh-body .mh-split__option:hover {
    border-color: #c5ccd6;
    background: #fafbfc;
}

.mh-body .mh-split__option[aria-current="true"] {
    border-color: var(--mh-gold);
    background: var(--mh-gold-wash);
    box-shadow: inset 0 0 0 1px var(--mh-gold);
}

.mh-body .mh-split__option:focus-visible {
    outline: 2px solid var(--mh-gold);
    outline-offset: 2px;
}

.mh-split__name {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--mh-slate);
    font-size: 13.5px;
    font-weight: 500;
}

.mh-split__option--si .mh-split__name::before,
.mh-split__option--no .mh-split__name::before,
.mh-split__option--sin .mh-split__name::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.mh-split__option--si .mh-split__name::before { background: var(--mh-gold); }
.mh-split__option--no .mh-split__name::before { background: var(--mh-ink); }
.mh-split__option--sin .mh-split__name::before { background: #c5ccd6; }

.mh-split__count {
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.mh-split__bar {
    display: flex;
    gap: 2px;
    height: 6px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 3px;
}

.mh-split__seg {
    flex-basis: 0;
    min-width: 4px;
}

.mh-split__seg--si { background: var(--mh-gold); }
.mh-split__seg--no { background: var(--mh-ink); }
.mh-split__seg--sin { background: #c5ccd6; }

.mh-badge--gold {
    color: var(--mh-gold-ink);
}

.mh-badge--gold::before {
    background: var(--mh-gold);
}

.mh-detail {
    max-width: 44ch;
    margin-top: 4px;
}

.mh-primary--light {
    font-weight: 500;
}

.mh-body .mh-table--partners {
    min-width: 720px;
}

.mh-body .mh-table--partners td:nth-child(1) {
    width: 28%;
}

.mh-body .mh-table--partners td:nth-child(3) {
    width: 30%;
}

/* Tablas cortas: en móvil cada fila se apila como tarjeta (primera celda y fecha arriba) */
@media (max-width: 720px) {
    .mh-body .mh-table--stack {
        min-width: 0;
    }

    .mh-body .mh-table--stack thead {
        display: none;
    }

    .mh-body .mh-table--stack tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px 16px;
        padding: 16px;
        border-bottom: 1px solid var(--mh-line-soft);
    }

    .mh-body .mh-table--stack tr.mh-state {
        display: table-row;
        padding: 0;
    }

    .mh-body .mh-table--stack td,
    .mh-body .mh-table--stack td:nth-child(n) {
        width: auto;
        min-width: 0;
        padding: 0 !important;
        border: 0;
        grid-column: 1 / -1;
    }

    .mh-body .mh-table--stack td:first-child {
        grid-column: 1;
    }

    .mh-body .mh-table--stack td:last-child {
        grid-column: 2;
        grid-row: 1;
    }

    .mh-body .mh-table--stack tbody tr:hover td {
        background: none;
    }
}

/* Encabezado de página con cifras a la derecha */

.mh-pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 40px;
}

.mh-stats {
    display: flex;
    gap: 36px;
    margin: 0 0 24px;
}

.mh-stats div {
    padding-left: 14px;
    border-left: 2px solid var(--mh-line);
}

.mh-stats dt {
    color: var(--mh-slate);
    font-size: 13px;
    font-weight: 500;
}

.mh-stats dd {
    margin: 2px 0 0;
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .mh-stats {
        gap: 24px;
        margin-top: -8px;
    }

    .mh-stats dd {
        font-size: 22px;
    }
}

/* La paginación también se usa con enlaces (páginas renderizadas en servidor) */

.mh-body a.mh-page,
.mh-body span.mh-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.mh-body span.mh-page[aria-disabled="true"] {
    color: #b8c0ca;
    cursor: default;
}

.mh-body a.mh-chip {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .mh-split {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mh-split__options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mh-seg {
        display: flex;
    }

    .mh-seg__option {
        flex: 1 1 auto;
    }

    .mh-seg__option span {
        justify-content: center;
        width: 100%;
    }
}

/* ---------- Selector de cotizadores (marketing/ver-cotizadores) ---------- */

.mh-quoters {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mh-family {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px 32px;
    padding: 24px;
}

.mh-family__name {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.mh-family__count {
    margin: 4px 0 0;
    color: var(--mh-slate);
    font-size: 14px;
}

.mh-body .mh-family__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mh-quoter {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--mh-line);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mh-quoter:hover {
    border-color: var(--mh-ink);
}

.mh-quoter:focus-within {
    border-color: var(--mh-gold);
    box-shadow: 0 0 0 3px rgba(196, 154, 22, 0.22);
}

.mh-body .mh-quoter__open {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 48px 16px 18px;
    color: var(--mh-ink);
    text-decoration: none;
    border-radius: 12px 12px 0 0;
}

.mh-body .mh-quoter__open:focus-visible {
    outline: none;
}

.mh-quoter__name {
    font-size: 17px;
    font-weight: 600;
}

.mh-quoter__path {
    color: var(--mh-slate);
    font-size: 13.5px;
    overflow-wrap: anywhere;
}

.mh-quoter__arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--mh-mist);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.15s ease, stroke 0.15s ease;
}

.mh-quoter:hover .mh-quoter__arrow,
.mh-quoter__open:focus-visible .mh-quoter__arrow {
    stroke: var(--mh-gold-ink);
    transform: translate(2px, -2px);
}

.mh-body .mh-quoter__copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 10px 18px;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--mh-line-soft);
    border-radius: 0 0 12px 12px;
    color: var(--mh-slate);
    font: 500 13.5px / 1 var(--mh-font);
    text-align: left;
    cursor: pointer;
}

.mh-body .mh-quoter__copy:hover {
    background: var(--mh-paper);
    color: var(--mh-ink);
}

.mh-body .mh-quoter__copy:focus-visible {
    outline: none;
    color: var(--mh-ink);
}

.mh-body .mh-quoter__copy.is-copied {
    color: var(--mh-ok);
}

.mh-quoter__copy svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1000px) {
    .mh-family {
        grid-template-columns: 1fr;
    }

    .mh-family__head {
        display: flex;
        align-items: baseline;
        gap: 12px;
    }

    .mh-family__count {
        margin: 0;
    }
}

@media (max-width: 720px) {
    .mh-family {
        padding: 18px 16px;
    }

    .mh-body .mh-family__grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Cotizaciones (cotizaciones/home) ---------- */

.mh-split--quoters {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--mh-line-soft);
}

.mh-split__option--generales .mh-split__name::before,
.mh-split__option--modulos .mh-split__name::before,
.mh-split__option--financieras .mh-split__name::before,
.mh-split__option--megacable .mh-split__name::before,
.mh-split__option--whatsapp .mh-split__name::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.mh-split__option--generales .mh-split__name::before,
.mh-split__seg--generales { background: var(--mh-gold); }
.mh-split__option--modulos .mh-split__name::before,
.mh-split__seg--modulos { background: var(--mh-ink); }
.mh-split__option--financieras .mh-split__name::before,
.mh-split__seg--financieras { background: #6f8fb3; }
.mh-split__option--megacable .mh-split__name::before,
.mh-split__seg--megacable { background: #c5ccd6; }
.mh-split__option--whatsapp .mh-split__name::before,
.mh-split__seg--whatsapp { background: #25a35a; }

.mh-body .mh-table--quotes {
    min-width: 1100px;
}

.mh-body .mh-table--quotes th,
.mh-body .mh-table--quotes td {
    padding-left: 12px;
    padding-right: 12px;
}

.mh-body .mh-table--quotes td:nth-child(1) {
    min-width: 190px;
    max-width: 260px;
}

.mh-body .mh-table--quotes td:nth-child(2) {
    min-width: 190px;
}

.mh-body .mh-table--quotes td:nth-child(3) {
    min-width: 180px;
    max-width: 240px;
}

.mh-body .mh-table--quotes td:nth-child(4) {
    min-width: 170px;
}

.mh-body .mh-table--quotes td:nth-child(6) {
    min-width: 150px;
    max-width: 210px;
}

.mh-tertiary {
    color: var(--mh-mist);
}

.mh-package {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    background: var(--mh-gold-wash);
    border-radius: 6px;
    color: var(--mh-gold-ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.mh-volume {
    margin-top: 6px;
}

.mh-volume span {
    white-space: nowrap;
}

.mh-money {
    display: block;
    white-space: nowrap;
}

.mh-money abbr {
    color: var(--mh-mist);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}

.mh-note {
    margin-top: 8px;
    font-size: 13px;
}

.mh-note summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mh-slate);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    border-radius: 3px;
}

.mh-note summary::-webkit-details-marker {
    display: none;
}

.mh-note summary::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    transition: transform 0.15s ease;
}

.mh-note[open] summary::before {
    transform: rotate(90deg);
}

.mh-note summary:hover {
    color: var(--mh-ink);
}

.mh-note summary:focus-visible {
    outline: 2px solid var(--mh-gold);
    outline-offset: 2px;
}

.mh-note p {
    max-width: 44ch;
    margin: 6px 0 0;
    padding: 8px 10px;
    background: var(--mh-paper);
    border-radius: 6px;
    color: var(--mh-ink);
    white-space: pre-line;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .mh-body .mh-table--quotes {
        min-width: 0;
    }

    .mh-body .mh-table--quotes td:nth-child(n) {
        max-width: none;
    }

    .mh-body .mh-table--quotes td.mh-num:not(:last-child) {
        text-align: left;
    }
}

.mh-body .mh-action[hidden],
.mh-body .mh-btn[hidden] {
    display: none;
}

/* ---------- Ventana de detalle (dialog) ---------- */

.mh-dialog {
    width: min(620px, calc(100% - 32px));
    max-height: min(86vh, 900px);
    padding: 0;
    border: 1px solid var(--mh-line);
    border-radius: var(--mh-radius-lg);
    background: var(--mh-sheet);
    box-shadow: 0 24px 64px rgba(21, 32, 44, 0.24);
    color: var(--mh-ink);
    font-family: var(--mh-font);
}

.mh-dialog[open] {
    display: flex;
    flex-direction: column;
}

.mh-dialog::backdrop {
    background: rgba(21, 32, 44, 0.45);
}

.mh-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--mh-line-soft);
}

.mh-dialog__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.mh-dialog__meta {
    margin: 4px 0 0;
    color: var(--mh-slate);
    font-size: 13.5px;
    overflow-wrap: anywhere;
}

.mh-body .mh-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--mh-line);
    border-radius: 8px;
    color: var(--mh-slate);
    cursor: pointer;
}

.mh-body .mh-dialog__close:hover {
    background: var(--mh-paper);
    color: var(--mh-ink);
}

.mh-body .mh-dialog__close:focus-visible {
    outline: 2px solid var(--mh-gold);
    outline-offset: 2px;
}

.mh-dialog__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.mh-dialog__body {
    padding: 4px 24px 24px;
    overflow-y: auto;
}

.mh-dialog__section {
    padding-top: 18px;
}

.mh-dialog__section + .mh-dialog__section {
    margin-top: 18px;
    border-top: 1px solid var(--mh-line-soft);
}

.mh-dialog__subtitle {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}

.mh-fields {
    display: grid;
    gap: 10px;
    margin: 0;
}

.mh-fields div {
    display: grid;
    grid-template-columns: minmax(130px, 38%) 1fr;
    gap: 12px;
    font-size: 14px;
}

.mh-fields dt {
    color: var(--mh-slate);
}

.mh-fields dd {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .mh-dialog__head,
    .mh-dialog__body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mh-fields div {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* ---------- Solicitudes de cargo recurrente ---------- */

.mh-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    font-weight: 600;
}

.mh-card svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--mh-gold);
    stroke-width: 1.8;
    stroke-linecap: round;
}

.mh-card__bank {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mh-card__digits {
    color: var(--mh-slate);
    font-weight: 500;
    letter-spacing: 0.04em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.mh-signature {
    display: block;
    width: 112px;
    height: 44px;
    padding: 4px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--mh-line);
    border-radius: 6px;
}

.mh-signature--large {
    width: 100%;
    max-width: 320px;
    height: 120px;
}

.mh-body .mh-table--charges {
    min-width: 1000px;
}

.mh-body .mh-table--charges td:nth-child(1) {
    min-width: 180px;
}

.mh-body .mh-table--charges td:nth-child(2) {
    min-width: 220px;
}

.mh-body .mh-action svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 720px) {
    .mh-body .mh-table.mh-table--stack {
        min-width: 0;
    }

    .mh-row-cell-actions .mh-row-actions {
        justify-content: flex-start;
    }
}

/* ---------- Toasts ---------- */

.mh-toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100% - 32px);
}

.mh-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    padding: 12px 14px;
    background: var(--mh-ink);
    border-left: 3px solid var(--mh-gold);
    border-radius: var(--mh-radius);
    box-shadow: 0 10px 28px rgba(21, 32, 44, 0.24);
    color: #fff;
    font-size: 14px;
    animation: mh-toast-in 0.2s ease-out;
}

.mh-toast--error {
    border-left-color: #f97066;
}

/* ---------- Animaciones ---------- */

@keyframes mh-spin {
    to { transform: rotate(360deg); }
}

@keyframes mh-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

@keyframes mh-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mh-body *,
    .mh-body *::before,
    .mh-body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .mh-main {
        margin-top: 28px;
    }

    .mh-tabs {
        gap: 24px;
    }

    .mh-filters,
    .mh-summary,
    .mh-pager,
    .mh-create {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mh-field,
    .mh-create__fields > .mh-field:first-child {
        flex: 1 1 100%;
    }

    .mh-filters .mh-field:not(.mh-field--grow) {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .mh-create__submit {
        width: 100%;
    }

    .mh-summary__actions {
        width: 100%;
        margin-left: 0;
    }

    .mh-summary__actions .mh-btn {
        flex: 1;
    }

    .mh-pages {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    .mh-page--nav span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}
