/* ═══════════════════════════════════════════════════════════════════════════
   ENERGY COMMUNITY GABROVO — Dashboard styles
════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green-dark:  #03342E;
    --green:       #0A4C3E;
    --green-light: #06FFC3;
    --white:       #FFFFFF;
    --purple:      #e040fb;

    --gap: 1rem;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--green-dark);
    color: var(--white);
    height: 100vh;
    overflow: hidden;
    padding: var(--gap);
}

/* ─── Shared card ─────────────────────────────────────────────────────────── */

.card {
    position: relative;
    background: var(--green);
    border: 3px solid var(--green-light);
    border-radius: 16px;
    padding: 1.5rem;
}

/* ─── Floating card labels (sit on the top border of each card) ───────────── */

.card-label {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--green-dark);
    border-radius: 999px;
    padding: 0.2rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 2;
}

.card-label--purple { color: var(--purple); }
.card-label--green  { color: var(--green-light); }

/* ─── Dashboard grid ─────────────────────────────────────────────────────── */

.dashboard {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: var(--gap);
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    border: 3px solid var(--green-light);
    border-radius: 18px;
    padding: var(--gap);
    background: var(--green-dark);
}

/* ─── Top bar ────────────────────────────────────────────────────────────── */

.top-bar {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--gap);
    align-items: stretch;
}

.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand-name {
    font-size: 1.45rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--green-light);
}

.brand-icon {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 1px dashed var(--green-light);
}

.annual-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0;
    padding-top: 0.5rem;
}

.stat-segment {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--green-light);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 900;
    color: var(--white);
}

.stat-value .unit {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    margin-left: 2px;
}

/* ─── Main two-column layout ─────────────────────────────────────────────── */

.main-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    min-height: 0;
}

/* ─── Left panel ─────────────────────────────────────────────────────────── */

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 2rem;
}

.left-inner {
    display: grid;
    grid-template-columns: 185px 1fr;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
}

/* Daily stats – narrow left column */

.daily-stats {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 4px solid var(--green-dark);
    padding-right: 0.75rem;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-item + .stat-item {
    border-top: 4px solid var(--green-dark);
}

.stat-item-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--green-light);
    margin-bottom: 0.3rem;
}

.stat-item-value {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--white);
}

.stat-item-value .unit {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

/* Consumption breakdown – wide right column */

.consumption-panel {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 0;
}

.panel-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--green-light);
    text-align: center;
    margin-bottom: 0.15rem;
}

.consumption-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

.loading-hint {
    color: var(--white);
    font-size: 0.85rem;
    text-align: center;
    padding-top: 1rem;
}

.consumption-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 16px;
    column-gap: 0.5rem;
    row-gap: 0.35rem;
    align-items: center;
}

.consumption-name {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    grid-column: 1;
    grid-row: 1;
    color: var(--white);
}

.consumption-value {
    font-size: 1.5rem;
    font-weight: 900;
    white-space: nowrap;
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    color: var(--white);
}

.consumption-value .unit {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
}

.bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 25px;
    background: var(--green-dark);
    border-radius: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--green-light);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* Bar legend */

.bar-legend {
    display: flex;
    gap: 0.75rem;
    font-size: 0.58rem;
    color: var(--white);
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-item::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 8px;
    border-radius: 4px;
}

.legend-supply::before { background: var(--green-light); }
.legend-grid::before   { background: var(--green-dark); border: 2px solid var(--green-light); }

/* ─── Right panel ────────────────────────────────────────────────────────── */

.right-panel {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

/* Chart card */

.chart-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    padding-top: 2rem;
}

.chart-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green-light);
}

/* Ecological effect card */

.eco-card {
    flex-shrink: 0;
    padding-top: 2rem;
}

.eco-headline {
    font-size: 1rem;
    font-weight: 900;
    color: var(--green-light);
    text-align: center;
    margin: 0.35rem 0 0.65rem;
    text-transform: uppercase;
}

.eco-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.eco-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.eco-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 1px dashed var(--green-light);
    flex-shrink: 0;
}

.eco-text {
    font-size: 0.68rem;
    color: var(--white);
}

.eco-text small {
    font-size: 0.58rem;
    color: var(--white);
}

/* ─── Status bar ─────────────────────────────────────────────────────────── */

.status-bar {
    font-size: 0.65rem;
    color: var(--white);
    text-align: right;
    padding: 0.25rem 0.5rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .top-bar { grid-template-columns: 1fr; }

    .annual-stats { grid-template-columns: 1fr; }

    .main-area { grid-template-columns: 1fr; }

    .left-inner { grid-template-columns: 1fr; }

    .daily-stats {
        border-right: none;
        border-bottom: 4px solid var(--green-dark);
        padding-right: 0;
        padding-bottom: 0.75rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

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