/*
 * Smart electricity battery history modal (scoped)
 * Applies only when the modal contains `table.smart-electricity-battery-grid`.
 */

.modal:has(table.smart-electricity-battery-grid) {
    --sebm-border: #d8def4;
    --sebm-border-strong: #b7c2ec;
    --sebm-bg: #f5f7ff;
    --sebm-surface: #ffffff;
    --sebm-title: #25325f;
    --sebm-text: #26314f;
    --sebm-muted: #7580a5;
    --sebm-accent: #4f46e5;
    --sebm-accent-dark: #3730a3;
    --sebm-cyan: #06b6d4;
    --sebm-gold: #f2b84b;
    --sebm-shadow: 0 18px 42px rgba(48, 61, 128, 0.16);
}

.modal:has(table.smart-electricity-battery-grid) .modal-dialog {
    width: min(92vw, 900px);
    max-width: 900px;
    margin: 5vh auto;
}

.modal:has(table.smart-electricity-battery-grid) .modal-content {
    position: relative;
    border: 1px solid var(--sebm-border);
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 0%, rgba(6, 182, 212, 0.12), transparent 30%),
        radial-gradient(circle at 95% 8%, rgba(242, 184, 75, 0.16), transparent 30%),
        linear-gradient(180deg, var(--sebm-bg) 0%, #ffffff 64%);
    box-shadow: var(--sebm-shadow);
}

.modal:has(table.smart-electricity-battery-grid) .modal-content::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--sebm-accent-dark), var(--sebm-accent) 48%, var(--sebm-cyan) 74%, var(--sebm-gold));
}

.modal:has(table.smart-electricity-battery-grid) .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(216, 222, 244, 0.9);
    background:
        linear-gradient(120deg, rgba(79, 70, 229, 0.11), rgba(255, 255, 255, 0.9) 50%, rgba(6, 182, 212, 0.08));
}

.modal:has(table.smart-electricity-battery-grid) .modal-title {
    display: flex;
    align-items: center;
    min-height: 34px;
    margin: 0;
    color: var(--sebm-title);
    font-size: 23px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.modal:has(table.smart-electricity-battery-grid) .modal-title::after {
    content: none;
}

.modal:has(table.smart-electricity-battery-grid) .modal-header .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid #c4ccee;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #66709a;
    opacity: 1;
    text-shadow: none;
    box-shadow: 0 10px 22px rgba(47, 55, 120, 0.08);
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.modal:has(table.smart-electricity-battery-grid) .modal-header .close:hover {
    border-color: #aab7ec;
    background: #ffffff;
    color: var(--sebm-accent-dark);
    transform: rotate(90deg) scale(1.03);
}

.modal:has(table.smart-electricity-battery-grid) .modal-body {
    max-height: 78vh;
    padding: 16px 18px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(79, 70, 229, 0.26) transparent;
}

.modal:has(table.smart-electricity-battery-grid) .modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal:has(table.smart-electricity-battery-grid) .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal:has(table.smart-electricity-battery-grid) .modal-body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.24);
}

.modal:has(table.smart-electricity-battery-grid) .grid-box,
.modal:has(table.smart-electricity-battery-grid) .grid-box .box-body {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: hidden;
}

.modal:has(table.smart-electricity-battery-grid) .grid-box .table-wrapper {
    position: relative;
    border: 1px solid var(--sebm-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 14px 28px rgba(46, 60, 122, 0.07);
    overflow: hidden;
    transform-origin: center;
    will-change: transform, opacity;
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px !important;
    padding: 3px;
    border: 1px solid #c5cfef;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 10px 20px rgba(55, 66, 140, 0.08);
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 13px;
    border: 0 !important;
    border-radius: 999px !important;
    background:
        linear-gradient(180deg, #ffffff 0%, #f2f5ff 100%) !important;
    color: #445083 !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    text-shadow: none;
    box-shadow: none !important;
    overflow: hidden;
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.52), transparent);
    transform: translateX(-120%);
    transition: transform 0.42s ease;
    pointer-events: none;
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn:hover,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn:focus-visible {
    background: linear-gradient(180deg, #f9fbff 0%, #eaf0ff 100%) !important;
    color: var(--sebm-accent-dark) !important;
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.12) !important;
    transform: translateY(-1px);
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn:hover::after,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn:focus-visible::after {
    transform: translateX(120%);
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn:active,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group.show .btn:first-child,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group.sebm-filter-open .btn:first-child {
    background: linear-gradient(180deg, #6366f1 0%, var(--sebm-accent) 100%) !important;
    color: #ffffff !important;
    transform: translateY(0);
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn i,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn svg,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn .feather {
    position: relative;
    z-index: 1;
    width: 13px;
    height: 13px;
    margin: 0 !important;
}

.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn span,
.modal:has(table.smart-electricity-battery-grid) .filter-button-group .btn .filter-count {
    position: relative;
    z-index: 1;
}

.modal:has(table.smart-electricity-battery-grid) .filter-box,
.modal:has(table.smart-electricity-battery-grid) .box-filter,
.modal:has(table.smart-electricity-battery-grid) .grid-filter {
    position: relative;
    display: flex !important;
    align-items: center !important;
    min-height: 72px;
    margin: 0 0 14px !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(191, 201, 238, 0.96) !important;
    border-radius: 18px !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(246, 249, 255, 0.74)),
        #ffffff !important;
    box-shadow: 0 14px 28px rgba(50, 65, 135, 0.07) !important;
    overflow: hidden;
    transform-origin: top center;
}

.modal:has(table.smart-electricity-battery-grid) .filter-box.d-none,
.modal:has(table.smart-electricity-battery-grid) .box-filter.d-none,
.modal:has(table.smart-electricity-battery-grid) .grid-filter.d-none {
    display: none !important;
}

.modal:has(table.smart-electricity-battery-grid) .filter-box.sebm-filter-enter,
.modal:has(table.smart-electricity-battery-grid) .box-filter.sebm-filter-enter,
.modal:has(table.smart-electricity-battery-grid) .grid-filter.sebm-filter-enter {
    min-height: 0 !important;
    animation: sebmFilterPanelEnter 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal:has(table.smart-electricity-battery-grid) .filter-box.sebm-filter-leave,
.modal:has(table.smart-electricity-battery-grid) .box-filter.sebm-filter-leave,
.modal:has(table.smart-electricity-battery-grid) .grid-filter.sebm-filter-leave {
    min-height: 0 !important;
    pointer-events: none;
    animation: sebmFilterPanelLeave 0.26s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes sebmFilterPanelEnter {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-8px) scaleY(0.96);
        filter: blur(1px);
    }
    to {
        max-height: var(--sebm-filter-height, 120px);
        opacity: 1;
        transform: translateY(0) scaleY(1);
        filter: blur(0);
    }
}

@keyframes sebmFilterPanelLeave {
    from {
        max-height: var(--sebm-filter-height, 120px);
        opacity: 1;
        transform: translateY(0) scaleY(1);
        filter: blur(0);
    }
    to {
        max-height: 0;
        opacity: 0;
        transform: translateY(-8px) scaleY(0.96);
        filter: blur(1px);
    }
}

.modal:has(table.smart-electricity-battery-grid) .filter-box::before,
.modal:has(table.smart-electricity-battery-grid) .box-filter::before,
.modal:has(table.smart-electricity-battery-grid) .grid-filter::before {
    content: none;
}

.modal:has(table.smart-electricity-battery-grid) .filter-box .card-body,
.modal:has(table.smart-electricity-battery-grid) .box-filter .card-body,
.modal:has(table.smart-electricity-battery-grid) .grid-filter .card-body {
    display: flex !important;
    align-items: center !important;
    min-height: 50px;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form {
    width: 100%;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap;
    gap: 0;
    min-height: 40px;
    margin: 0 !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .row::before,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .row::after {
    content: none !important;
    display: none !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .filter-input[class*="col-sm-"] {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 520px;
    width: auto;
    max-width: none;
    height: 40px;
    margin: 0 !important;
    padding: 0;
    float: none !important;
    align-self: center !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .form-group {
    display: flex;
    align-items: center;
    margin: 0 !important;
    min-height: 42px;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .input-group.input-group-sm {
    display: flex;
    align-items: center;
    height: 40px;
    min-height: 40px;
    border: 1px solid #c5cfef;
    border-radius: 999px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .input-group-prepend .input-group-text,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .input-group-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-height: 40px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: 0 !important;
    background: #eef3ff !important;
    color: #445083 !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1 !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .input-group > .form-control {
    height: 40px;
    min-height: 40px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: 0 !important;
    background: #ffffff !important;
    color: var(--sebm-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 40px !important;
    box-shadow: none !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .input-group > .form-control:focus {
    background: #fbfcff !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .row > .btn-group,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group.default,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group.btn-group-sm.default.btn-mini {
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    float: none !important;
    align-self: center !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .filter-input + .btn-group {
    margin-left: 34px !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group + .btn-group {
    margin-left: 12px !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn.submit {
    margin-right: 0 !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn.reset {
    margin-left: 12px !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group::before,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group::after {
    content: none !important;
    display: none !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn {
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    height: 38px;
    min-height: 38px;
    padding: 0 16px;
    margin: 0 !important;
    border-radius: 999px !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    box-sizing: border-box;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn i,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn svg,
.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn .feather {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    margin: 0 !important;
    vertical-align: middle;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn.submit {
    border: 1px solid var(--sebm-accent) !important;
    background: linear-gradient(180deg, #6366f1 0%, var(--sebm-accent) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.2);
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn.reset {
    border: 1px solid #c5cfef !important;
    background: #ffffff !important;
    color: #445083 !important;
}

.modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(49, 61, 132, 0.13);
}

table.smart-electricity-battery-grid {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    background: transparent;
}

table.smart-electricity-battery-grid > thead > tr > th {
    padding: 9px 14px 7px !important;
    border: 0 !important;
    background: #edf1ff !important;
    color: #445083 !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
}

table.smart-electricity-battery-grid > thead > tr > th.sebm-col-id,
table.smart-electricity-battery-grid > tbody > tr > td.sebm-col-id {
    width: 15%;
    text-align: center !important;
}

table.smart-electricity-battery-grid > thead > tr > th.sebm-col-time,
table.smart-electricity-battery-grid > tbody > tr > td.sebm-col-time {
    width: 45%;
    text-align: center !important;
}

table.smart-electricity-battery-grid > thead > tr > th.sebm-col-electricity,
table.smart-electricity-battery-grid > tbody > tr > td.sebm-col-electricity {
    width: 40%;
    text-align: center !important;
}

table.smart-electricity-battery-grid > tbody > tr {
    transition: transform 0.18s ease;
}

table.smart-electricity-battery-grid > tbody > tr > td {
    min-height: 62px;
    padding: 13px 14px !important;
    vertical-align: middle !important;
    border-top: 1px solid #dfe5f7 !important;
    border-bottom: 1px solid #dfe5f7 !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.08), transparent 30%),
        rgba(255, 255, 255, 0.96) !important;
    color: var(--sebm-text);
}

table.smart-electricity-battery-grid > tbody > tr > td:first-child {
    border-left: 1px solid #dfe5f7 !important;
    border-radius: 16px 0 0 16px;
}

table.smart-electricity-battery-grid > tbody > tr > td:last-child {
    border-right: 1px solid #dfe5f7 !important;
    border-radius: 0 16px 16px 0;
}

table.smart-electricity-battery-grid > tbody > tr:hover {
    transform: translateY(-1px);
}

table.smart-electricity-battery-grid > tbody > tr:hover > td {
    border-color: var(--sebm-border-strong) !important;
    background:
        radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.12), transparent 34%),
        #ffffff !important;
    box-shadow: 0 14px 28px rgba(50, 65, 135, 0.08);
}

table.smart-electricity-battery-grid > tbody > tr > td.sebm-col-id {
    color: var(--sebm-accent-dark);
    font-size: 18px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.sebm-time,
.sebm-energy,
.sebm-reset,
.sebm-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.sebm-time {
    min-height: 34px;
    min-width: 184px;
    padding: 0 16px;
    border: 1px solid #cbd5f2;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6ff 100%);
    color: #34406f;
    font-size: 13px;
    font-weight: 850;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sebm-energy {
    position: relative;
    min-height: 42px;
    min-width: 132px;
    gap: 5px;
    padding: 0 18px;
    border: 1px solid #b9c5f2;
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(6, 182, 212, 0.12)),
        #ffffff;
    color: var(--sebm-title);
    box-shadow:
        0 12px 24px rgba(55, 48, 163, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.sebm-energy::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.45) 42%, transparent 64%);
    transform: translateX(-120%);
    transition: transform 0.55s ease;
}

table.smart-electricity-battery-grid > tbody > tr:hover .sebm-energy::before {
    transform: translateX(120%);
}

.sebm-energy strong,
.sebm-energy em {
    position: relative;
    z-index: 1;
}

.sebm-energy strong {
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
}

.sebm-energy em {
    color: var(--sebm-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 850;
    line-height: 1;
}

.sebm-reset {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid #efd7a0;
    background: #fff8e8;
    color: #9a6415;
    font-size: 13px;
    font-weight: 900;
}

.sebm-empty {
    min-height: 30px;
    min-width: 56px;
    border: 1px solid #d8def4;
    background: #f7f8fe;
    color: #8b94b8;
    font-size: 13px;
    font-weight: 800;
}

.modal:has(table.smart-electricity-battery-grid) .grid-footer,
.modal:has(table.smart-electricity-battery-grid) .box-footer {
    border: 0;
    background: transparent;
    transform-origin: center;
    will-change: transform, opacity;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-leave-next {
    animation: sebmBatteryPageLeaveNext 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-leave-prev {
    animation: sebmBatteryPageLeavePrev 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next {
    animation: sebmBatteryPageEnterNext 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev {
    animation: sebmBatteryPageEnterPrev 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal.sebm-page-changing .table-wrapper:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev),
.modal.sebm-page-changing .grid-footer:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev),
.modal.sebm-page-changing .box-footer:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev) {
    opacity: 0;
    pointer-events: none;
    filter: blur(1.5px);
}

.modal.sebm-page-changing.sebm-page-direction-next .table-wrapper:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev),
.modal.sebm-page-changing.sebm-page-direction-next .grid-footer:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev),
.modal.sebm-page-changing.sebm-page-direction-next .box-footer:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev) {
    transform: translateX(42px) scale(0.985);
}

.modal.sebm-page-changing.sebm-page-direction-prev .table-wrapper:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev),
.modal.sebm-page-changing.sebm-page-direction-prev .grid-footer:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev),
.modal.sebm-page-changing.sebm-page-direction-prev .box-footer:not(.sebm-page-leave-next):not(.sebm-page-leave-prev):not(.sebm-page-enter-next):not(.sebm-page-enter-prev) {
    transform: translateX(-42px) scale(0.985);
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next table.smart-electricity-battery-grid > tbody > tr,
.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev table.smart-electricity-battery-grid > tbody > tr {
    animation: sebmBatteryRowFadeIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next table.smart-electricity-battery-grid > tbody > tr:nth-child(2),
.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev table.smart-electricity-battery-grid > tbody > tr:nth-child(2) {
    animation-delay: 0.03s;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next table.smart-electricity-battery-grid > tbody > tr:nth-child(3),
.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev table.smart-electricity-battery-grid > tbody > tr:nth-child(3) {
    animation-delay: 0.06s;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next table.smart-electricity-battery-grid > tbody > tr:nth-child(4),
.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev table.smart-electricity-battery-grid > tbody > tr:nth-child(4) {
    animation-delay: 0.09s;
}

.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next table.smart-electricity-battery-grid > tbody > tr:nth-child(n + 5),
.modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev table.smart-electricity-battery-grid > tbody > tr:nth-child(n + 5) {
    animation-delay: 0.12s;
}

@keyframes sebmBatteryPageLeaveNext {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateX(-34px) scale(0.985);
        filter: blur(1.5px);
    }
}

@keyframes sebmBatteryPageLeavePrev {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateX(34px) scale(0.985);
        filter: blur(1.5px);
    }
}

@keyframes sebmBatteryPageEnterNext {
    from {
        opacity: 0;
        transform: translateX(42px) scale(0.985);
        filter: blur(1.5px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes sebmBatteryPageEnterPrev {
    from {
        opacity: 0;
        transform: translateX(-42px) scale(0.985);
        filter: blur(1.5px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes sebmBatteryRowFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal:has(table.smart-electricity-battery-grid) .sebm-page-leave-next,
    .modal:has(table.smart-electricity-battery-grid) .sebm-page-leave-prev,
    .modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next,
    .modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev,
    .modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-next table.smart-electricity-battery-grid > tbody > tr,
    .modal:has(table.smart-electricity-battery-grid) .sebm-page-enter-prev table.smart-electricity-battery-grid > tbody > tr {
        animation: none !important;
    }
}

.modal:has(table.smart-electricity-battery-grid) .pagination {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid #d8def4;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 20px rgba(55, 66, 140, 0.08);
}

.modal:has(table.smart-electricity-battery-grid) .pagination .page-link,
.modal:has(table.smart-electricity-battery-grid) .pagination .page-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #536096;
    font-size: 13px;
    font-weight: 850;
    line-height: 1;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.modal:has(table.smart-electricity-battery-grid) .pagination .page-link:hover {
    background: #f0f4ff;
    color: var(--sebm-accent-dark);
    transform: translateY(-1px);
}

.modal:has(table.smart-electricity-battery-grid) .pagination .page-item.active .page-link,
.modal:has(table.smart-electricity-battery-grid) .pagination .active span {
    background: linear-gradient(180deg, #6366f1 0%, var(--sebm-accent) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.22);
}

@media (max-width: 720px) {
    .modal:has(table.smart-electricity-battery-grid) .modal-dialog {
        width: 94vw;
        max-width: 94vw;
        margin: 3vh auto;
    }

    .modal:has(table.smart-electricity-battery-grid) .grid-filter-form .row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modal:has(table.smart-electricity-battery-grid) .grid-filter-form .btn-group {
        justify-content: flex-start;
        margin-left: 0;
    }

    .sebm-time {
        min-width: 0;
        width: 100%;
        padding: 0 10px;
        white-space: normal;
    }
}
