html,
body {
    height: 100%;
}

.wrap {
    min-height: 100%;
    height: auto;
    margin: 0 auto -60px;
    padding: 0 0 60px;
}

.wrap > .container {
    padding: 1.5rem 15px 20px;
}

.footer {
    height: 60px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
}

.jumbotron {
    text-align: center;
    background-color: transparent;
}

.jumbotron .btn {
    font-size: 21px;
    padding: 14px 24px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    padding-left: 5px;
}

a.asc:after {
    content: /*"\e113"*/ "\e151";
}

a.desc:after {
    content: /*"\e114"*/ "\e152";
}

.sort-numerical a.asc:after {
    content: "\e153";
}

.sort-numerical a.desc:after {
    content: "\e154";
}

.sort-ordinal a.asc:after {
    content: "\e155";
}

.sort-ordinal a.desc:after {
    content: "\e156";
}

.grid-view th {
    white-space: nowrap;
}

/* Detail views: long values (links, codes) wrap instead of widening the page. */
.detail-view td {
    overflow-wrap: anywhere;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* Top navbar (views/layouts/_mainMenu.php). */
.app-navbar {
    --app-navbar-control-size: 2.25rem;
}

.app-navbar .navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -.01em;
}

.app-navbar .navbar-brand .bi {
    font-size: 1.4rem;
}

.app-navbar .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: .4rem .9rem;
    border-radius: var(--bs-border-radius-pill);
    color: var(--bs-secondary-color);
    font-weight: 500;
    transition: color .15s ease-in-out, background-color .15s ease-in-out;
}

.app-navbar .navbar-nav .nav-link:hover,
.app-navbar .navbar-nav .nav-link:focus-visible {
    color: var(--bs-emphasis-color);
    background-color: var(--bs-tertiary-bg);
}

.app-navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary);
    background-color: var(--bs-primary-bg-subtle);
}

.app-navbar .navbar-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--app-navbar-control-size);
    height: var(--app-navbar-control-size);
}

.app-navbar .navbar-icon-btn .bi {
    font-size: 1.1rem;
}

.app-navbar .navbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 14rem;
    padding: .2rem .75rem .2rem .2rem;
    border-radius: var(--bs-border-radius-pill);
    color: var(--bs-body-color);
    font-weight: 500;
    text-decoration: none;
}

.app-navbar a.navbar-user:hover {
    background-color: var(--bs-tertiary-bg);
}

.app-navbar .navbar-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-size: .9rem;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .app-navbar .navbar-collapse {
        padding-top: .5rem;
    }

    .app-navbar .navbar-icon-btn {
        width: 100%;
    }

    .app-navbar .navbar-user {
        max-width: none;
    }
}

/* Section sidebar of the cabinet and junket layouts (views/layouts/_sidebar.php). */
.app-sidebar {
    padding: .5rem;
    border-radius: var(--bs-border-radius-xl);
    background-color: var(--bs-tertiary-bg);
}

.app-sidebar-header {
    align-items: center;
    gap: .75rem;
    padding: .5rem .5rem 1rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.app-sidebar-header-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--bs-border-radius-lg);
    background: linear-gradient(135deg, var(--bs-primary), var(--bs-indigo));
    color: #fff;
    font-size: 1.3rem;
}

.app-sidebar-caption {
    color: var(--bs-secondary-color);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.app-sidebar-title {
    color: var(--bs-emphasis-color);
    font-weight: 600;
}

.min-w-0 {
    min-width: 0;
}

/* Narrow screens: one scrollable row of items. */
.app-sidebar-nav {
    flex-wrap: nowrap;
    gap: .25rem;
    overflow-x: auto;
    scrollbar-width: none;
    /* Fading edge hints that the strip scrolls. */
    mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
}

.app-sidebar-nav::-webkit-scrollbar {
    display: none;
}

.app-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .4rem .75rem .4rem .4rem;
    border-radius: var(--bs-border-radius-lg);
    color: var(--bs-body-color);
    font-weight: 500;
    white-space: nowrap;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.app-sidebar-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--bs-border-radius);
    background-color: var(--bs-body-bg);
    color: var(--bs-secondary-color);
    font-size: 1.05rem;
    transition: inherit;
}

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

.app-sidebar-nav .nav-link:hover .app-sidebar-icon {
    color: var(--bs-primary);
}

.app-sidebar-nav .nav-link.active {
    background-color: var(--bs-body-bg);
    box-shadow: var(--bs-box-shadow-sm);
    color: var(--bs-primary);
    font-weight: 600;
}

.app-sidebar-nav .nav-link.active .app-sidebar-icon {
    background-color: var(--bs-primary);
    color: #fff;
}

/* Wide screens: a vertical menu that stays in view below the sticky navbar. */
@media (min-width: 768px) {
    .app-sidebar {
        position: sticky;
        top: 5rem;
        padding: .75rem;
    }

    .app-sidebar-nav {
        flex-direction: column;
        overflow-x: visible;
        mask-image: none;
    }

    .app-sidebar-nav .nav-link {
        white-space: normal;
    }
}

.bg-purple {
    background-color: #6f42c1 !important;
}

/* Rich text entered with app\widgets\RichTextEditor and output as is (sanitized on input). */
.rich-text > :last-child {
    margin-bottom: 0;
}

.rich-text img {
    max-width: 100%;
    height: auto;
}

.rich-text img[style*="float: left"],
.rich-text img[style*="float:left"] {
    margin: 0 .75rem .5rem 0;
}

.rich-text img[style*="float: right"],
.rich-text img[style*="float:right"] {
    margin: 0 0 .5rem .75rem;
}

.rich-text::after {
    content: "";
    display: block;
    clear: both;
}

.rich-text table {
    width: auto;
    margin-bottom: .5rem;
}

.rich-text blockquote {
    margin: 0 0 1rem;
    padding: .25rem 0 .25rem 1rem;
    border-left: .25rem solid var(--bs-border-color);
    color: var(--bs-secondary-color);
}

.rich-text pre {
    padding: .5rem .75rem;
    background-color: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius);
    white-space: pre-wrap;
}

/* Card header that collapses the card body (data-bs-toggle="collapse"); the chevron turns while collapsed. */
.card-header-toggle {
    cursor: pointer;
}

.card-header-toggle:hover {
    background-color: var(--bs-tertiary-bg);
}

.card-header-toggle .bi-chevron-down {
    transition: transform 0.2s;
}

.card-header-toggle.collapsed .bi-chevron-down {
    transform: rotate(-90deg);
}

/* Text cut to a few lines until its toggle (an element with data-expandable-target) expands it, see expandable-text.js. */
.expandable-text {
    max-height: 4.5em;
    overflow: hidden;
    position: relative;
}

.expandable-text:not(.expanded)::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1.5em;
    background: linear-gradient(transparent, var(--bs-body-bg));
}

.expandable-text.expanded {
    max-height: none;
}

/* The toggle does nothing while the text fits: no pointer, no chevron. */
.expandable-toggle.expandable-idle .bi-chevron-down {
    display: none;
}

.expandable-toggle:not(.expandable-idle) {
    cursor: pointer;
}

.expandable-toggle:not(.expandable-idle):hover {
    background-color: var(--bs-tertiary-bg);
}

.expandable-toggle .bi-chevron-down {
    display: inline-block; /* an inline element does not turn */
    transition: transform 0.2s;
}

.expandable-toggle.collapsed .bi-chevron-down {
    transform: rotate(-90deg);
}

/* Avatar picker: the selected avatar (or an empty circle) opening the choice modal. */
.avatar-picker-circle {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: 2px dashed var(--bs-border-color);
    border-radius: 50%;
    background-color: var(--bs-body-bg);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.avatar-picker-circle:has(.avatar-picker-preview:not(.d-none)) {
    border-style: solid;
    border-width: 1px;
}

.avatar-picker-circle:hover,
.avatar-picker-circle:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
    outline: 0;
}

.avatar-picker-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #fff;
}
