/* ==========================================================================
   views/presupuestos.css — Estilos exclusivos de Presupuestos (presupuestos.html)
   Prefijo de clases: pr-
   ========================================================================== */

/* Segmentado del encabezado: template.css da width:100% a todo <button> */
.mod-head .ui-segment button {
    width: auto;
    line-height: 1.2;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 999px;
}

/* ---------- Anillo de uso del mes ---------- */
.pr-gauge {
    display: flex;
    align-items: center;
    gap: 18px;
    animation: app-slide-up .4s var(--app-ease) both;
}
.pr-gauge[hidden] { display: none; }

.pr-ring {
    position: relative;
    width: 136px;
    height: 136px;
    flex-shrink: 0;
}
.pr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pr-ring circle { fill: none; stroke-width: 12; }
.pr-ring-track { stroke: var(--greyscale-100); }
.pr-ring-value {
    stroke: url(#pr-grad);
    stroke-linecap: round;
    stroke-dasharray: var(--p) 100;
    animation: pr-ring-in 1.2s var(--app-ease) both;
}
.pr-ring-value.is-warn { stroke: var(--orange); }
.pr-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.pr-ring-label strong { font-size: 28px; font-weight: 700; color: var(--primary-base); line-height: 1; }
.pr-ring-label span { font-size: 12px; color: var(--greyscale-500); margin-top: 4px; }

@keyframes pr-ring-in {
    from { stroke-dasharray: 0 100; }
}

.pr-gauge-info { flex: 1; min-width: 0; }
.pr-gauge-eyebrow { display: block; font-size: 11.5px; font-weight: 600; color: var(--primary); }
.pr-gauge-info > p { font-size: 22px; font-weight: 700; color: var(--primary-base); margin-top: 2px; }
.pr-gauge-info > p small { font-size: 12px; font-weight: 500; color: var(--greyscale-500); }
.pr-gauge-kv { display: grid; gap: 6px; margin-top: 10px; }
.pr-gauge-kv li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    color: var(--greyscale-500);
}
.pr-gauge-kv b { color: var(--primary-base); font-weight: 600; }

/* ---------- Categorías ---------- */
.pr-cat { align-items: flex-start; }
.pr-cat .mod-item-body { display: grid; gap: 7px; }
.pr-cat-row {
    display: flex !important;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin: 0 !important;
}
.pr-cat-row small { font-size: 11.5px; color: var(--greyscale-500); }
.pr-cat .ui-bar { display: block; margin: 0; }
.pr-pct { font-size: 14px; font-weight: 700; color: var(--c-green); }
.pr-pct.is-warn { color: var(--c-orange); }
.pr-pct.is-danger { color: var(--c-red); }
.pr-alert { font-weight: 600; color: var(--c-orange) !important; }
.pr-pct.is-danger ~ .pr-alert,
.pr-cat .ui-bar.danger + .pr-cat-row .pr-alert { color: var(--c-red) !important; }

/* ---------- Regla 50/30/20 ---------- */
.pr-income { font-size: 12.5px; color: var(--greyscale-500); }
.pr-income b { color: var(--primary-base); }

.pr-need { background: linear-gradient(90deg, #C084FC, var(--c-violet)); }
.pr-want { background: linear-gradient(90deg, #FDBA74, var(--c-orange)); }
.pr-save { background: linear-gradient(90deg, #4ADE80, var(--c-green)); }

.pr-rule-stack {
    display: flex;
    height: 34px;
    border-radius: 12px;
    overflow: hidden;
    gap: 3px;
    margin-bottom: 18px;
}
.pr-rule-stack span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
}

.pr-rule-row + .pr-rule-row { margin-top: 16px; }
.pr-rule-head { display: flex; align-items: center; gap: 12px; }
.pr-rule-head .mod-item-ico { width: 38px; height: 38px; border-radius: 12px; }
.pr-rule-head p { font-size: 14px; font-weight: 600; color: var(--primary-base); }
.pr-rule-head span:not(.mod-item-ico) { display: block; font-size: 11.5px; color: var(--greyscale-500); }
.pr-rule-head b { display: block; font-size: 14px; color: var(--primary-base); }
.pr-rule-head small { display: block; font-size: 11px; color: var(--greyscale-500); }

.pr-rule-bar {
    position: relative;
    height: 8px;
    margin-top: 10px;
    border-radius: 999px;
    background: var(--greyscale-100);
}
.pr-rule-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    transform-origin: left;
    animation: ui-bar-in 1.1s var(--app-ease) both;
}
/* Marca de la meta */
.pr-rule-bar em {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    margin-left: -1px;
    border-radius: 2px;
    background: var(--primary-base);
}

.pr-rule-tip {
    display: flex;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--c-orange-bg);
    color: #9A3412;
    font-size: 12.5px;
    line-height: 1.45;
}
.pr-rule-tip .ico { flex-shrink: 0; margin-top: 1px; }
