/* FuturIntrosWebApp/Front/MainPage/Modules/HealsAndFood/EnergyBalance/EnergyBalance.css */
.EnergyBalanceRoot {
    width: 100%;
    height: 100%;
    padding: 18px 18px 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    color: rgba(226, 232, 240, 0.96);
    overflow-y: auto;
}

.EnergyBalanceTabs {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    align-self: start;
    justify-self: start;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    padding: 6px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(8, 13, 25, 0.9), rgba(8, 25, 55, 0.46));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.EnergyBalanceTab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: auto !important;
    min-height: 42px;
    flex: 0 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.5);
    padding: 0 18px;
    border-radius: 999px;
    cursor: pointer;
    color: rgba(226, 232, 240, 0.85);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    font-family: inherit;
}

.EnergyBalanceTab:hover {
    border-color: rgba(125, 211, 252, 0.45);
    color: rgba(226, 232, 240, 0.98);
    transform: translateY(-1px);
}

.EnergyBalanceTab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.24);
}

.EnergyBalanceTab.is-active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.84), rgba(37, 99, 235, 0.84));
    border-color: rgba(56, 189, 248, 0.8);
    color: #0f172a;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.EnergyBalancePanel {
    display: none;
    min-width: 0;
}

.EnergyBalancePanel.is-active {
    display: grid;
    gap: 16px;
    align-content: start;
    min-width: 0;
}

.EnergyBalanceCard {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(8, 13, 25, 0.96), rgba(8, 25, 55, 0.68)),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.12), transparent 48%);
    padding: 18px;
    display: grid;
    gap: 12px;
    align-content: start;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.EnergyBalanceCard--full {
    grid-column: 1 / -1;
}

.EnergyBalanceCard h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
}

.EnergyBalanceHeader {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
}

.EnergyBalanceTitle {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.EnergyBalanceSub {
    margin: 4px 0 0;
    color: rgba(148, 163, 184, 0.9);
    font-size: 13px;
    line-height: 1.45;
}

.EnergyBalanceFilters {
    display: inline-flex;
    align-items: end;
    gap: 10px 12px;
    flex-wrap: wrap;
}

.EnergyBalanceFilters label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.9);
}

.EnergyBalanceFilters--collab label {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
}

.EnergyBalanceFilters input[type='date'],
.EnergyBalanceFilters select {
    background: rgba(2, 6, 23, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: rgba(226, 232, 240, 0.96);
    border-radius: 10px;
    min-height: 40px;
    padding: 0 10px;
    box-sizing: border-box;
    font: inherit;
}

.EnergyBalanceFilters button {
    justify-self: start;
}

.EnergyBalanceKpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.EnergyBalanceKpis--collab {
    margin-top: 12px;
}

.EnergyBalanceKpi {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 14px;
    background: rgba(2, 6, 23, 0.56);
    display: grid;
    gap: 6px;
    align-content: start;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.EnergyBalanceKpi span {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.9);
}

.EnergyBalanceKpi strong {
    font-size: 22px;
    line-height: 1.1;
}

.EnergyBalanceKpi em {
    font-style: normal;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.85);
}

.EnergyBalanceKpiCalcValue {
    position: relative;
    display: inline-flex;
    width: fit-content;
    font-size: 11px;
    color: rgba(125, 211, 252, 0.98);
    text-decoration: underline dotted rgba(125, 211, 252, 0.7);
    cursor: help;
}

.EnergyBalanceKpiCalcValue::after {
    content: attr(data-energy-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    width: min(340px, 80vw);
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(2, 6, 23, 0.98);
    color: rgba(226, 232, 240, 0.98);
    white-space: pre-line;
    line-height: 1.35;
    font-size: 11px;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 12;
}

.EnergyBalanceKpiCalcValue::before {
    content: '';
    position: absolute;
    left: 14px;
    bottom: calc(100% + 4px);
    width: 8px;
    height: 8px;
    background: rgba(2, 6, 23, 0.98);
    border-left: 1px solid rgba(125, 211, 252, 0.35);
    border-top: 1px solid rgba(125, 211, 252, 0.35);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.16s ease;
    z-index: 11;
}

.EnergyBalanceKpiCalcValue:hover::after,
.EnergyBalanceKpiCalcValue:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.EnergyBalanceKpiCalcValue:hover::before,
.EnergyBalanceKpiCalcValue:focus-visible::before {
    opacity: 1;
}

.EnergyBalanceGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(800px, 1fr));
    gap: 14px;
    align-items: start;
    align-content: start;
    grid-auto-rows: min-content;
    overflow-x: auto;
}

.EnergyBalanceCollabGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    align-content: start;
    grid-auto-rows: min-content;
}

.EnergyBalanceChart {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.5);
    padding: 14px;
    overflow-x: auto;
    min-width: 800px;
}

.EnergyBalanceChart > div {
    min-width: 800px;
}

.EnergyBalanceChartCanvas {
    position: relative;
}

.EnergyBalanceChart h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.EnergyBalanceSvg {
    width: 100%;
    min-width: 0;
    height: auto;
    display: block;
}

.EnergyBalanceChartHoverTooltip {
    position: absolute;
    left: 0;
    top: 0;
    max-width: min(360px, calc(100% - 20px));
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(2, 6, 23, 0.98);
    color: rgba(226, 232, 240, 0.98);
    white-space: pre-line;
    line-height: 1.35;
    font-size: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 18;
    overflow-wrap: anywhere;
}

.EnergyBalanceLegend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.95);
}

.EnergyBalanceLegend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.EnergyBalanceDot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.EnergyBalanceCollabForm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.EnergyBalanceCollabForm label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.82);
}

.EnergyBalanceCollabForm input[type='text'],
.EnergyBalanceCollabForm select {
    background: rgba(2, 6, 23, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: rgba(226, 232, 240, 0.96);
    border-radius: 10px;
    min-height: 40px;
    padding: 0 10px;
    box-sizing: border-box;
    font: inherit;
}

.EnergyBalanceFilters button,
.EnergyBalanceCollabForm button {
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.24), rgba(37, 99, 235, 0.2));
    color: rgba(186, 230, 253, 0.98);
    border-radius: 10px;
    min-height: 40px;
    padding: 0 16px;
    cursor: pointer;
    width: auto !important;
    height: auto !important;
    font: inherit;
    font-weight: 600;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.EnergyBalanceFilters button:hover,
.EnergyBalanceCollabForm button:hover,
.EnergyBalanceCollabItem button:hover {
    border-color: rgba(125, 211, 252, 0.58);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(14, 116, 144, 0.18);
}

.EnergyBalanceCollabItem {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.54);
    display: grid;
    gap: 10px;
    align-content: start;
}

.EnergyBalanceCollabItem p {
    margin: 0;
    color: rgba(148, 163, 184, 0.95);
    font-size: 12px;
}

.EnergyBalanceCollabItemHeader {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.EnergyBalanceCollabItemHeader small {
    color: rgba(148, 163, 184, 0.92);
    font-size: 12px;
}

.EnergyBalanceCollabItem button {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.82);
    color: rgba(226, 232, 240, 0.96);
    border-radius: 10px;
    min-height: 38px;
    padding: 0 14px;
    width: 100% !important;
    height: auto !important;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.EnergyBalanceCollabItem button[data-energy-collab-remove],
.EnergyBalanceCollabItem button[data-energy-collab-cancel],
.EnergyBalanceCollabItem button[data-energy-collab-reject] {
    border-color: rgba(248, 113, 113, 0.28);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(153, 27, 27, 0.3));
    color: rgba(254, 226, 226, 0.98);
}

.EnergyBalanceEmpty {
    font-size: 13px;
    color: rgba(148, 163, 184, 0.95);
    padding: 4px 0 0;
}

@media (max-width: 920px) {
    .EnergyBalanceRoot {
        padding: 16px 14px 24px;
    }

    .EnergyBalanceKpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .EnergyBalanceGrid {
        grid-template-columns: 1fr;
    }

    .EnergyBalanceCollabGrid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .EnergyBalanceRoot {
        padding: 12px;
    }

    .EnergyBalanceTabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .EnergyBalanceTab {
        width: 100% !important;
        min-width: 0;
    }

    .EnergyBalanceHeader {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .EnergyBalanceKpis {
        grid-template-columns: 1fr;
    }

    .EnergyBalanceCard {
        padding: 14px;
    }
}

html.light-theme .EnergyBalanceRoot {
    --energy-surface: rgba(255, 255, 255, 0.94);
    --energy-surface-soft: rgba(246, 249, 252, 0.92);
    --energy-surface-strong: rgba(238, 243, 248, 0.96);
    --energy-border: rgba(48, 69, 96, 0.16);
    --energy-border-strong: rgba(48, 69, 96, 0.24);
    --energy-shadow: 0 14px 34px rgba(48, 69, 96, 0.12);
    --energy-muted: rgba(48, 69, 96, 0.72);
    --energy-strong: #20344c;
    --energy-popover-bg: rgba(255, 255, 255, 0.98);
    color: var(--text-color);
}

html.light-theme .EnergyBalanceTabs {
    border-color: rgba(56, 189, 248, 0.16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 249, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html.light-theme .EnergyBalanceTab {
    border-color: var(--energy-border-strong);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-color);
}

html.light-theme .EnergyBalanceTab:hover {
    color: var(--energy-strong);
}

html.light-theme .EnergyBalanceCard {
    border-color: var(--energy-border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(242, 247, 252, 0.92)),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 48%);
    box-shadow: var(--energy-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

html.light-theme .EnergyBalanceSub,
html.light-theme .EnergyBalanceFilters label,
html.light-theme .EnergyBalanceKpi span,
html.light-theme .EnergyBalanceKpi em,
html.light-theme .EnergyBalanceLegend,
html.light-theme .EnergyBalanceCollabForm label,
html.light-theme .EnergyBalanceCollabItem p,
html.light-theme .EnergyBalanceCollabItemHeader small,
html.light-theme .EnergyBalanceEmpty {
    color: var(--energy-muted);
}

html.light-theme .EnergyBalanceFilters input[type='date'],
html.light-theme .EnergyBalanceFilters select,
html.light-theme .EnergyBalanceCollabForm input[type='text'],
html.light-theme .EnergyBalanceCollabForm select {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--energy-border-strong);
    color: var(--text-color);
    box-shadow: inset 0 0 0 1px rgba(48, 69, 96, 0.04);
    color-scheme: light;
}

html.light-theme .EnergyBalanceKpi,
html.light-theme .EnergyBalanceChart,
html.light-theme .EnergyBalanceCollabItem {
    border-color: var(--energy-border);
    background: var(--energy-surface-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

html.light-theme .EnergyBalanceKpiCalcValue::after {
    border-color: rgba(56, 189, 248, 0.28);
    background: var(--energy-popover-bg);
    color: #1f2937;
    box-shadow: 0 10px 24px rgba(48, 69, 96, 0.16);
}

html.light-theme .EnergyBalanceKpiCalcValue::before {
    background: var(--energy-popover-bg);
    border-left-color: rgba(56, 189, 248, 0.28);
    border-top-color: rgba(56, 189, 248, 0.28);
}

html.light-theme .EnergyBalanceChartHoverTooltip {
    border-color: rgba(56, 189, 248, 0.28);
    background: var(--energy-popover-bg);
    color: #1f2937;
    box-shadow: 0 10px 24px rgba(48, 69, 96, 0.16);
}

html.light-theme .EnergyBalanceFilters button,
html.light-theme .EnergyBalanceCollabForm button {
    border-color: rgba(56, 189, 248, 0.34);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(37, 99, 235, 0.1));
    color: #0f4c81;
}

html.light-theme .EnergyBalanceFilters button:hover,
html.light-theme .EnergyBalanceCollabForm button:hover,
html.light-theme .EnergyBalanceCollabItem button:hover {
    box-shadow: 0 10px 24px rgba(48, 69, 96, 0.14);
}

html.light-theme .EnergyBalanceCollabItem button {
    border-color: var(--energy-border-strong);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
}

html.light-theme .EnergyBalanceCollabItem button[data-energy-collab-remove],
html.light-theme .EnergyBalanceCollabItem button[data-energy-collab-cancel],
html.light-theme .EnergyBalanceCollabItem button[data-energy-collab-reject] {
    border-color: rgba(220, 38, 38, 0.24);
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.9), rgba(254, 242, 242, 0.94));
    color: #b91c1c;
}
