/*
 * Sleep radar comprehensive report modal (scoped)
 * Applies only when the modal contains `table.sleep-comprehensive-report-grid`.
 */

.modal:has(table.sleep-comprehensive-report-grid) {
    --scr-border: #cfe7e3;
    --scr-border-strong: #9dcfc7;
    --scr-bg: #f5fbfa;
    --scr-surface: #ffffff;
    --scr-title: #123f3b;
    --scr-text: #193f3b;
    --scr-muted: #71938f;
    --scr-accent: #0d9488;
    --scr-accent-dark: #08756d;
    --scr-gold: #d5a45c;
    --scr-blue: #5267d9;
    --scr-shadow: 0 18px 42px rgba(24, 88, 80, 0.15);
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-dialog {
    width: min(94vw, 1120px);
    max-width: 1120px;
    margin: 4vh auto;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-content {
    border: 1px solid var(--scr-border);
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 0%, rgba(26, 180, 166, 0.13), transparent 30%),
        linear-gradient(180deg, #f3fbfa 0%, #ffffff 62%);
    box-shadow: var(--scr-shadow);
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-content::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #0d7c72 0%, #12a18f 56%, #d5a45c 100%);
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-header {
    padding: 16px 22px 14px;
    border-bottom: 1px solid var(--scr-border);
    background:
        radial-gradient(circle at top right, rgba(213, 164, 92, 0.12), transparent 28%),
        linear-gradient(120deg, rgba(18, 161, 143, 0.13), rgba(255, 255, 255, 0.92) 52%, #fffdf8 100%);
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-title {
    color: var(--scr-title);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-title::after {
    content: "Sleep Insight \00b7  Comprehensive Report";
    display: block;
    margin-top: 2px;
    color: var(--scr-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-header .close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-top: 0;
    border: 1px solid #b7dcd6;
    border-radius: 12px;
    color: #668c87;
    background: rgba(255, 255, 255, 0.75);
    opacity: 1;
    text-shadow: none;
    transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-header .close:hover {
    color: var(--scr-accent-dark);
    border-color: #83c8bf;
    background: #ffffff;
    transform: rotate(90deg);
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-body {
    padding: 16px 18px 12px;
    max-height: 78vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: rgba(33, 126, 114, 0.28) transparent;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal:has(table.sleep-comprehensive-report-grid) .modal-body::-webkit-scrollbar-thumb {
    background: rgba(33, 126, 114, 0.26);
    border-radius: 999px;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-box {
    margin-bottom: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow-x: hidden;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-box .box-body {
    padding: 0;
    background: transparent;
    overflow-x: hidden;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-box .table-wrapper {
    border: 1px solid var(--scr-border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 255, 253, 0.98)),
        var(--scr-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    overflow: hidden;
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-button-group {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px !important;
    padding: 10px;
    border: 1px solid var(--scr-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 24px rgba(32, 119, 108, 0.08);
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-button-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid #b9ded8 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #446b66 !important;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 8px 16px rgba(31, 107, 98, 0.08);
    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.sleep-comprehensive-report-grid) .filter-button-group .btn:hover,
.modal:has(table.sleep-comprehensive-report-grid) .filter-button-group .btn:focus-visible {
    border-color: #77c9bd !important;
    color: var(--scr-accent-dark) !important;
    background: #f3fffc !important;
    box-shadow: 0 12px 22px rgba(24, 128, 116, 0.12);
    transform: translateY(-1px);
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-button-group .btn.active,
.modal:has(table.sleep-comprehensive-report-grid) .filter-button-group .btn-primary {
    border-color: #0e9286 !important;
    background: linear-gradient(180deg, #18b2a3 0%, #0d9488 100%) !important;
    color: #ffffff !important;
    box-shadow:
        0 12px 22px rgba(13, 148, 136, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-box,
.modal:has(table.sleep-comprehensive-report-grid) .box-filter,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter {
    border: 1px solid rgba(207, 231, 227, 0.95);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 24px rgba(32, 119, 108, 0.06);
}

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

table.sleep-comprehensive-report-grid > thead > tr > th {
    border: 0 !important;
    background: #eaf7f4 !important;
    color: #42746e !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    padding: 9px 12px 7px !important;
}

table.sleep-comprehensive-report-grid > thead > tr > th.sleep-report-col-id,
table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-id {
    width: 7%;
    text-align: center !important;
}

table.sleep-comprehensive-report-grid > thead > tr > th.sleep-report-col-state,
table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-state {
    width: 20%;
}

table.sleep-comprehensive-report-grid > thead > tr > th.sleep-report-col-vitals,
table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-vitals {
    width: 29%;
}

table.sleep-comprehensive-report-grid > thead > tr > th.sleep-report-col-motion,
table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-motion {
    width: 28%;
}

table.sleep-comprehensive-report-grid > thead > tr > th.sleep-report-col-time,
table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-time {
    width: 16%;
    text-align: center !important;
}

table.sleep-comprehensive-report-grid > tbody > tr {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

table.sleep-comprehensive-report-grid > tbody > tr > td {
    vertical-align: middle !important;
    border-top: 1px solid #dbece8 !important;
    border-bottom: 1px solid #dbece8 !important;
    background: rgba(255, 255, 255, 0.96) !important;
    color: var(--scr-text);
    padding: 11px 12px !important;
}

table.sleep-comprehensive-report-grid > tbody > tr > td:first-child {
    border-left: 1px solid #dbece8 !important;
    border-radius: 16px 0 0 16px;
    color: #638681;
    font-weight: 700;
}

table.sleep-comprehensive-report-grid > tbody > tr > td:last-child {
    border-right: 1px solid #dbece8 !important;
    border-radius: 0 16px 16px 0;
}

table.sleep-comprehensive-report-grid > tbody > tr:hover > td {
    border-color: var(--scr-border-strong) !important;
    background: #fbfffe !important;
    box-shadow: 0 12px 22px rgba(27, 111, 101, 0.08);
}

.sleep-report-state {
    display: flex;
    min-height: 70px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.sleep-report-state strong {
    color: #143f3a;
    font-size: 15px;
    font-weight: 800;
}

.sleep-report-state small {
    color: var(--scr-muted);
    font-size: 11px;
    font-weight: 700;
}

.sleep-report-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #bde3dd;
    background: #eefaf7;
    color: var(--scr-accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.sleep-report-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.sleep-report-metric {
    position: relative;
    min-height: 64px;
    padding: 10px 9px;
    border: 1px solid #d8eae6;
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(18, 161, 143, 0.11), transparent 38%),
        #fbfefe;
    overflow: hidden;
}

.sleep-report-metric::before {
    content: "";
    position: absolute;
    left: 0;
    top: 13px;
    bottom: 13px;
    width: 3px;
    border-radius: 999px;
    background: var(--scr-accent);
    opacity: 0.72;
}

.sleep-report-metric em,
.sleep-report-metric strong,
.sleep-report-metric small {
    position: relative;
    z-index: 1;
}

.sleep-report-metric em {
    display: block;
    color: #6a8a85;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.2;
}

.sleep-report-metric strong {
    display: inline-block;
    margin-top: 6px;
    color: #123f3b;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.1;
    word-break: break-all;
}

.sleep-report-metric small {
    margin-left: 3px;
    color: #7f9d98;
    font-size: 10px;
    font-weight: 700;
}

.sleep-report-metric--heart::before {
    background: #dc6f67;
}

.sleep-report-metric--apnea::before {
    background: var(--scr-blue);
}

.sleep-report-metric--turn::before {
    background: var(--scr-gold);
}

.sleep-report-metric--major::before {
    background: #15a58f;
}

.sleep-report-metric--minor::before {
    background: #85b8af;
}

.sleep-report-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #cde8e2;
    border-radius: 999px;
    background: #f2fbf8;
    color: #2d655d;
    font-size: 12px;
    font-weight: 800;
    white-space: normal;
    text-align: center;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-column-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-column-header .grid-sort {
    width: 16px;
    height: 16px;
    margin-left: 5px;
    color: #86aea8;
    text-decoration: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-column-header .grid-sort.active {
    color: var(--scr-accent-dark);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-footer,
.modal:has(table.sleep-comprehensive-report-grid) .box-footer {
    border-top: 0;
    background: transparent;
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 6px 0 0 !important;
    padding: 3px !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow: visible !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li {
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li.active,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > .page-item.active {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li > a,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li > span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(174, 218, 211, 0.88) !important;
    border-radius: 50% !important;
    color: #557b76;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.95), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #edf8f5 100%) !important;
    font-size: 13px;
    font-weight: 900;
    line-height: 1 !important;
    cursor: pointer;
    box-shadow:
        0 8px 16px rgba(42, 102, 94, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    transition:
        transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        background 0.18s ease;
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:first-child > a,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:first-child > span,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:last-child > a,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:last-child > span {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-color: rgba(147, 204, 196, 0.95) !important;
    color: #26766d;
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.96), transparent 42%),
        linear-gradient(180deg, #fafffe 0%, #e5f5f1 100%) !important;
    box-shadow:
        0 10px 20px rgba(31, 105, 96, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li > a:hover {
    border-color: #79c8bd !important;
    color: var(--scr-accent-dark);
    transform: translateY(-1px);
    box-shadow:
        0 12px 22px rgba(31, 105, 96, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:first-child > a:hover,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:last-child > a:hover,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:first-child > a:focus-visible,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:last-child > a:focus-visible {
    border-color: #37b4a7 !important;
    color: #0b7f75;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 1), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #dff5f0 100%) !important;
    box-shadow:
        0 14px 24px rgba(13, 148, 136, 0.20),
        0 0 0 4px rgba(13, 148, 136, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(-2px) scale(1.06);
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:first-child > a:active,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > li:last-child > a:active {
    transform: translateY(0) scale(0.94);
    box-shadow:
        0 6px 12px rgba(13, 148, 136, 0.14),
        inset 0 3px 8px rgba(9, 105, 97, 0.16);
}

.modal:has(table.sleep-comprehensive-report-grid) .pagination > .active > a,
.modal:has(table.sleep-comprehensive-report-grid) .pagination > .active > span {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid rgba(12, 132, 122, 0.92) !important;
    color: #ffffff;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.38), transparent 36%),
        linear-gradient(180deg, #21b7a8 0%, #0d9488 58%, #08776e 100%) !important;
    font-size: 14px;
    box-shadow:
        0 13px 24px rgba(13, 148, 136, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.30),
        inset 0 -7px 14px rgba(5, 86, 79, 0.18);
    transform: none;
    z-index: 1;
    animation: sleep-report-page-pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sleep-report-page-pop {
    0% {
        transform: scale(0.84);
        box-shadow:
            0 5px 12px rgba(13, 148, 136, 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }
    65% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 900px) {
    .modal:has(table.sleep-comprehensive-report-grid) .modal-dialog {
        width: 96vw;
        margin: 2vh auto;
    }

    table.sleep-comprehensive-report-grid > tbody > tr > td {
        padding: 9px 8px !important;
    }

    .sleep-report-metrics {
        grid-template-columns: 1fr;
    }

    .sleep-report-metric {
        min-height: 52px;
    }
}

/* Report-card presentation overrides */
.modal:has(table.sleep-comprehensive-report-grid) .filter-button-group {
    display: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-box {
    position: relative;
    display: block !important;
    margin: 0 0 14px !important;
    padding: 14px !important;
    border: 1px solid rgba(157, 207, 199, 0.72) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(circle at top right, rgba(213, 164, 92, 0.13), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(238, 250, 247, 0.92) 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.86),
        0 16px 30px rgba(32, 119, 108, 0.08) !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-box::before {
    content: "筛选条件";
    display: inline-flex;
    align-items: center;
    align-self: flex-start !important;
    width: fit-content;
    max-width: 100%;
    height: 22px;
    margin: 0 0 14px;
    padding: 0 0 0 12px;
    border: 0;
    border-left: 4px solid var(--scr-accent);
    border-radius: 0;
    background:
        linear-gradient(90deg, rgba(13, 148, 136, 0.12), rgba(13, 148, 136, 0.00) 86%);
    color: var(--scr-accent-dark);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.2px;
    box-shadow: none;
}

.modal:has(table.sleep-comprehensive-report-grid) .filter-box .card-body {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .filter-input[class*="col-sm-"] {
    flex: 1 1 620px;
    width: auto;
    max-width: none;
    padding: 0 !important;
    margin: 0 !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .form-group {
    margin: 0 !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group.input-group-sm {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 42px;
    min-height: 42px;
    border: 1px solid #b9ded8;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(43, 112, 103, 0.07);
    overflow: hidden;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group-prepend,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group-append {
    display: flex;
    align-self: stretch;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group-text,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px !important;
    min-height: 42px !important;
    min-width: 46px;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #eef9f6 !important;
    color: #56857e !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-sizing: border-box;
    box-shadow: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group-text > *,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group-addon > * {
    transform: translateY(1px);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group > .form-control {
    height: 42px;
    min-height: 42px;
    min-width: 0;
    border: 0 !important;
    border-left: 1px solid #d7ece7 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: var(--scr-text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    box-sizing: border-box;
    box-shadow: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .input-group > .form-control:focus {
    background: #fbfffe !important;
    box-shadow: inset 0 0 0 2px rgba(18, 161, 143, 0.13) !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group.default,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group.btn-group-sm.default.btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px !important;
    border-radius: 999px !important;
    font-size: 13px;
    font-weight: 800;
    line-height: 40px !important;
    vertical-align: middle;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group .btn i,
.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group .btn .feather {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    line-height: 40px;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group .btn.submit {
    border: 1px solid #0d9488 !important;
    background: linear-gradient(180deg, #18b2a3 0%, #0d9488 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 22px rgba(13, 148, 136, 0.20);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group .btn.reset {
    border: 1px solid #b9ded8 !important;
    background: #ffffff !important;
    color: #527b75 !important;
    box-shadow: 0 10px 18px rgba(42, 102, 94, 0.08);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-filter-form .btn-group .btn:hover {
    transform: translateY(-1px);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector {
    display: grid;
    gap: 8px;
    margin: 0 0 16px !important;
    padding: 12px 14px !important;
    border: 1px solid rgba(157, 207, 199, 0.68);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 26px rgba(32, 119, 108, 0.06);
    overflow: visible !important;
    max-height: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .wrap {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 12px;
    min-height: 30px;
    height: 30px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-label {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    align-self: center;
    height: 26px;
    min-height: 26px;
    padding-left: 10px;
    border-left: 3px solid rgba(13, 148, 136, 0.82);
    background: linear-gradient(90deg, rgba(13, 148, 136, 0.10), transparent 78%);
    color: #2f6860;
    font-size: 13px;
    font-weight: 850;
    line-height: 26px;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options {
    min-width: 0;
    display: flex;
    align-items: center;
    align-self: center;
    min-height: 26px;
    overflow: visible !important;
    max-height: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    max-height: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-height: 26px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    line-height: 26px;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options li > a:not(:first-child),
.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options li:has(> a.clear) {
    display: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options li > a:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-height: 26px;
    padding: 0 12px;
    border: 1px solid #b9ded8;
    border-radius: 999px;
    background: #ffffff;
    color: #557b76;
    font-size: 11px;
    font-weight: 800;
    line-height: 26px;
    box-sizing: border-box;
    text-decoration: none !important;
    box-shadow: 0 8px 16px rgba(34, 103, 95, 0.07);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options li > a:first-child:hover {
    border-color: #76c9bf;
    background: #f2fffc;
    color: var(--scr-accent-dark);
    transform: translateY(-1px);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options li > a:first-child.active {
    border-color: #0d9488;
    background: linear-gradient(180deg, #18b2a3 0%, #0d9488 100%);
    color: #ffffff;
    box-shadow: 0 12px 22px rgba(13, 148, 136, 0.18);
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options a.add,
.modal:has(table.sleep-comprehensive-report-grid) .grid-selector .select-options a.clear {
    display: none !important;
}

.modal:has(table.sleep-comprehensive-report-grid) .grid-box .table-wrapper {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

table.sleep-comprehensive-report-grid {
    display: block;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

table.sleep-comprehensive-report-grid > thead {
    display: none !important;
}

table.sleep-comprehensive-report-grid > tbody {
    display: block;
}

table.sleep-comprehensive-report-grid > tbody > tr {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(132px, 0.9fr) minmax(218px, 1.35fr) minmax(218px, 1.35fr) minmax(144px, 0.82fr);
    gap: 10px;
    align-items: stretch;
    margin: 0 0 13px;
    padding: 14px 0 14px 14px;
    border: 1px solid rgba(180, 222, 216, 0.88);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 253, 251, 0.96) 100%),
        #ffffff;
    box-shadow:
        0 16px 30px rgba(33, 111, 101, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.86);
    overflow: hidden;
}

table.sleep-comprehensive-report-grid > tbody > tr::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #0d9488 0%, #d5a45c 100%);
}

table.sleep-comprehensive-report-grid > tbody > tr:hover {
    transform: translateY(-1px);
    box-shadow:
        0 20px 34px rgba(33, 111, 101, 0.11),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

table.sleep-comprehensive-report-grid > tbody > tr > td,
table.sleep-comprehensive-report-grid > tbody > tr > td:first-child,
table.sleep-comprehensive-report-grid > tbody > tr > td:last-child {
    display: flex;
    width: auto !important;
    min-width: 0;
    min-height: 80px;
    align-items: center;
    border: 0 !important;
    border-radius: 16px !important;
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.92), transparent 42%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(239, 250, 247, 0.62)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        inset 0 0 0 1px rgba(216, 236, 232, 0.72),
        0 10px 18px rgba(42, 102, 94, 0.06);
    padding: 12px !important;
    backdrop-filter: blur(10px);
}

table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-id {
    justify-content: center;
    background: transparent !important;
    box-shadow: none;
}

table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-vitals,
table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-motion {
    align-items: stretch;
}

table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-time {
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border-radius: 16px 0 0 16px !important;
    text-align: center !important;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 44%),
        linear-gradient(145deg, rgba(240, 251, 248, 0.92), rgba(255, 255, 255, 0.78)) !important;
}

table.sleep-comprehensive-report-grid > tbody > tr > td[colspan] {
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 92px;
    background: rgba(255, 255, 255, 0.82) !important;
}

.sleep-report-index {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    border: 1px solid #abd8d1;
    border-radius: 18px;
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.42), transparent 32%),
        linear-gradient(180deg, #effaf7 0%, #dff4ef 100%);
    color: var(--scr-accent-dark);
}

.sleep-report-index strong {
    color: #0d6f67;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

table.sleep-comprehensive-report-grid .sleep-report-state,
table.sleep-comprehensive-report-grid .sleep-report-metrics {
    width: 100%;
}

table.sleep-comprehensive-report-grid .sleep-report-metric {
    isolation: isolate;
    border: 0;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.00) 0%, rgba(255, 255, 255, 0.58) 36%, rgba(255, 255, 255, 0.00) 62%),
        radial-gradient(circle at 92% 4%, rgba(18, 161, 143, 0.16), transparent 38%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(238, 250, 247, 0.60));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.86),
        inset 0 -18px 32px rgba(255, 255, 255, 0.34),
        inset 0 0 0 1px rgba(198, 229, 223, 0.82),
        0 12px 22px rgba(32, 119, 108, 0.08);
    backdrop-filter: blur(12px) saturate(1.1);
}

table.sleep-comprehensive-report-grid .sleep-report-metric::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.32) 42%, transparent 68%);
    pointer-events: none;
}

table.sleep-comprehensive-report-grid .sleep-report-metric strong {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

table.sleep-comprehensive-report-grid .sleep-report-time {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 80px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #185f58;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: 0.2px;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    box-shadow: none;
}

@media (max-width: 980px) {
    table.sleep-comprehensive-report-grid > tbody > tr {
        grid-template-columns: 70px 1fr;
    }

    table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-vitals,
    table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-motion,
    table.sleep-comprehensive-report-grid > tbody > tr > td.sleep-report-col-time {
        grid-column: 1 / -1;
    }

    .modal:has(table.sleep-comprehensive-report-grid) .grid-selector .wrap {
        grid-template-columns: 1fr;
    }
}
