/* iStar Live VRM v1.6.6 - dashboard compacto estilo VRM */
.istar-live-vrm,
.istar-live-vrm * { box-sizing: border-box; }

.istar-live-vrm {
    --vrm-bg: #2f3234;
    --vrm-bg-2: #36393b;
    --vrm-card: #3a3d3f;
    --vrm-card-top: #414446;
    --vrm-border: rgba(255,255,255,.12);
    --vrm-border-soft: rgba(255,255,255,.075);
    --vrm-text: rgba(255,255,255,.93);
    --vrm-muted: rgba(255,255,255,.68);
    --vrm-soft: rgba(255,255,255,.44);
    --vrm-blue: #4394d0;
    --vrm-blue-soft: rgba(67,148,208,.18);
    --vrm-orange: #f1a836;
    --vrm-green: #7ed46a;
    --vrm-wire: rgba(220,230,238,.18);
    position: relative;
    padding: clamp(42px, 5.5vw, 72px) 20px;
    background: linear-gradient(180deg, #22313c 0%, #17242e 100%);
    color: var(--vrm-text);
    overflow: hidden;
}

.istar-live-vrm::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 8%, rgba(67,148,208,.14), transparent 36%),
        radial-gradient(circle at 16% 92%, rgba(241,168,54,.07), transparent 34%);
    pointer-events: none;
}

.istar-live-vrm__wrap {
    position: relative;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.istar-live-vrm__topbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 14px 0 18px;
    overflow: hidden;
    border: 1px solid var(--vrm-border-soft);
    border-radius: 6px;
    background: rgba(0,0,0,.26);
    font-family: var(--font-body, 'Rajdhani', sans-serif);
}

.istar-live-vrm__top-item {
    min-width: 0;
    padding: 12px 16px 11px;
    background: rgba(255,255,255,.035);
}

.istar-live-vrm__top-item span {
    display: block;
    margin-bottom: 4px;
    color: var(--vrm-muted);
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.1;
}

.istar-live-vrm__top-item strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.istar-live-vrm.is-online .istar-live-vrm__top-item:nth-child(2) strong::before,
.istar-live-vrm.is-error .istar-live-vrm__top-item:nth-child(2) strong::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.istar-live-vrm.is-online .istar-live-vrm__top-item:nth-child(2) strong::before {
    background: #3de48f;
    box-shadow: 0 0 0 4px rgba(61,228,143,.13);
}

.istar-live-vrm.is-error .istar-live-vrm__top-item:nth-child(2) strong::before {
    background: #ff7676;
    box-shadow: 0 0 0 4px rgba(255,118,118,.13);
}

.istar-live-vrm__title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin: 0 0 10px;
}

.istar-live-vrm__title-copy { min-width: 0; }

.istar-live-vrm__eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--vrm-orange);
    font-family: var(--font-body, 'Rajdhani', sans-serif);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    text-transform: uppercase;
}

.istar-live-vrm h2 {
    margin: 6px 0 5px;
    color: #fff;
    font-family: var(--font-heading, 'Oskar One', sans-serif);
    font-size: clamp(1.65rem, 3vw, 3.05rem);
    font-weight: 400;
    letter-spacing: .014em;
    line-height: .95;
    text-transform: uppercase;
}

.istar-live-vrm p {
    margin: 0;
    max-width: 760px;
    color: var(--vrm-muted);
    font-family: var(--font-body, 'Rajdhani', sans-serif);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.35;
}

.istar-live-vrm__privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 6px;
    background: rgba(0,0,0,.18);
    color: rgba(255,255,255,.78);
    font-family: var(--font-body, 'Rajdhani', sans-serif);
    font-size: .94rem;
    font-weight: 700;
}

.istar-live-vrm__privacy-badge .material-symbols-outlined {
    color: var(--vrm-orange);
    font-size: 18px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.istar-live-vrm__dashboard {
    position: relative;
    height: 520px;
    min-height: 520px;
    max-width: 1180px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 6px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.07)),
        var(--vrm-bg);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.04),
        0 22px 60px rgba(0,0,0,.28);
}

.istar-live-vrm__dashboard::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.024) 1px, transparent 1px);
    background-size: 42px 42px;
    opacity: .52;
    pointer-events: none;
}

.istar-live-vrm__wires {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.vrm-wire {
    fill: none;
    stroke: var(--vrm-wire);
    stroke-width: .62;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vrm-wire--solar-battery {
    stroke: rgba(220,230,238,.13);
}


.istar-live-vrm[data-flow-solar="1"] .vrm-wire--solar-inverter,
.istar-live-vrm[data-flow-load="1"] .vrm-wire--load,
.istar-live-vrm[data-flow-battery-discharge="1"] .vrm-wire--battery-inverter,
.istar-live-vrm[data-flow-charge-grid="1"] .vrm-wire--battery-inverter,
.istar-live-vrm[data-flow-charge-mixed="1"] .vrm-wire--battery-inverter,
.istar-live-vrm[data-flow-grid="1"] .vrm-wire--generator,
.istar-live-vrm[data-flow-charge-solar="1"] .vrm-wire--solar-battery,
.istar-live-vrm[data-flow-charge-mixed="1"] .vrm-wire--solar-battery {
    stroke-width: .95;
    stroke-dasharray: 8 5;
    animation: istar-vrm-wire .95s linear infinite;
    filter: drop-shadow(0 0 1.5px rgba(188,221,244,.34));
}

.istar-live-vrm[data-flow-solar="1"] .vrm-wire--solar-inverter,
.istar-live-vrm[data-flow-charge-solar="1"] .vrm-wire--solar-battery,
.istar-live-vrm[data-flow-charge-mixed="1"] .vrm-wire--solar-battery { stroke: rgba(255,201,104,.94); }
.istar-live-vrm[data-flow-load="1"] .vrm-wire--load { stroke: rgba(188,221,244,.9); }
.istar-live-vrm[data-flow-battery-discharge="1"] .vrm-wire--battery-inverter,
.istar-live-vrm[data-flow-charge-grid="1"] .vrm-wire--battery-inverter,
.istar-live-vrm[data-flow-charge-mixed="1"] .vrm-wire--battery-inverter,
.istar-live-vrm[data-flow-grid="1"] .vrm-wire--generator { stroke: rgba(188,221,244,.92); }

@keyframes istar-vrm-wire { to { stroke-dashoffset: -13; } }

.vrm-tile,
.vrm-inverter {
    position: absolute;
    z-index: 2;
    font-family: var(--font-body, 'Rajdhani', sans-serif);
}

.vrm-tile {
    overflow: hidden;
    border: 1px solid var(--vrm-border);
    border-radius: 6px;
    background: linear-gradient(180deg, var(--vrm-card-top), var(--vrm-card));
    color: var(--vrm-text);
    box-shadow: 0 10px 24px rgba(0,0,0,.23), inset 0 1px 0 rgba(255,255,255,.035);
}

.vrm-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
}

.vrm-tile__head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 15px 16px 0;
    color: #fff;
}

.vrm-tile__head .material-symbols-outlined {
    color: var(--vrm-green);
    flex: 0 0 auto;
    font-size: 23px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 28;
}

.vrm-tile__head strong {
    min-width: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.vrm-tile__head em {
    margin-left: auto;
    color: var(--vrm-muted);
    font-size: .86rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.vrm-tile__value {
    padding: 13px 18px 8px;
    color: #fff;
    font-size: clamp(1.9rem, 2.25vw, 2.55rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -.03em;
}

.vrm-tile__value--soc { font-size: clamp(2.1rem, 2.6vw, 2.9rem); }

.vrm-tile__meta {
    display: flex;
    gap: 12px;
    padding: 10px 18px 13px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: var(--vrm-muted);
    font-size: .94rem;
    font-weight: 700;
}

.vrm-tile__meta--split { justify-content: space-between; }
.vrm-tile__meta b { color: #fff; font-weight: 800; }

.vrm-sparkline {
    display: block;
    width: 100%;
    height: 48px;
    min-height: 0;
    max-height: 48px;
    margin: 0;
    overflow: hidden;
}

.vrm-sparkline__fill { fill: rgba(108,156,194,.30); }
.vrm-sparkline__line { fill: none; stroke: rgba(210,230,240,.9); stroke-width: 2; }
.vrm-sparkline--green .vrm-sparkline__fill { fill: rgba(126,212,106,.20); }
.vrm-sparkline--green .vrm-sparkline__line { stroke: rgba(196,238,184,.9); }
.vrm-sparkline--orange .vrm-sparkline__fill { fill: rgba(241,168,54,.18); }
.vrm-sparkline--orange .vrm-sparkline__line { stroke: rgba(255,213,136,.94); }

.vrm-tile--generator {
    left: 34px;
    top: 54px;
    width: 270px;
    min-height: 132px;
}

.vrm-tile--generator .vrm-tile__value {
    padding-top: 20px;
    font-size: 2.05rem;
}

.vrm-tile--battery {
    left: 34px;
    bottom: 38px;
    width: 270px;
    min-height: 212px;
}

.vrm-tile--loads {
    right: 34px;
    top: 54px;
    width: 270px;
    min-height: 202px;
}

.vrm-tile--solar {
    right: 34px;
    bottom: 38px;
    width: 270px;
    min-height: 202px;
}

.vrm-inverter {
    left: 50%;
    top: 140px;
    width: 152px;
    height: 238px;
    transform: translateX(-50%);
    overflow: hidden;
    border: 1px solid rgba(87,165,222,.82);
    border-radius: 6px;
    background: #30343a;
    box-shadow: 0 13px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.15) inset;
}

.vrm-inverter__top {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: var(--vrm-blue);
}

.vrm-inverter__top .material-symbols-outlined {
    color: #fff;
    font-size: 64px;
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 48;
}

.istar-vrm-logo-mark {
    display: block;
    width: 122px;
    max-width: 84%;
    height: 104px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.22));
}

.vrm-inverter__stripe { height: 4px; background: var(--vrm-orange); }

.vrm-inverter__bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 84px;
    padding: 0 12px;
    background: #303030;
    color: #75b7e8;
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
}

.vrm-tile.is-active,
.vrm-inverter.is-active {
    border-color: rgba(118,187,236,.56);
    box-shadow: 0 12px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(118,187,236,.12), 0 0 20px rgba(67,148,208,.09);
}

.istar-live-vrm__updated,
.istar-live-vrm__canvas,
.istar-live-vrm__lines,
.istar-live-vrm__node,
.istar-live-vrm__metric,
.istar-live-vrm__note,
.istar-live-vrm__panel-head,
.istar-live-vrm__metrics,
.istar-live-vrm__flow,
.istar-live-vrm__panel { display: none !important; }

@media (max-width: 1060px) {
    .istar-live-vrm__dashboard {
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px;
    }
    .istar-live-vrm__wires,
    .vrm-inverter { display: none; }
    .vrm-tile {
        position: relative;
        inset: auto;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: auto;
        min-height: 156px;
    }
    .vrm-tile--battery,
    .vrm-tile--loads,
    .vrm-tile--solar { min-height: 205px; }
}

@media (max-width: 720px) {
    .istar-live-vrm { padding: 34px 14px; }
    .istar-live-vrm__topbar { grid-template-columns: 1fr; }
    .istar-live-vrm__title-row { flex-direction: column; align-items: flex-start; }
    .istar-live-vrm__privacy-badge { width: 100%; justify-content: center; }
    .istar-live-vrm__dashboard { grid-template-columns: 1fr; }
    .vrm-tile__value { font-size: 2.2rem; }
}
