:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --blue: #2563eb;
    --blue2: #1d4ed8;
    --shadow: 0 10px 24px rgba(2,6,23,.08);
    --radius: 18px;
    /* Semáforo */
    --g-bg: #ecfdf5;
    --g-tx: #065f46;
    --g-bd: #34d399;
    --y-bg: #fffbeb;
    --y-tx: #92400e;
    --y-bd: #fbbf24;
    --r-bg: #fef2f2;
    --r-tx: #991b1b;
    --r-bd: #f87171;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 20% 0%, #eef2ff 0%, transparent 60%), radial-gradient(1200px 600px at 100% 10%, #eff6ff 0%, transparent 55%), var(--bg);
    color: var(--text);
    font-family: var(--font);
    padding: 28px;
}

.wrap {
    max-width: 1040px;
    margin: 0 auto;
}

header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

h1 {
    margin: 0;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -.03em;
}

.sub {
    margin: 6px 0 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* “Modo caja”: info mínima, acción máxima */
.hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.75);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(2,6,23,.06);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.15);
    flex: 0 0 auto;
}

.cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card {
    background: rgba(255,255,255,.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Barra izquierda tipo POS */
.cardInner {
    display: grid;
    grid-template-columns: 8px 1fr;
}

.bar {
    background: #e2e8f0;
}

    .bar.alta {
        background: linear-gradient(180deg, #22c55e, #16a34a);
    }

    .bar.media {
        background: linear-gradient(180deg, #fbbf24, #f59e0b);
    }

    .bar.baja {
        background: linear-gradient(180deg, #f87171, #ef4444);
    }

.content {
    padding: 16px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: flex-start;
}

.topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.title {
    font-size: 22px;
    font-weight: 850;
    letter-spacing: -.01em;
    margin: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    background: #f8fafc;
}

    .pill .miniDot {
        width: 8px;
        height: 8px;
        border-radius: 999px;
        display: inline-block
    }

.priority-alta {
    background: var(--g-bg);
    color: var(--g-tx);
    border-color: var(--g-bd);
}

    .priority-alta .miniDot {
        background: #22c55e
    }

.priority-media {
    background: var(--y-bg);
    color: var(--y-tx);
    border-color: var(--y-bd);
}

    .priority-media .miniDot {
        background: #f59e0b
    }

.priority-baja {
    background: var(--r-bg);
    color: var(--r-tx);
    border-color: var(--r-bd);
}

    .priority-baja .miniDot {
        background: #ef4444
    }

.meta {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--muted);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

    .meta b {
        color: var(--text)
    }

.kpi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
}

/* Tabla de items (formato homologado) */
.table {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.thead {
    display: grid;
    grid-template-columns: 1.4fr .8fr .8fr;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.trow {
    display: grid;
    grid-template-columns: 1.4fr .8fr .8fr;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 10px;
}

    .trow:last-child {
        border-bottom: 0
    }

    /* Filas de patología agrupadoras */
    .trow.pathologyRow {
        grid-template-columns: 1fr;
        background: #f9fafb;
    }

.prod {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.badge {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
    font-size: 13px;
    flex: 0 0 auto;
}

.pname {
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.psub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.sku {
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}

.hintCol {
    color: var(--muted);
    font-weight: 700;
    font-size: 13px;
}

/* Etiqueta de patología (para ayudar al colaborador) */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 3px;
}

.tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #1d4ed8;
}

/* Panel Cashback (se mantiene) */
.cashMain {
    padding: 4px 0 0 0;
}

.cashAmount {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -.03em;
    color: #22c55e;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

    .cashAmount span.small {
        font-size: 15px;
        color: var(--muted);
        font-weight: 600;
    }

.cashMeta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.cashBarOuter {
    margin-top: 12px;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.cashBarInner {
    width: 65%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg,#22c55e,#a3e635);
}

/* Botones */
.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    min-width: 240px;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, var(--blue), var(--blue2));
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(37,99,235,.22);
    width: 240px;
    text-align: center;
    user-select: none;
}

    .btn:hover {
        filter: saturate(1.08)
    }

    .btn:active {
        transform: translateY(1px)
    }

    .btn.ghost {
        background: #fff;
        color: #0f172a;
        border: 1px solid var(--border);
        box-shadow: none;
        font-weight: 800;
    }

.smallnote {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    max-width: 240px;
    line-height: 1.35;
}

/* Responsive */
@media (max-width: 860px) {
    body {
        padding: 18px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 34px;
    }

    .content {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .actions {
        align-items: stretch;
        min-width: unset;
    }

    .btn {
        width: 100%;
    }

    .smallnote {
        max-width: unset;
        text-align: left;
    }

    .thead {
        display: none;
    }

    .trow {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .sku, .hintCol {
        font-size: 12px;
    }
}
