﻿/* ═══ CONVERTED TO LIGHT WARM THEME + 1.2x FONTS ═══ */
:root {
    --bg0: #f4f1ec;
    --bg1: #f4f1ec;
    --card: #fff;
    --card2: #fffefa;
    --line: #ebe8e2;
    --text: #2d2d42;
    --muted: #9e9eb0;
    --blue: #b8892e;
    --cyan: #0284c7;
    --green: #0d9668;
    --amber: #d97706;
    --rose: #e11d48;
    --r16: 16px;
    --r20: 20px;
    --shadow: 0 1px 4px rgba(0,0,0,.04);
}

* {
    box-sizing: border-box
}

body {
    background: var(--ez-bg, var(--bg1));   /* (2) nen trang - cau hinh giao dien; file nay link SAU platform.css nen no thang rule html,body o do */
    color: #2d2d42;
}

.ems-shell {
    min-height: 100vh;
    background: var(--ez-bg, #fffefa);   /* ② Nền trang — cấu hình giao diện; fallback = màu hôm nay */
    padding: 18px 22px;
    font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
}

.card {
    border: 1px solid #ebe8e2;
    border-radius: var(--r20);
    background: #fff;
    box-shadow: var(--shadow);
}

.muted {
    color: #9e9eb0
}

.small {
    font-size: 14.4px
}

.hline {
    height: 1px;
    background: #f9f7f3;
    margin: 10px 0
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid #ebe8e2;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .3px;
}

    .brand .logo {
        width: 34px;
        height: 34px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f9f7f3;
        border: 1px solid #ebe8e2;
    }

    .brand .name {
        opacity: .95
    }

.navlinks {
    display: flex;
    gap: 16px;
    align-items: center
}

.navlink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #6b6b80;
    text-decoration: none;
    border: 1px solid transparent;
}

    .navlink.active {
        color: #2d2d42;
        background: rgba(184,137,46,.1);
        border-color: rgba(184,137,46,.1);
    }

    .navlink:hover {
        background: #f4f1ec;
        border-color: #ebe8e2;
    }

.nav-right {
    display: flex;
    gap: 10px;
    align-items: center
}

.input {
    width: 260px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #e0ddd6;
    background: #f9f7f3;
    color: #2d2d42;
    outline: none;
    font-size: 14px;
}

    .input:focus {
        border-color: #b8892e;
        background: #fff;
    }

    .input::placeholder {
        color: #c5c5d0;
    }

.btn {
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid #ebe8e2;
    background: #f9f7f3;
    color: #2d2d42;
    cursor: pointer;
    transition: transform .06s ease, background .2s ease, opacity .2s ease;
}

    .btn:hover {
        background: #ebe8e2;
    }

    .btn:active {
        transform: translateY(1px);
    }

    .btn.primary {
        background: #b8892e;
        border-color: #b8892e;
        color: #fff;
    }

        .btn.primary:hover {
            background: #a07828;
        }

    .btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.headerline {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.h-title {
    font-size: 31.2px;
    font-weight: 900;
    letter-spacing: .2px;
}

    .h-title .dot {
        opacity: .45;
        margin: 0 10px
    }

    .h-title .site {
        color: #1a1a2e
    }

.h-right {
    color: #9e9eb0
}

/* ===== KPI ===== */
.kpi-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 14px;
}

.kpi {
    padding: 18px;
    border-radius: var(--r20);
    position: relative;
    overflow: hidden;
}

    .kpi::before {
        content: "";
        position: absolute;
        inset: -1px;
        background: #fffefa;
        pointer-events: none;
    }

.kpi-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.kpi-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ebe8e2;
    background: #f9f7f3;
    box-shadow: inset 0 0 0 1px #ebe8e2;
    font-size: 21.6px;
}

.kpi-value {
    font-size: 40.8px;
    font-weight: 950;
    letter-spacing: .2px;
    color: #1a1a2e;
    line-height: 1;
}

.kpi-unit {
    font-size: 16.8px;
    color: #9e9eb0;
    margin-left: 8px;
    font-weight: 700;
}

.kpi-title {
    margin-top: 8px;
    font-size: 15.6px;
    color: #6b6b80;
}

.kpi-sub {
    margin-top: 6px;
    font-size: 14.4px;
    color: #9e9eb0;
}

/* ===== PANELS ===== */
.grid-2 {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 14px;
}

.block {
    padding: 16px;
    border-radius: var(--r20);
}

.block-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.block-title {
    font-size: 21.6px;
    font-weight: 900;
}
/* meters as cards */
.meter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}

.meter-card {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid #ebe8e2;
    background: #f4f1ec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meter-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.meter-avatar {
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34,211,238,.12);
    border: 1px solid rgba(34,211,238,.22);
    color: #2d2d42;
    font-weight: 900;
}

.meter-info {
    min-width: 0
}

.meter-code {
    font-weight: 950;
    letter-spacing: .2px;
    font-size: 19.2px
}

.meter-loc {
    margin-top: 2px;
    font-size: 14.4px;
    color: #9e9eb0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meter-right {
    text-align: right;
    white-space: nowrap
}

.meter-power {
    font-weight: 950;
    font-size: 19.2px
}

.meter-sub {
    margin-top: 3px;
    font-size: 14.4px;
    color: #9e9eb0
}

/* top meters bar big */
.top-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px
}

.top-row {
    display: grid;
    grid-template-columns: 70px 1fr 120px 64px;
    align-items: center;
    gap: 12px;
}

.top-code {
    font-weight: 900
}

.top-bar {
    height: 14px;
    border-radius: 999px;
    background: #f4f1ec;
    border: 1px solid #ebe8e2;
    overflow: hidden;
}

.top-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(184,137,46,.1), rgba(34,211,238,.80), rgba(52,211,153,.75));
}

.top-val {
    font-size: 14.4px;
    color: #9e9eb0;
    text-align: right
}

.top-pct {
    font-size: 14.4px;
    font-weight: 900;
    text-align: right
}

/* Trend: bars nicer */
.trend {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    height: 220px;
    padding: 16px 8px 6px;
}

.bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.bar-fill {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(184,137,46,.1);
    background: linear-gradient(180deg, rgba(184,137,46,.1), rgba(184,137,46,.1));
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    min-height: 6px;
}

.bar-label {
    font-size: 13.2px;
    color: #9e9eb0
}

.bar-val {
    font-size: 13.2px;
    color: #6b6b80;
    font-weight: 800
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

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

@media (max-width: 720px) {
    .navlinks {
        display: none
    }

    .input {
        width: 180px
    }

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

@media (max-width: 520px) {
    .navbar {
        flex-direction: column;
        align-items: stretch
    }

    .nav-right {
        justify-content: space-between
    }

    .input {
        width: 100%
    }

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

    .top-row {
        grid-template-columns: 60px 1fr 90px 54px;
    }
}
/* ===== Contrast boost (override) ===== */
.card, .navbar {
    color: #2d2d42;
}

.block-title, .meter-code, .top-code {
    color: #2d2d42;
}

.meter-loc, .meter-sub, .top-val, .muted, .small, .bar-label {
    color: #6b6b80 !important;
}

.kpi-title {
    color: #4a4a5e !important;
}

.kpi-sub {
    color: #9e9eb0 !important;
}

.top-pct {
    color: #2d2d42;
}

.top-bar {
    background: #f9f7f3;
}

.meter-card {
    background: #f4f1ec;
}

/* ===== Top consumption (big bars) ===== */
.topcons-title {
    font-size: 15.6px;
    color: #6b6b80;
    margin-top: -6px;
    margin-bottom: 10px;
}

.bigbar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.bigbar-row {
    display: grid;
    grid-template-columns: 70px 1fr 120px;
    gap: 12px;
    align-items: center;
}

.bigbar-code {
    font-weight: 900;
    color: #2d2d42;
}

.bigbar-track {
    height: 18px;
    border-radius: 999px;
    border: 1px solid #ebe8e2;
    background: #f4f1ec;
    overflow: hidden;
}

.bigbar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(251,191,36,.90), rgba(34,211,238,.80), rgba(52,211,153,.75));
}

.bigbar-val {
    text-align: right;
    font-size: 14.4px;
    color: #6b6b80;
}

/* ===== Table ===== */
.grid-2b {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1.35fr .65fr;
    gap: 14px;
}

/* ====== TABLE BLOCK (Danh Sách Công Tơ) ====== */

.table-wrap {
    border-radius: 18px;
    padding: 16px 16px 14px;
    position: relative;
    overflow: hidden;
    /* dark glass */
    background: #fffefa;
    border: 1px solid #ebe8e2;
    box-shadow: 0 20px 60px rgba(0,0,0,.06), inset 0 1px 0 #f9f7f3;
}

    /* subtle top glow */
    .table-wrap::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: 18px;
        background: #fffefa;
        pointer-events: none;
        opacity: 0.9;
    }

.table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

    .table-head .block-title {
        color: #2d2d42;
        font-weight: 800;
        letter-spacing: 0.2px;
    }

    /* Search & Sort controls inside table head */
    .table-head .input {
        height: 38px;
        padding: 0 12px;
        border-radius: 12px;
        background: #f4f1ec;
        border: 1px solid #e0ddd6;
        color: #2d2d42;
        outline: none;
    }

        .table-head .input::placeholder {
            color: #c5c5d0;
        }

    .table-head .btn {
        height: 38px;
        padding: 0 12px;
        border-radius: 12px;
        background: #f4f1ec;
        border: 1px solid #e0ddd6;
        color: #4a4a5e;
    }

        .table-head .btn:hover {
            background: #f0ede6;
            border-color: #e0ddd6;
        }

/* table base */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    position: relative;
    z-index: 1;
    /* IMPORTANT: remove white backgrounds */
    background: transparent !important;
}

    .table thead th {
        padding: 12px 12px;
        font-size: 14.4px;
        font-weight: 800;
        text-transform: none;
        letter-spacing: 0.3px;
        color: #6b6b80;
        background: #f9f7f3;
        border-bottom: 1px solid #e0ddd6;
    }

        .table thead th:first-child {
            border-top-left-radius: 12px;
        }

        .table thead th:last-child {
            border-top-right-radius: 12px;
        }

    .table tbody td {
        padding: 12px 12px;
        font-size: 15.6px;
        color: #4a4a5e;
        border-bottom: 1px solid #ebe8e2;
        background: transparent;
    }

    .table tbody tr:hover td {
        background: #f9f7f3;
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

        .table tbody tr:last-child td:first-child {
            border-bottom-left-radius: 12px;
        }

        .table tbody tr:last-child td:last-child {
            border-bottom-right-radius: 12px;
        }

/* clickable sort header button */
.th-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: #6b6b80;
    font-weight: 800;
}

    .th-btn:hover {
        color: #2d2d42;
    }

/* muted text inside table */
.table-wrap .muted {
    color: #c5c5d0;
}

.table-wrap .small {
    font-size: 14.4px;
}

/* divider */
.table-wrap .hline {
    height: 1px;
    background: #ebe8e2;
    margin: 12px 0;
}

/* footer button "Xem thêm" */
.table-wrap .btn {
    box-shadow: inset 0 1px 0 #f9f7f3;
}


.pill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(184,137,46,.1);
    background: rgba(184,137,46,.1);
    color: #2d2d42;
    font-size: 14.4px;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .grid-2b {
        grid-template-columns: 1fr;
    }
}
