/* Gestión Minas — panel administrativo */
:root {
    --gm-navy: #0f172a;
    --gm-navy-mid: #1e3a5f;
    --gm-blue: #004a7c;
    --gm-bg: #e8eef3;
    --gm-card: #ffffff;
    --gm-muted: #64748b;
    --gm-border: #e2e8f0;
    --gm-success: #16a34a;
    --gm-sidebar-w: 280px;
    --gm-sidebar-bg: #f8fafc;
    --gm-sidebar-bg2: #ffffff;
    --gm-sidebar-border: #e2e8f0;
    --gm-sidebar-text: #0f172a;
    --gm-sidebar-muted: #475569;
    --gm-sidebar-sublink: #0f172a;
    --gm-sidebar-hover: rgba(15, 23, 42, 0.05);
    --gm-sidebar-active: #e8f2fa;
    --gm-sidebar-active-border: #004a7c;
}

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

body.gm-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.9375rem;
    color: var(--gm-navy);
    background: var(--gm-bg);
}

.gm-app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.gm-sidebar {
    width: var(--gm-sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--gm-sidebar-bg2) 0%, var(--gm-sidebar-bg) 40%, #f1f5f9 100%);
    border-right: 1px solid var(--gm-sidebar-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
    box-shadow: 2px 0 20px rgba(15, 23, 42, 0.04);
}

.gm-sidebar::-webkit-scrollbar {
    width: 6px;
}

.gm-sidebar::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 6px;
}

.gm-sidebar__brand {
    padding: 1.1rem 1rem 1rem;
    border-bottom: 1px solid var(--gm-sidebar-border);
}

.gm-sidebar__brand-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.gm-sidebar__brand-text {
    min-width: 0;
    text-align: left;
}

.gm-sidebar__mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    background: linear-gradient(145deg, #0c4a6e 0%, var(--gm-blue) 50%, #0e7490 100%);
    color: #f8fafc;
    font-weight: 800;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.04em;
    box-shadow: 0 3px 12px rgba(0, 74, 124, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.gm-sidebar__title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin: 0 0 0.2rem;
    color: var(--gm-sidebar-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.gm-sidebar__subtitle {
    font-size: 0.72rem;
    color: var(--gm-sidebar-muted);
    margin: 0;
    line-height: 1.35;
    font-weight: 600;
}

.gm-user-card {
    margin: 0.85rem 0.85rem 0.5rem;
    padding: 0.85rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--gm-sidebar-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gm-user-card__row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.gm-user-card__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--gm-blue);
    background: linear-gradient(180deg, #e0f2fe 0%, #dbeafe 100%);
    border: 1px solid #bae6fd;
}

.gm-user-card__body {
    min-width: 0;
}

.gm-user-card__name {
    font-weight: 700;
    font-size: 0.8125rem;
    margin: 0 0 0.2rem;
    color: var(--gm-sidebar-text);
    line-height: 1.25;
}

.gm-user-card__mail {
    font-size: 0.7rem;
    color: #334155;
    margin: 0;
    word-break: break-word;
    line-height: 1.35;
    font-weight: 500;
}

.gm-user-card__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.gm-badge-role {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: #e8f2fa;
    color: var(--gm-blue);
    border: 1px solid #bfdbfe;
}

.gm-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.625rem;
    color: #15803d;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.gm-badge-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gm-success);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.gm-nav {
    flex: 1;
    padding: 0.35rem 0.65rem 1rem;
}

.gm-nav__section {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #334155;
    padding: 1rem 0.6rem 0.4rem;
    text-transform: uppercase;
}

.gm-nav__section.mt-2 {
    margin-top: 0.25rem;
}

.gm-nav__link {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    margin-bottom: 0.1rem;
    color: var(--gm-sidebar-text);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 10px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.gm-nav__link:hover {
    background: var(--gm-sidebar-hover);
    color: var(--gm-blue);
}

.gm-nav__link:hover .gm-nav__hint {
    color: #334155;
}

.gm-nav__link:hover .gm-nav__icon {
    color: var(--gm-blue);
    opacity: 1;
}

.gm-nav__link.is-active {
    background: var(--gm-sidebar-active);
    border-left-color: var(--gm-sidebar-active-border);
    color: var(--gm-blue);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.gm-nav__link.is-active .gm-nav__icon {
    color: var(--gm-sidebar-active-border);
    opacity: 1;
}

.gm-nav__link.is-active .gm-nav__hint {
    color: #334155;
    opacity: 1;
}

.gm-nav__icon {
    width: 1.35rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 1;
    font-size: 1.05rem;
    margin-top: 0.05rem;
    color: #334155;
}

.gm-nav__text {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}

.gm-nav__label {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.gm-nav__hint {
    font-size: 0.7rem;
    color: #334155;
    font-weight: 500;
    line-height: 1.35;
}

/* Subenlaces bajo un bloque de tesorería / módulos */
.gm-nav__sub {
    margin: 0.1rem 0 0.5rem 0;
    padding: 0.2rem 0 0.25rem 0.75rem;
    border-left: 2px solid #e2e8f0;
    margin-left: 1.15rem;
}

.gm-sidebar .gm-nav a.gm-nav__sublink,
.gm-sidebar .gm-nav a.gm-nav__sublink:visited {
    display: block;
    padding: 0.4rem 0.55rem 0.4rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gm-sidebar-sublink);
    text-decoration: none;
    border-radius: 8px;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
    -webkit-font-smoothing: antialiased;
}

.gm-sidebar .gm-nav a.gm-nav__sublink:hover {
    background: #f1f5f9;
    color: var(--gm-blue);
}

.gm-sidebar .gm-nav a.gm-nav__sublink.is-active {
    background: #e8f2fa;
    color: var(--gm-blue);
    font-weight: 700;
}

.gm-sidebar__logout {
    padding: 0.85rem;
    border-top: 1px solid var(--gm-sidebar-border);
    margin-top: auto;
    background: rgba(255, 255, 255, 0.65);
}

.gm-sidebar__logout-btn {
    width: 100%;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.55rem 0.75rem;
    color: var(--gm-navy) !important;
    background: #ffffff !important;
    border: 1px solid var(--gm-border) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gm-sidebar__logout-btn:hover {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #b91c1c !important;
}

/* Main: columna sin estirar el contenido infinito hacia abajo (evita “hueco” bajo la tabla) */
.gm-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--gm-bg);
    overflow-x: hidden;
}

.gm-topbar {
    background: var(--gm-card);
    border-bottom: 1px solid var(--gm-border);
    padding: 0.85rem 1.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.gm-topbar__crumb {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--gm-muted);
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.gm-topbar__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--gm-navy);
}

.gm-topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gm-content {
    padding: 1.5rem 1.75rem 2.5rem;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: visible;
}

/* Paginación Bootstrap en panel (evita desbordes y alinea con el tema) */
.gm-content nav[aria-label="Pagination"] .pagination,
.gm-content nav[aria-label="Pagination Navigation"] .pagination,
.gm-content nav .pagination,
.gm-content .pagination {
    margin-bottom: 0;
}

.gm-paginacion-wrap {
    margin-top: 1rem;
    padding: 0.75rem 0 0.5rem;
    border-top: 1px solid var(--gm-border);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    clear: both;
    overflow-x: auto;
    overflow-y: visible;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.gm-paginacion-wrap nav[aria-label="Pagination"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Evita que la fila de resumen + números se “salga” o quede bajo el borde de la ventana */
.gm-paginacion-wrap .page-link {
    min-width: 2.4rem;
    text-align: center;
}

/* Tables & cards (complement Bootstrap) */
.gm-card {
    background: var(--gm-card);
    border-radius: 12px;
    border: 1px solid var(--gm-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gm-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--gm-border);
}

/* Tablas de listado: el scroll horizontal queda dentro del bloque (no “pasa” al pie) */
.gm-table-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

/* Quick access mobile */
.gm-quick-grid {
    display: none;
}

@media (max-width: 991.98px) {
    .gm-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 32px rgba(15, 23, 42, 0.12);
    }

    .gm-sidebar.is-open {
        transform: translateX(0);
    }

    .gm-main {
        width: 100%;
    }

    .gm-topbar__toggle {
        display: inline-flex !important;
    }

    .gm-quick-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .gm-quick-card {
        background: var(--gm-card);
        border: 1px solid var(--gm-border);
        border-radius: 12px;
        padding: 0.85rem;
        text-decoration: none;
        color: var(--gm-navy);
        transition: box-shadow 0.15s, border-color 0.15s;
    }

    .gm-quick-card:hover {
        border-color: var(--gm-blue);
        box-shadow: 0 4px 12px rgba(0, 74, 124, 0.12);
    }

    .gm-quick-card small {
        color: var(--gm-muted);
        font-size: 0.7rem;
    }
}

.gm-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    background: var(--gm-card);
    margin-right: 0.5rem;
}

/* Ocultar / mostrar sidebar (escritorio) */
.gm-topbar__sidebar-toggle {
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--gm-border);
    border-radius: 10px;
    background: var(--gm-card);
    margin-right: 0.5rem;
    padding: 0;
    color: var(--gm-navy);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gm-topbar__sidebar-toggle:hover {
    background: #f1f5f9;
    border-color: var(--gm-blue);
    color: var(--gm-blue);
}

@media (min-width: 992px) {
    .gm-sidebar {
        transition: width 0.22s ease, min-width 0.22s ease, opacity 0.18s ease,
            border-color 0.22s ease;
    }

    html.gm-sidebar-hidden .gm-sidebar {
        width: 0 !important;
        min-width: 0 !important;
        border-right-width: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
    }
}

/* Backdrop mobile */
.gm-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1030;
}

@media (max-width: 991.98px) {
    .gm-backdrop.is-visible {
        display: block;
    }
}

/* Login page (guest) */
body.gm-login-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    background: linear-gradient(160deg, #dce7ef 0%, #e8eef3 45%, #d4dde6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.gm-login-wrap {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

@media (max-width: 767.98px) {
    .gm-login-wrap {
        grid-template-columns: 1fr;
    }
}

.gm-login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2rem 2.25rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.gm-login-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gm-blue);
    text-transform: uppercase;
    margin: 0 0 0.5rem;
}

.gm-login-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--gm-navy);
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.gm-login-text {
    color: var(--gm-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin: 0 0 1.5rem;
}

.gm-login-profiles {
    border: 1px solid var(--gm-border);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    background: #f8fafc;
}

.gm-login-profiles h3 {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--gm-muted);
    margin: 0 0 0.75rem;
}

.gm-login-profiles ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gm-login-profiles li {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.gm-login-profiles li:last-child {
    margin-bottom: 0;
}

.gm-login-profiles strong {
    color: var(--gm-navy);
    display: inline-block;
    min-width: 5.5rem;
}

.gm-login-form .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.gm-login-form .form-control {
    border-radius: 10px;
    border: 1px solid var(--gm-border);
    background: #f0f7fc;
    padding: 0.65rem 0.9rem;
}

.gm-login-form .form-control:focus {
    border-color: var(--gm-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 124, 0.15);
    background: #fff;
}

.gm-btn-primary {
    width: 100%;
    border-radius: 10px;
    padding: 0.7rem;
    font-weight: 700;
    background: var(--gm-navy);
    border: none;
}

.gm-btn-primary:hover {
    background: var(--gm-navy-mid);
}

.gm-login-submit {
    color: #e2e8f0 !important;
}

.gm-btn-outline {
    width: 100%;
    border-radius: 10px;
    padding: 0.65rem;
    font-weight: 600;
    border: 1px solid var(--gm-border);
    background: #fff;
    color: var(--gm-muted);
}

.gm-login-foot {
    font-size: 0.75rem;
    color: var(--gm-muted);
    text-align: center;
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.gm-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

/* Cotización — formato tipo documento (franja #1a5276) */
.cot-formato-sheet {
    padding: 0;
    overflow: hidden;
    border: 1px solid #1a5276;
    border-radius: 6px;
}

.cot-doc-head {
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr minmax(200px, 280px);
    gap: 0.75rem 1rem;
    align-items: center;
    padding: 1rem 1rem 0.85rem;
    background: #fff;
}

.cot-doc-head__logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border: none;
    background: transparent;
    padding: 0;
    min-height: 0;
}

.cot-doc-head__logo-img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 4.5rem;
    border: none;
    outline: none;
    object-fit: contain;
}

.cot-doc-head__center {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
}

.cot-doc-head__line {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--gm-navy);
    font-weight: 600;
}

.cot-doc-head__line--strong {
    font-weight: 800;
    font-size: 0.82rem;
}

.cot-doc-head__line--title {
    font-weight: 800;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.cot-doc-head__meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

/* Versión y fecha en una sola fila (celdas contiguas, borde único) */
.cot-doc-meta-pair {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    border: 1px solid #1a5276;
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
}

.cot-doc-meta-cell {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #1a5276;
    background: transparent;
    padding: 0.4rem 0.45rem;
    line-height: 1.2;
}

.cot-doc-meta-cell:first-child {
    border-right: 1px solid #1a5276;
}

.cot-doc-meta-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: #1a5276;
    border-radius: 3px;
    padding: 0.35rem 0.4rem;
    min-height: 2.25rem;
}

.cot-doc-meta-box.cot-doc-meta-box--outline {
    color: #1a5276;
    background: transparent;
    border: 1px solid #1a5276;
    border-radius: 2px;
}

.cot-formato-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    border-top: 1px solid #1a5276;
}

/* Fila CDP / RP bajo la grilla principal del formato cotización (2 columnas). */
.cot-formato-grid.cot-formato-grid--cdp-rp {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1199px) {
    .cot-formato-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .cot-doc-head {
        grid-template-columns: 1fr;
        align-items: start;
    }
    .cot-doc-head__logo {
        justify-content: center;
    }
    .cot-doc-head__meta {
        justify-content: center;
        width: 100%;
    }
    .cot-formato-grid {
        grid-template-columns: 1fr;
    }
}

.cot-fcell {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid #1a5276;
    border-bottom: 1px solid #1a5276;
    background: #fff;
}

.cot-fcell:last-child {
    border-right: none;
}

.cot-flabel {
    background: #1a5276;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.35rem;
    line-height: 1.25;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cot-fval {
    padding: 0.35rem 0.4rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
}

.cot-finput {
    width: 100%;
    text-align: center;
    border-radius: 2px !important;
}

.cot-finput:focus {
    box-shadow: 0 0 0 2px rgba(26, 82, 118, 0.2);
}

textarea.cot-finput.cot-objeto-ta {
    text-align: left;
    resize: vertical;
    min-height: 4.5rem;
}

.cot-static-text {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    display: block;
    width: 100%;
}

.cot-fcell--static .cot-fval {
    background: #f8fafc;
}

.cot-formato-row2 {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #1a5276;
    background: #fff;
}

/* INICIAL / ADICIONAL: columna de etiquetas + columna de marcas + objeto a la derecha (2 filas) */
.cot-row-tipo-marca {
    display: grid;
    grid-template-columns: minmax(5.25rem, 7rem) minmax(3.25rem, 4.25rem) minmax(12rem, 1fr);
    grid-template-rows: auto auto;
    align-items: stretch;
    width: 100%;
}

.cot-row-tipo-marca__lbl-ini {
    grid-column: 1;
    grid-row: 1;
    border-right: 1px solid #1a5276;
    border-bottom: 1px solid #1a5276;
}

.cot-row-tipo-marca__chk-ini {
    grid-column: 2;
    grid-row: 1;
    border-right: 1px solid #1a5276;
    border-bottom: 1px solid #1a5276;
}

.cot-row-tipo-marca__lbl-ad {
    grid-column: 1;
    grid-row: 2;
    border-right: 1px solid #1a5276;
}

.cot-row-tipo-marca__chk-ad {
    grid-column: 2;
    grid-row: 2;
    border-right: 1px solid #1a5276;
}

.cot-row-tipo-marca__objeto {
    grid-column: 3;
    grid-row: 1 / -1;
    border-right: none;
}

.cot-row-tipo-marca .cot-mark-cell {
    margin: 0;
    border: none;
    border-radius: 0;
    min-height: 2.65rem;
}

.cot-row-tipo-marca .cot-flabel {
    min-height: 2.65rem;
    font-size: 0.68rem;
}

/* INICIAL / ADICIONAL: rejilla tipo formato impreso (división clara entre filas) */
.cot-formato-sheet--excel .cot-row-tipo-marca > .cot-flabel {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__lbl-ini,
.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ini {
    border-bottom-width: 2px;
    border-bottom-style: solid;
    border-bottom-color: #000;
    min-height: 3rem;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__lbl-ad,
.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ad {
    min-height: 3rem;
}

.cot-formato-sheet--excel .cot-row-tipo-marca .cot-mark-cell {
    background: #fff;
    border-radius: 0;
    min-height: 3rem;
}

/* Sin borde alrededor del “cuadrito” interno, pero se mantienen los bordes de la celda de la grilla */
.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ini.cot-mark-cell {
    border-style: solid;
    border-color: #000;
    border-width: 0;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 2px;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ad.cot-mark-cell {
    border-style: solid;
    border-color: #000;
    border-width: 0;
    border-right-width: 1px;
    border-bottom-width: 1px;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__lbl-ini {
    border-top: 1px solid #000;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ini {
    border-top: 1px solid #000;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__objeto.cot-fcell {
    border-top: 1px solid #000;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__objeto .cot-objeto-side-label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.03em;
}

@media (max-width: 767px) {
    .cot-row-tipo-marca {
        grid-template-columns: 1fr 3.75rem;
        grid-template-rows: auto auto auto;
    }
    .cot-row-tipo-marca__lbl-ini {
        grid-column: 1;
        grid-row: 1;
    }
    .cot-row-tipo-marca__chk-ini {
        grid-column: 2;
        grid-row: 1;
    }
    .cot-row-tipo-marca__lbl-ad {
        grid-column: 1;
        grid-row: 2;
    }
    .cot-row-tipo-marca__chk-ad {
        grid-column: 2;
        grid-row: 2;
    }
    .cot-row-tipo-marca__objeto {
        grid-column: 1 / -1;
        grid-row: 3;
        border-top: 1px solid #1a5276;
    }

    .cot-formato-sheet--excel .cot-row-tipo-marca__objeto {
        border-top-color: #000;
    }
}

.cot-tipo-stack {
    display: flex;
    flex-direction: column;
    width: 140px;
    flex-shrink: 0;
    border-right: 1px solid #1a5276;
}

.cot-tipo-cell {
    flex: 1;
    border-bottom: 1px solid #1a5276;
}

.cot-tipo-cell:last-child {
    border-bottom: none;
}

.cot-tipo-cell .cot-flabel {
    min-height: 2rem;
    font-size: 0.68rem;
}

.cot-mark-cell {
    justify-content: center;
    min-height: 2.25rem;
    border: 1px solid #cbd5e1;
    margin: 0.35rem 0.5rem 0.45rem;
    border-radius: 2px;
    background: #fff;
}

/* Radios con apariencia de casilla: solo uno activo (grupo tipo_evento_marca) */
.cot-marca-label {
    position: relative;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2rem;
    margin: 0;
}

.cot-marca-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.cot-marca-faux {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid #64748b;
    border-radius: 3px;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    color: #1a5276;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cot-marca-label:hover .cot-marca-faux {
    border-color: #1a5276;
}

.cot-marca-input:focus + .cot-marca-faux {
    outline: 2px solid rgba(26, 82, 118, 0.35);
    outline-offset: 2px;
}

.cot-marca-input:checked + .cot-marca-faux {
    border-color: #1a5276;
    background: #e8f0f7;
}

.cot-marca-input:checked + .cot-marca-faux::after {
    content: '✓';
}

.cot-objeto-cell {
    flex: 1;
    min-width: 200px;
    border-right: none;
}

.cot-objeto-cell .cot-flabel {
    min-height: 2.5rem;
}

.cot-objeto-cell .cot-fval {
    align-items: stretch;
}

/* Etiqueta a la izquierda y cuadro de texto a la derecha (misma fila) */
.cot-objeto-cell--label-side {
    flex-direction: row;
    align-items: stretch;
}

.cot-objeto-cell--label-side .cot-objeto-side-label {
    flex: 0 0 8.75rem;
    max-width: 9.5rem;
    min-height: 0;
    align-self: stretch;
    border-right: 1px solid #1a5276;
    padding: 0.45rem 0.35rem;
    line-height: 1.2;
    hyphens: auto;
    overflow-wrap: break-word;
    word-break: break-word;
}

.cot-objeto-cell--label-side .cot-objeto-side-field {
    flex: 1;
    min-width: 0;
    align-items: stretch;
    justify-content: stretch;
    padding: 0.35rem 0.45rem;
}

.cot-objeto-cell--label-side textarea.cot-objeto-ta {
    min-height: 5.25rem;
    width: 100%;
}

@media (max-width: 767px) {
    .cot-objeto-cell--label-side {
        flex-direction: column;
    }
    .cot-objeto-cell--label-side .cot-objeto-side-label {
        flex: none;
        max-width: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #1a5276;
    }
}

/* Cotización — tabla detalle (scroll horizontal) */
.cot-detalle-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cot-detalle-lineas thead th {
    font-size: 0.65rem;
    vertical-align: middle;
    line-height: 1.15;
    white-space: normal;
}

.cot-detalle-lineas tbody td {
    font-size: 0.78rem;
    vertical-align: middle;
}

/* Tabla detalle ítems — encabezado mismo azul #156082 que el formato (grilla negra) */
.cot-detalle-wrap--excel {
    border: 1px solid #000;
    border-radius: 0;
}

.cot-detalle-wrap--excel .cot-detalle-lineas {
    border-collapse: collapse;
}

.cot-detalle-wrap--excel .cot-detalle-lineas thead th {
    background-color: #156082 !important;
    color: #fff !important;
    font-weight: 700;
    border: 1px solid #000 !important;
    vertical-align: middle;
    font-size: 0.65rem;
    line-height: 1.15;
    white-space: normal;
}

.cot-detalle-wrap--excel .cot-detalle-lineas thead th .fw-normal {
    color: #fff;
    opacity: 0.95;
}

.cot-detalle-wrap--excel .cot-detalle-lineas tbody td {
    border: 1px solid #000 !important;
    color: #000;
    background-color: #fff !important;
    font-size: 0.78rem;
    vertical-align: middle;
}

.cot-detalle-wrap--excel .cot-detalle-lineas.table-bordered > :not(caption) > * > * {
    border-color: #000 !important;
}

.cot-detalle-wrap--excel .cot-detalle-tfoot-totales td {
    background: #e9ecef !important;
    color: #000;
    border: 1px solid #000 !important;
    font-size: 0.72rem;
    vertical-align: middle;
}

.cot-detalle-wrap--excel .cot-detalle-tfoot-totales .cot-totales-lbl {
    background: #dee2e6 !important;
}

.cot-detalle-wrap--excel .cot-detalle-tfoot-totales .cot-totales-grand {
    background: #d8e9f5 !important;
}

.cot-detalle-wrap--excel .cot-detalle-tfoot-totales .cot-totales-acc {
    background: #e9ecef !important;
}

/* Cotización — aspecto hoja Excel (bordes negros; cabeceras de variables #156082) */
.cot-formato-sheet--excel {
    border: 1px solid #000;
    border-radius: 0;
}

.cot-formato-sheet--excel .cot-doc-head {
    border-bottom: 1px solid #000;
}

.cot-formato-sheet--excel .cot-doc-head__line {
    color: #000;
    font-weight: 700;
}

.cot-formato-sheet--excel .cot-doc-meta-pair {
    border-color: #000;
}

.cot-formato-sheet--excel .cot-doc-meta-cell {
    color: #000;
    font-weight: 700;
}

.cot-formato-sheet--excel .cot-doc-meta-cell:first-child {
    border-right-color: #000;
}

.cot-formato-sheet--excel .cot-formato-grid {
    border-top-color: #000;
}

.cot-formato-sheet--excel .cot-formato-grid.cot-formato-grid--cdp-rp {
    border-top-color: #000;
}

.cot-formato-sheet--excel .cot-fcell {
    border-right-color: #000;
    border-bottom-color: #000;
}

.cot-formato-sheet--excel .cot-flabel {
    background: #156082;
    color: #fff;
    font-weight: 700;
}

/* Campos sin borde propio: el contorno lo marca la grilla (celda) */
.cot-formato-sheet--excel .cot-finput,
.cot-formato-sheet--excel select.cot-finput,
.cot-formato-sheet--excel textarea.cot-finput {
    color: #000;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background-color: #fff;
}

.cot-formato-sheet--excel .cot-finput:focus,
.cot-formato-sheet--excel select.cot-finput:focus,
.cot-formato-sheet--excel textarea.cot-finput:focus {
    border: 0 !important;
    box-shadow: none !important;
    outline: none;
}

.cot-formato-sheet--excel .cot-finput:focus-visible,
.cot-formato-sheet--excel select.cot-finput:focus-visible,
.cot-formato-sheet--excel textarea.cot-finput:focus-visible {
    outline: 2px solid #156082;
    outline-offset: 1px;
}

.cot-formato-sheet--excel .cot-static-text {
    color: #000;
}

.cot-formato-sheet--excel .cot-fcell--static .cot-fval {
    background: #fff;
}

.cot-formato-sheet--excel .cot-formato-row2 {
    border-bottom-color: #000;
}

.cot-formato-sheet--excel .cot-row-tipo-marca__lbl-ini,
.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ini,
.cot-formato-sheet--excel .cot-row-tipo-marca__lbl-ad,
.cot-formato-sheet--excel .cot-row-tipo-marca__chk-ad,
.cot-formato-sheet--excel .cot-row-tipo-marca__objeto {
    border-color: #000;
}

@media (max-width: 767px) {
    .cot-formato-sheet--excel .cot-row-tipo-marca__objeto {
        border-top-color: #000;
    }
    .cot-formato-sheet--excel .cot-objeto-cell--label-side .cot-objeto-side-label {
        border-bottom-color: #000;
    }
}

.cot-formato-sheet--excel .cot-objeto-cell--label-side .cot-objeto-side-label {
    border-right-color: #000;
}

.cot-formato-sheet--excel .cot-row-tipo-marca .cot-marca-faux {
    border: none;
    box-shadow: none;
    color: #000;
    background: transparent;
}

.cot-formato-sheet--excel .cot-row-tipo-marca .cot-marca-label:hover .cot-marca-faux {
    border: none;
    box-shadow: none;
}

.cot-formato-sheet--excel .cot-row-tipo-marca .cot-marca-input:focus + .cot-marca-faux {
    outline: 2px solid rgba(0, 0, 0, 0.35);
    outline-offset: 2px;
}

.cot-formato-sheet--excel .cot-row-tipo-marca .cot-marca-input:checked + .cot-marca-faux {
    border: none;
    background: transparent;
}

.cot-formato-sheet--excel .cot-marca-input:checked + .cot-marca-faux::after {
    content: 'X';
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    color: #000;
}

/* Fila vacía tipo grilla Excel */
.cot-excel-blank-row {
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    background: #fff;
    min-height: 1.35rem;
    height: 1.35rem;
    box-sizing: border-box;
}

.cot-formato-sheet:not(.cot-formato-sheet--excel) .cot-excel-blank-row {
    border-left-color: #1a5276;
    border-right-color: #1a5276;
    border-bottom-color: #1a5276;
}

/* Pie del formulario cotización: firmas + totales + observaciones + instrucciones (como PDF / Excel) */
.cot-pie-cotizacion {
    padding: 0;
    overflow: hidden;
    border: 1px solid #000;
    border-radius: 0;
}

.cot-pie-main {
    border-collapse: collapse;
    width: 100%;
}

.cot-pie-firmas-inner {
    border-collapse: collapse;
}

.cot-sign-panel {
    border-collapse: collapse;
    font-size: 0.65rem;
}

.cot-sign-hd {
    background: #156082;
    color: #fff;
    font-weight: 700;
    text-align: center;
    padding: 0.35rem 0.4rem;
    border: 1px solid #000;
    font-size: 0.62rem;
}

.cot-sign-left,
.cot-sign-right {
    border: 1px solid #000;
    border-top: none;
    padding: 0.35rem;
    vertical-align: top;
    width: 50%;
    background: #fff;
    color: #000;
}

.cot-sign-panel-elaborado,
.cot-sign-panel-aprobado {
    table-layout: fixed;
}

.cot-sign-panel-elaborado tbody td.cot-sign-elab-lbl,
.cot-sign-panel-elaborado tbody td.cot-sign-elab-val,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-lbl,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-val {
    border: 1px solid #000;
    border-top: none;
    padding: 0.4rem 0.5rem;
    text-align: center;
    vertical-align: middle;
    background: #fff;
    color: #000;
    font-size: 0.65rem;
    line-height: 1.25;
    text-transform: uppercase;
    width: 58%;
}

.cot-sign-panel-elaborado tbody td.cot-sign-elab-lbl,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-lbl {
    font-weight: 800;
}

.cot-sign-panel-elaborado tbody td.cot-sign-elab-val,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-val {
    font-weight: 400;
}

.cot-sign-panel-elaborado tbody td.cot-sign-elab-val-nombre,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-val-nombre {
    min-height: 2.35rem;
}

.cot-sign-panel-elaborado tbody td.cot-sign-elab-firma-lbl,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-firma-lbl {
    border: 1px solid #000;
    border-top: none;
    padding: 0.4rem 0.5rem;
    text-align: center;
    vertical-align: middle;
    background: #fff;
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
    width: 42%;
}

.cot-sign-panel-elaborado tbody td.cot-sign-elab-firma-box,
.cot-sign-panel-aprobado tbody td.cot-sign-elab-firma-box {
    border: 1px solid #000;
    border-top: none;
    padding: 0.45rem;
    vertical-align: top;
    background: #fff;
    width: 42%;
    min-height: 6.75rem;
}

.cot-sign-mini-lbl {
    font-weight: 700;
    font-size: 0.6rem;
    margin-bottom: 0.2rem;
}

.cot-sign-line-blank {
    min-height: 2rem;
    border-bottom: 1px solid #000;
    margin-bottom: 0.35rem;
}

.cot-sign-cargo-txt {
    font-weight: 700;
    font-size: 0.65rem;
    min-height: 1.25rem;
}

.cot-sign-firma-box {
    min-height: 4.5rem;
    margin-top: 0.25rem;
}

.cot-pie-sum-box {
    border-collapse: collapse;
    font-size: 0.72rem;
    width: 100%;
}

.cot-pie-sum-k,
.cot-pie-sum-v {
    border: 1px solid #000;
    padding: 0.25rem 0.45rem;
    background: #fff;
    color: #000;
    font-weight: 600;
}

.cot-pie-sum-v {
    text-align: right;
    white-space: nowrap;
}

.cot-pie-obs {
    border-collapse: collapse;
    width: 100%;
    border-top: 1px solid #000;
}

.cot-pie-obs-lbl {
    background: #156082;
    color: #fff;
    font-weight: 700;
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid #000;
    width: 22%;
    vertical-align: middle;
}

.cot-pie-obs-val {
    border: 1px solid #000;
    border-left: none;
    min-height: 2rem;
    background: #fff;
}

.cot-pie-obs-input,
.cot-pie-mod-input {
    min-height: 2rem;
    font-size: 0.75rem;
    resize: vertical;
    background: #fff;
}

.cot-pie-mods-table .cot-pie-mod-input {
    width: 100%;
}

.cot-pie-obs tr.cot-pie-obs-gap td.cot-pie-obs-gap-cell {
    border-left: 1px solid #000;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    border-top: none;
    height: 1.35rem;
    min-height: 1.35rem;
    padding: 0;
    background: #fff;
    line-height: 0;
    font-size: 0;
}

.cot-pie-footer {
    border-collapse: collapse;
    width: 100%;
    border-top: 1px solid #000;
}

.cot-pie-inst-table {
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font-size: 0.62rem;
}

.cot-pie-inst-hd {
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #000;
    background: #fff;
    color: #000;
}

.cot-pie-inst-body {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid #000;
    vertical-align: top;
    background: #fff;
    color: #000;
    line-height: 1.35;
}

.cot-pie-inst-ft {
    padding: 0.35rem 0.5rem;
    font-size: 0.58rem;
    line-height: 1.35;
    background: #fff;
    color: #000;
    white-space: pre-wrap;
}

.cot-pie-mods-table {
    border-collapse: collapse;
    font-size: 0.6rem;
    width: 100%;
}

.cot-pie-mods-table th {
    background: #156082;
    color: #fff;
    font-weight: 700;
    border: 1px solid #000;
    padding: 0.3rem 0.25rem;
    text-align: center;
}

.cot-pie-mods-table td {
    border: 1px solid #000;
    background: #fff;
    color: #000;
    height: 1.5rem;
}

@media (max-width: 991px) {
    .cot-pie-main > tbody > tr {
        display: flex;
        flex-direction: column;
    }

    .cot-pie-firmas-cell,
    .cot-pie-sum-cell {
        display: block;
        width: 100% !important;
        max-width: none !important;
    }

    .cot-pie-firmas-inner > tbody > tr {
        display: flex;
        flex-direction: column;
    }

    .cot-pie-firmas-inner > tbody > tr > td {
        display: block;
        width: 100% !important;
        padding: 0.5rem 0 !important;
    }

    .cot-pie-footer > tbody > tr {
        display: flex;
        flex-direction: column;
    }

    .cot-pie-inst,
    .cot-pie-mods {
        display: block;
        width: 100% !important;
    }
}
