
:root {
    --tlife-content-max-width: 1440px;
}


.tlife-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    padding: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background-color: rgba(var(--bs-tertiary-bg-rgb), .96) !important;
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .12);
    backdrop-filter: blur(12px);
}

.tlife-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    max-width: var(--tlife-content-max-width);
    min-height: 72px;
    margin-inline: auto;
    padding-inline: 1.5rem;
    gap: 1.5rem;
}

.tlife-header__brand,
.tlife-header__account,
.tlife-header__metric,
.tlife-header__user {
    display: flex;
    align-items: center;
}

.tlife-header__brand {
    gap: .5rem;
    color: var(--bs-body-color);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    text-decoration: none;
}

.tlife-header__brand:hover,
.tlife-header__brand:focus-visible {
    color: var(--bs-primary);
}

.tlife-header__brand img {
    display: block;
    border-radius: .6rem;
}

.tlife-header__nav {
    min-width: 0;
}

.tlife-header__nav .navbar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: .25rem;
}

.tlife-header__nav .nav-link {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .7rem;
    border-radius: var(--bs-border-radius-pill);
    color: var(--bs-secondary-color);
    font-weight: 500;
    white-space: nowrap;
}

.tlife-header__nav .nav-link:hover,
.tlife-header__nav .nav-link:focus-visible {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
}

.tlife-header__nav .nav-link.active {
    background-color: rgba(var(--bs-primary-rgb), .16);
    color: var(--bs-primary-text-emphasis);
}

.tlife-header__nav .nav-link i {
    font-size: 1rem;
}

.tlife-header__account {
    justify-self: end;
    gap: .5rem;
}

.tlife-header__metric {
    gap: .4rem;
    min-height: 38px;
    padding-inline: .65rem;
    border: 1px solid var(--bs-border-color-translucent);
    border-radius: var(--bs-border-radius-pill);
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-decoration: none;
    white-space: nowrap;
}

.tlife-header__metric:hover {
    border-color: var(--bs-primary-border-subtle);
    color: var(--bs-body-color);
}

.tlife-header__metric i {
    color: var(--bs-success);
}

.tlife-header__metric--debt i {
    color: var(--bs-danger);
}

.tlife-header__metric-label {
    color: var(--bs-secondary-color);
    font-size: .8rem;
}

.tlife-header__metric strong {
    font-variant-numeric: tabular-nums;
}

.tlife-header__user {
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--bs-border-color);
    border-radius: 50%;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.tlife-header__user:hover,
.tlife-header__user:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18);
}

.tlife-header__user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tlife-header__user .tlife-avatar {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    font-size: 1.125rem;
}

.tlife-header__toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: .45rem;
    border-color: var(--bs-border-color);
}

.tlife-login-card {
    width: 100%;
    max-width: 440px;
}

@media (min-width: 1200px) {
    .tlife-header__nav.collapse {
        display: block;
    }
}

@media (max-width: 1199.98px) {
    .tlife-header__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "brand account toggle"
            "nav nav nav";
        min-height: 64px;
        padding-block: .65rem;
        gap: .65rem 1rem;
    }

    .tlife-header__brand {
        grid-area: brand;
    }

    .tlife-header__toggle {
        display: grid;
        grid-area: toggle;
        place-items: center;
    }

    .tlife-header__nav {
        grid-area: nav;
        margin-inline: calc(1.5rem * -1);
        margin-bottom: -.65rem;
        border-top: 1px solid var(--bs-border-color);
    }

    .tlife-header__nav .navbar-nav {
        display: grid;
        gap: .25rem;
        padding: .6rem 1rem .85rem;
    }

    .tlife-header__nav .nav-link {
        display: grid;
        grid-template-columns: 1.4rem minmax(0, 1fr) auto auto;
        padding: .7rem .75rem;
        border-radius: var(--bs-border-radius);
    }

    .tlife-header__nav .nav-link::after {
        content: "\F285";
        color: var(--bs-secondary-color);
        font-family: "bootstrap-icons";
        font-size: .8rem;
    }

    .tlife-header__account {
        grid-area: account;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .tlife-header__inner {
        padding-inline: .5rem;
        column-gap: .45rem;
    }

    .tlife-header__brand span,
    .tlife-header__metric-label {
        display: none;
    }

    .tlife-header__account {
        gap: .35rem;
    }

    .tlife-header__metric {
        min-width: 0;
        padding-inline: .5rem;
    }

    .tlife-header__metric strong {
        max-width: 4rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tlife-header__nav {
        margin-inline: calc(.5rem * -1);
    }
}


.tlife-content { max-width: var(--tlife-content-max-width); }
.card img { max-width: 100%; }
.card-header > :last-child, .card-footer > :last-child { margin-bottom: 0; }
.table { margin-bottom: 0; }
dd { overflow-wrap: anywhere; min-width: 0; }

.sex-task-card {
    overflow: hidden;
}

.sex-task-deadline {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border: 1px solid var(--bs-warning-border-subtle);
    border-radius: var(--bs-border-radius);
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

.sex-task-deadline > i {
    font-size: 1.5rem;
}

[data-countdown] {
    font-variant-numeric: tabular-nums;
}

[data-countdown].is-expired {
    color: var(--bs-danger-text-emphasis);
}

@media (max-width: 575.98px) {
    .sex-task-history,
    .sex-task-history .table-responsive {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .sex-task-history table,
    .sex-task-history tbody,
    .sex-task-history tr,
    .sex-task-history td {
        display: block;
        width: 100%;
    }

    .sex-task-history thead {
        display: none;
    }

    .sex-task-history tr {
        padding: .65rem .85rem;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .sex-task-history tr:last-child {
        border-bottom: 0;
    }

    .sex-task-history td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: .3rem 0;
        border: 0;
        text-align: end;
    }

    .sex-task-history td::before {
        content: attr(data-label);
        color: var(--bs-secondary-color);
        text-align: start;
    }

    .sex-task-history .sex-task-history__action {
        display: block;
        padding-top: .6rem;
    }

    .sex-task-history .sex-task-history__action::before {
        content: none;
    }

    .sex-task-history__action .btn {
        width: 100%;
    }
}

/* Match enhanced selects to the active Bootstrap color scheme. */
[data-bs-theme="dark"] .ts-control,
[data-bs-theme="dark"] .ts-wrapper.single.input-active .ts-control {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .ts-control input { color: var(--bs-body-color); }
[data-bs-theme="dark"] .ts-dropdown {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}
[data-bs-theme="dark"] .ts-dropdown .active {
    background: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div {
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}
