body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

body.app-body {
    background:
        radial-gradient(circle at 0% 0%, rgba(147, 197, 253, 0.35), transparent 55%),
        radial-gradient(circle at 100% 0%, rgba(168, 85, 247, 0.28), transparent 55%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.98));
    color: #0f172a;
}

main,
.app-main {
    flex: 1 0 auto;
}

.app-main {
    position: relative;
}

.app-shell {
    max-width: 1280px;
}

body.item-detail-page main.py-4,
body.item-detail-page .app-main {
    padding-top: 1rem;
}

.app-navbar {
    background:
        linear-gradient(115deg, rgba(30, 64, 175, 0.96), rgba(14, 116, 144, 0.92));
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: sticky;
    top: 0;
    z-index: 1030;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.app-navbar__container {
    max-width: 1280px;
}

.app-navbar .navbar-brand {
    color: #fff;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.app-navbar .nav-link.active,
.app-navbar .nav-link:focus,
.app-navbar .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-navbar .btn-primary {
    border-radius: 999px;
    padding-inline: 1.35rem;
}

/* Ensure modals appear above custom layout layers/backdrops */
.modal,
.modal.show {
    z-index: 5000 !important;
}

.modal-dialog {
    z-index: 5010 !important;
}

.modal-backdrop,
.modal-backdrop.show {
    z-index: 4000 !important;
}

.select2-container--open .select2-dropdown {
    z-index: 5020 !important;
}

.app-navbar__links {
    gap: 1rem;
}

.app-main::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.75), rgba(241, 245, 249, 0));
    pointer-events: none;
}

.app-shell {
    position: relative;
    z-index: 1;
}

.card {
    border: 0;
    border-radius: 1.25rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
}

.card-header {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border: 0;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.32);
    font-weight: 600;
    border-radius: 0.85rem;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

.btn-outline-primary {
    border-radius: 0.85rem;
    border-width: 1.5px;
}

.app-alert {
    border-radius: 1rem;
    border: 0;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    padding: 0.9rem 1.2rem;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 0.85rem;
    border-color: rgba(148, 163, 184, 0.35);
    background-color: rgba(255, 255, 255, 0.95);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.18);
}

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

.table thead {
    background: rgba(37, 99, 235, 0.08);
    color: #0f172a;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.table > :not(caption) > * > * {
    padding-block: 0.95rem;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(37, 99, 235, 0.06);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.site-footer {
    background: linear-gradient(115deg, rgba(30, 64, 175, 0.95), rgba(14, 116, 144, 0.9));
    color: rgba(255, 255, 255, 0.84);
    box-shadow: 0 -16px 36px rgba(15, 23, 42, 0.18);
}

.site-footer__inner {
    max-width: 1280px;
}

.site-footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-footer__brand img {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}

.site-footer__meta {
    color: rgba(255, 255, 255, 0.72);
    max-width: 520px;
    margin: 0 auto;
}

.site-footer__copyright {
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: 0.06em;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
}

.navbar-brand__logo {
    height: 62px;
    width: auto;
    display: block;
}

@media (max-width: 575.98px) {
    .navbar-brand__logo {
        height: 36px;
    }
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12) !important;
}

.badge-status {
    font-size: 0.75rem;
}

.chat-window {
    max-height: 60vh;
    overflow-y: auto;
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
}

.chat-bubble.me {
    background-color: #0d6efd;
    color: #fff;
    margin-left: auto;
}

.chat-bubble.other {
    background-color: #e9ecef;
    color: #212529;
    margin-right: auto;
}

.chat-layout {
    min-height: calc(100vh - 240px);
}

.chat-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-sidebar__body {
    flex: 1;
    padding: 0.75rem;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: clamp(320px, 72vh, 760px);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.chat-list__item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-radius: 1rem;
    padding: 0.75rem 0.9rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: background 0.2s ease, transform 0.2s ease;
}

.chat-list__item::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    inset-block: calc(50% - 14px);
    width: 3px;
    border-radius: 999px;
    background: transparent;
}

.chat-list__item:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateX(2px);
}

.chat-list__item.active {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.22);
}

.chat-list__item.active .chat-list__subtitle,
.chat-list__item.active .chat-list__time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-list__item--unread::after {
    background: #2563eb;
}

.chat-list__avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(124, 58, 237, 0.35));
    color: #1d4ed8;
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-list__meta {
    flex: 1;
    display: grid;
    gap: 0.25rem;
}

.chat-list__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-list__subtitle {
    font-size: 0.8rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list__time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: 0.5rem;
}

.chat-empty {
    display: grid;
    gap: 0.5rem;
    place-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    color: #64748b;
}

.chat-empty .bi {
    font-size: 2rem;
    color: rgba(37, 99, 235, 0.55);
}

.chat-empty--inline {
    padding: 1.5rem;
}

.chat-room__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.chat-room__title {
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-room__subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.chat-room__body {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.65), rgba(255, 255, 255, 0.9));
    border-radius: 1.5rem;
    overflow: hidden;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.chat-date-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chat-date-divider::before,
.chat-date-divider::after {
    content: '';
    height: 1px;
    background: rgba(148, 163, 184, 0.4);
}

.chat-date-divider span {
    padding: 0.15rem 0.75rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
}

.chat-message {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    animation: chat-enter 0.2s ease;
}

.chat-message--mine {
    flex-direction: row-reverse;
}

.chat-message--mine .chat-message__bubble {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border-top-right-radius: 0.5rem;
    border-top-left-radius: 1.25rem;
}

.chat-message--mine .chat-message__meta {
    color: rgba(255, 255, 255, 0.75);
}

.chat-message--mine .chat-message__avatar {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(124, 58, 237, 0.5));
    color: #0f172a;
}

.chat-message__avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.9);
    color: #2563eb;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(148, 163, 184, 0.25);
}

.chat-message__bubble {
    max-width: min(72ch, 100%);
    background: #fff;
    border-radius: 1.25rem;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
    border-top-left-radius: 0.5rem;
}

.chat-message__text {
    margin-bottom: 0.4rem;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.45;
}

.chat-message__meta {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: right;
}

.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-input__field {
    flex: 1;
    position: relative;
    background: #fff;
    border-radius: 1rem;
    padding: 0.25rem 0.85rem;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.chat-input__field textarea {
    width: 100%;
    border: 0;
    resize: none;
    background: transparent;
    padding: 0.6rem 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #0f172a;
}

.chat-input__field textarea:focus {
    outline: none;
}

.chat-input__send {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.chat-input__send .bi {
    font-size: 1.2rem;
}

@keyframes chat-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .chat-layout {
        min-height: auto;
    }

    .chat-list {
        max-height: none;
    }

    .chat-room__body {
        border-radius: 1rem;
    }
}

.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(2.5rem + 2px);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    border-radius: 0.5rem;
}

.select2-container--bootstrap-5 .select2-selection__rendered {
    padding-left: 0;
}

.item-detail {
    --item-detail-radius: 1.25rem;
    --item-detail-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.item-detail__breadcrumb {
    background: rgba(226, 232, 240, 0.45);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
}

.item-detail__breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.92rem;
    color: #475569;
}

.item-detail__breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #94a3b8;
    font-weight: 600;
}

.item-detail__breadcrumb .breadcrumb-item a {
    color: #475569;
    text-decoration: none;
}

.item-detail__breadcrumb .breadcrumb-item a:hover {
    color: #0d6efd;
}

.item-detail__breadcrumb .breadcrumb-item.active {
    color: #0d6efd;
    font-weight: 600;
}

.item-detail__media {
    border: 0;
    border-radius: var(--item-detail-radius);
    overflow: hidden;
}

.item-detail__image {
    width: 100%;
    height: 420px;
    object-fit: cover;
}

.item-detail__placeholder {
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    color: #94a3b8;
    background: linear-gradient(180deg, rgba(226, 232, 240, 0.35) 0%, rgba(226, 232, 240, 0.1) 100%);
}

.item-detail__placeholder i {
    font-size: 3rem;
}

.item-detail__tags .badge {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

.item-detail__title {
    color: #1a2240;
}

.item-detail__lead {
    font-size: 0.95rem;
}

.item-detail__facts li {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: #475569;
}

.item-detail__facts li:last-child {
    margin-bottom: 0;
}

.item-detail__facts i {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    font-size: 1.1rem;
}

.item-detail__facts span {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.item-detail__facts strong {
    font-size: 0.95rem;
    color: #1f2937;
}

.item-detail__summary {
    border: 0;
    border-radius: var(--item-detail-radius);
    box-shadow: var(--item-detail-shadow);
}

.item-detail__price {
    color: #0d6efd;
    font-weight: 700;
}

.item-detail__summary-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    color: #4b5563;
    font-size: 0.95rem;
}

.item-detail__summary-list li:last-child {
    margin-bottom: 0;
}

.item-detail__summary-list i {
    color: #0d6efd;
}

.item-detail__avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}

.item-detail__rating .bi-star-fill,
.item-detail__rating .bi-star-half {
    color: #fbbf24;
}

.item-detail__rating-badge {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    background: rgba(13, 110, 253, 0.08);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.9rem;
    color: #0d6efd;
}

.item-detail__rating-badge strong {
    font-size: 1.1rem;
}

.item-detail__reviews {
    margin-top: 3rem;
}

.item-detail__reviews-empty {
    padding: 2.5rem;
    border-radius: var(--item-detail-radius);
    border: 1px dashed rgba(148, 163, 184, 0.5);
    text-align: center;
}

.item-detail__review-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.item-detail__review {
    border: 0;
    border-radius: var(--item-detail-radius);
}

.item-detail__review-stars .bi-star-fill {
    color: #fbbf24;
}

.item-detail__review-stars .bi-star {
    color: #cbd5f5;
}

.item-detail__contact-options .btn {
    border-radius: 0.75rem;
}

@media (max-width: 991.98px) {
    .item-detail__summary {
        box-shadow: none;
    }
}

@media (max-width: 767.98px) {
    .item-detail__image,
    .item-detail__placeholder {
        height: 260px;
    }
}
