﻿:root {
    --acm-border: #e9eef2;
    --acm-muted: #6c757d;
    --acm-accent: #2563eb;
    --acm-accent-2: #0ea5a4;
    --acm-padre-bg: #f3f7fb;
    --acm-zebra: #fbfdff;
    --acm-card-bg: #ffffff;
    --acm-shadow: 0 6px 18px rgba(20, 40, 60, 0.06);
    --acm-radius: 12px;
    --acm-success: #16a34a;
    --acm-warn: #f59e0b;
    --acm-danger: #ef4444;
}

/* Contenedor principal */
.acm.acm-card {
    border: 1px solid var(--acm-border);
    border-radius: var(--acm-radius);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,251,253,0.99));
    box-shadow: var(--acm-shadow);
    overflow: hidden;
}

/* Header con estilo */
.acm .acm-card-header {
    background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(14,165,164,0.02));
    border-bottom: 1px solid var(--acm-border);
    padding: 1rem 1.25rem;
}

.acm .acm-title {
    font-size: 1.02rem;
    color: #061428;
}

.acm .acm-subtitle {
    color: var(--acm-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Table wrapper for horizontal scroll on small screens */
.acm .acm-table-wrapper {
    width: 100%;
    overflow: auto;
}

/* table general */
.acm .acm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    color: #0f1724;
    min-width: 820px;
}

    /* sticky header for better UX */
    .acm .acm-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: .76rem 1rem;
        text-align: left;
        font-weight: 700;
        background: linear-gradient(180deg,#fbfdff,#f7f9fb);
        border-bottom: 1px solid var(--acm-border);
        color: #0b1220;
        font-size: .90rem;
        text-transform: none;
    }

        /* numeric headers right aligned */
        .acm .acm-table thead th.numeric {
            text-align: right;
        }

    /* body cells */
    .acm .acm-table tbody td {
        padding: .7rem 1rem;
        vertical-align: middle;
        border-top: 1px solid rgba(9, 30, 66, 0.03);
        background: var(--acm-card-bg);
        transition: background .18s ease;
    }

/* fila de asesor: hover ligero */
.acm .acm-asesor-row:hover td {
    background: linear-gradient(90deg, rgba(37,99,235,0.02), rgba(14,165,164,0.01));
}

/* banda padre más pronunciada */
.acm .acm-padre-row td {
    background-color: var(--acm-padre-bg) !important;
    font-weight: 700;
    color: #0b1720;
    border-left: 3px solid rgba(37,99,235,0.08);
}

/* zebra leve */
.acm .acm-table tbody tr:not(.acm-padre-row):nth-child(odd) td {
    background: #ffffff;
}

.acm .acm-table tbody tr:not(.acm-padre-row):nth-child(even) td {
    background: var(--acm-zebra);
}

/* enlaces de categoria y asesor */
.acm .acm-cat-link,
.acm .acm-asesor-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--acm-accent);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    font-size: .95rem;
    transition: color .15s ease, transform .08s ease;
}

    .acm .acm-cat-link:hover,
    .acm .acm-asesor-link:hover {
        color: var(--acm-accent-2);
        transform: translateY(-1px);
    }

/* caret */
.acm .acm-caret {
    width: 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: transform .18s ease;
}

/* código (monospace) alineado a la izquierda */
.acm .acm-code-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
    color: var(--acm-muted);
    font-size: .86rem;
    min-width: 72px;
    text-align: left;
    padding-right: .6rem;
    white-space: nowrap;
    flex: 0 0 72px;
    display: inline-flex;
    align-items: center;
}

/* Alineación para celda Asesor (fix de desalineo) */
.acm .acm-asesor-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
}

.acm .acm-asesor-name {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.acm .acm-asesor-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .18rem .6rem;
    height: 34px;
    line-height: 1;
    border-radius: 999px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Texto del asesor: recorta si es muy largo */
.acm .acm-asesor-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 600;
}

/* columna de categoria: indent por nivel */
.acm .acm-category-col {
    text-align: left;
    vertical-align: middle;
}

.acm .acm-lvl-1 .acm-category-col {
    padding-left: .6rem;
    font-weight: 700;
}

.acm .acm-lvl-2 .acm-category-col {
    padding-left: 1.6rem;
    font-weight: 600;
    color: #0b1720;
}

.acm .acm-lvl-3 .acm-category-col {
    padding-left: 2.6rem;
    font-weight: 600;
    color: #122032;
}

.acm .acm-lvl-4 .acm-category-col {
    padding-left: 3.8rem;
    font-weight: 500;
    color: #233447;
}

/* números alineados a la derecha */
.acm .acm-num-cell {
    text-align: right;
    white-space: nowrap;
}

.acm .acm-num-main {
    display: block;
    font-weight: 700;
    color: #081426;
}

.acm .acm-num-sub {
    display: block;
    font-size: .80rem;
    color: var(--acm-muted);
    margin-top: .06rem;
}

/* inner header */
.acm .acm-det-inner thead th {
    padding: .5rem .75rem;
    font-size: .84rem;
    color: #495057;
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* progreso para porcentaje */
.acm .acm-pct-cell {
    min-width: 110px;
    max-width: 160px;
    padding-right: 1rem;
}

.acm .acm-pct-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: flex-end;
}

.acm .acm-pct-bar {
    width: 80px;
    height: 8px;
    background: rgba(9,30,66,0.04);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.02);
}

.acm .acm-pct-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--acm-success), #6ee7b7);
    border-radius: 999px;
    transition: width .5s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 1px 6px rgba(14,165,164,0.06);
}

/* label del porcentaje */
.acm .acm-pct-label {
    font-weight: 700;
    font-size: .86rem;
    min-width: 42px;
    text-align: right;
    color: #0b1220;
}

/* especificidad para evitar overrides */
.acm .acm-table th, .acm .acm-table td {
    vertical-align: middle !important;
}

/* pequeños ajustes responsive */
@media (max-width: 920px) {
    .acm .acm-table {
        min-width: 720px;
    }
}

@media (max-width: 640px) {
    .acm .acm-table {
        min-width: 600px;
        font-size: .88rem;
    }

    .acm .acm-card-header {
        padding: .75rem;
    }

    .acm .acm-title {
        font-size: .98rem;
    }
}

/* estado focus accesible */
.acm .acm-cat-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    border-radius: 6px;
}
