:root {
    --ec-navy: #0c1f3f;
    --ec-navy-soft: #16315f;
    --ec-cyan: #1ed6d6;
    --ec-cyan-soft: #c9f6ff;
    --ec-green: #b7f04a;
    --ec-bg: #f3f7fc;
    --ec-text: #1c2b45;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ec-text);
    background: linear-gradient(160deg, #eef5ff 0%, #f9fcff 35%, #effdfb 100%);
}

.admin-body {
    min-height: 100vh;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--ec-navy) 0%, #0a1732 100%);
    color: #fff;
    padding: 1.2rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ec-green);
    margin-bottom: 1.4rem;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.65rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(168, 191, 228, 0.2);
}

.sidebar-group-title {
    margin: 0;
    padding: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9eb7db;
    font-weight: 700;
}

.sidebar-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    border-radius: 0.55rem;
    padding: 0.45rem 0.55rem;
    background: rgba(255, 255, 255, 0.04);
    color: #9eb7db;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-dropdown-toggle:hover {
    background: rgba(30, 214, 214, 0.12);
    color: #dff5ff;
}

.sidebar-dropdown-toggle .sidebar-group-title {
    color: inherit;
}

.sidebar-chevron {
    font-size: 0.72rem;
    transition: transform 0.2s ease;
}

.sidebar-dropdown-toggle.collapsed .sidebar-chevron {
    transform: rotate(-90deg);
}

.sidebar-submenu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    border: 0;
    text-decoration: none;
    border-radius: 0.55rem;
    color: #d8e8ff;
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
    background: transparent;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background-color: rgba(30, 214, 214, 0.16);
}

.sidebar-link i {
    color: var(--ec-cyan);
}

.sidebar-link-child {
    margin-left: 0.7rem;
    width: calc(100% - 0.7rem);
    font-size: 0.9rem;
    opacity: 0.92;
}

.sidebar-logout {
    cursor: pointer;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e4ecf8;
    padding: 1rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.topbar-title {
    font-size: 1.05rem;
    margin: 0;
    color: var(--ec-navy);
}

.topbar-subtitle {
    font-size: 0.85rem;
    color: #5f7295;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    background: var(--ec-cyan-soft);
    color: var(--ec-navy);
    font-weight: 600;
}

.content-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ec-navy);
}

.btn-energy {
    background: linear-gradient(135deg, var(--ec-cyan) 0%, #0cb5da 100%);
    border: 0;
    color: #043346;
    font-weight: 600;
}

.btn-energy:hover {
    background: linear-gradient(135deg, #14c2c2 0%, #09a4cb 100%);
    color: #03293a;
}

.footer-bar {
    margin-top: auto;
    padding: 0.8rem 1.4rem;
    border-top: 1px solid #dde7f5;
    background: #fff;
    color: #61739a;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.stats-card {
    background: linear-gradient(145deg, var(--ec-navy-soft) 0%, #0f2446 100%);
    border-radius: 0.85rem;
    color: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 108px;
    box-shadow: 0 7px 16px rgba(8, 28, 60, 0.15);
}

.stats-label {
    color: #a5bbdf;
    font-size: 0.86rem;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stats-card i {
    font-size: 1.6rem;
    color: var(--ec-green);
}

.chart-placeholder {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.6rem;
    border: 2px dashed #bdd3f1;
    background: #f8fbff;
    color: #6381ad;
}

.chart-placeholder i {
    font-size: 2rem;
    color: var(--ec-cyan);
}

.modal-content {
    border: 0;
    box-shadow: 0 12px 35px rgba(8, 34, 74, 0.2);
}

.crud-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.crud-modal-form .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.crud-modal-form .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    z-index: 2;
}

.table th {
    white-space: nowrap;
}

.dt-layout-row {
    margin: 0.5rem 0;
}

.crud-table-card {
    border-radius: 1rem;
    overflow: hidden;
}

.crud-table-card .card-body {
    padding: 1rem 1rem 0.75rem;
}

.ec-table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #f6faff;
    --bs-table-hover-bg: #eaf6ff;
    margin-bottom: 0.25rem;
}

.ec-table thead th {
    background: #f3f8ff;
    color: #3f5f93;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #dbe8fb;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.ec-table tbody td {
    border-color: #e6eefb;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    color: #23385f;
    vertical-align: middle;
}

.ec-table .btn-outline-primary,
.ec-table .btn-outline-danger {
    border-width: 1px;
}

.dt-layout-cell {
    padding: 0.2rem 0;
}

.dt-input,
.dt-length select {
    border: 1px solid #c9daf5 !important;
    border-radius: 0.55rem !important;
    min-height: 2.2rem;
    padding-inline: 0.65rem;
    background: #fff;
}

.dt-search label,
.dt-length label {
    font-size: 0.85rem;
    color: #506991;
}

.dt-info {
    font-size: 0.82rem;
    color: #607aa2;
}

.dt-paging .pagination {
    gap: 0.2rem;
}

.dt-paging .page-link {
    border-radius: 0.45rem !important;
    border-color: #d0def5;
    color: #21406f;
}

.dt-paging .page-item.active .page-link {
    background: var(--ec-navy);
    border-color: var(--ec-navy);
}

.dtr-control:before {
    background: var(--ec-navy) !important;
    border: 0 !important;
    box-shadow: none !important;
}

.dtr-details {
    width: 100%;
}

.dtr-details li {
    border-bottom-color: #e6eefb !important;
}

.invalid-feedback {
    min-height: 1rem;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f1f6ff;
    border-color: #d7e5fb;
    color: #2e4f82;
}

.multi-checkbox-scroll {
    max-height: 220px;
    overflow-y: auto;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 20%, #e0fbff 0%, #eef4ff 38%, #edf2ff 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 15px 34px rgba(12, 31, 63, 0.18);
}

.login-logo {
    margin-inline: auto;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ec-cyan) 0%, var(--ec-green) 100%);
    color: #063a56;
    font-size: 1.7rem;
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .app-shell {
        flex-direction: column;
    }

    .crud-modal-form .modal-body {
        max-height: 62vh;
    }

    .dt-layout-row {
        margin: 0.3rem 0;
        row-gap: 0.45rem;
    }

    .dt-layout-table .dt-layout-cell {
        width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .crud-table-card .card-body {
        padding: 0.75rem 0.55rem;
    }

    .ec-table thead th {
        font-size: 0.72rem;
    }

    .ec-table tbody td {
        font-size: 0.83rem;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .dtr-details {
        font-size: 0.84rem;
    }

    .dt-search,
    .dt-length {
        width: 100%;
    }

    .dt-search input,
    .dt-length select {
        width: 100%;
    }
}
