html, body {
    min-height: 100%;
}

.is-hidden {
    display: none !important;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.navbar .btn-list .btn i {
    font-size: 1rem;
}

.mail-layout {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1199.98px) {
    .mail-layout {
        grid-template-columns: 1fr;
    }
}

.mail-list .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mail-list .list-group-item.active,
.mail-list .list-group-item:hover {
    background-color: rgba(99, 102, 241, 0.15);
}

.mailbox-mails {
    display: none;
}

.mailbox-mails.active {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mailbox-mails .mail-list {
    max-height: 22.5rem;
    overflow-y: auto;
}

.mailbox-mails .mail-list .list-group-item.d-none {
    display: none;
}

.mail-content {
    display: none;
}

.mail-content.active {
    display: block;
}

[data-bs-theme="dark"] .mail-list .list-group-item.active,
[data-bs-theme="dark"] .mail-list .list-group-item:hover {
    background-color: rgba(99, 102, 241, 0.35);
}

.guest-card {
    max-width: 520px;
    margin: 0 auto;
}

.object-fit-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar-vertical {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-bs-theme="dark"] .navbar-vertical {
    background-color: #0f172a;
    border-right-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .navbar-vertical .navbar-brand,
[data-bs-theme="dark"] .navbar-vertical .nav-link,
[data-bs-theme="dark"] .navbar-vertical .nav-link .nav-link-title {
    color: var(--tblr-body-color);
}

[data-bs-theme="dark"] .navbar-vertical .dropdown-menu {
    background-color: #111c2d;
}

.gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gallery-day {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gallery-day-separator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--tblr-body-color);
    text-transform: none;
}

.gallery-day-separator::before,
.gallery-day-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--tblr-border-color);
}

.gallery-day:first-of-type .gallery-day-separator {
    margin-top: 0;
}

.gallery-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.gallery-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    background-color: var(--tblr-card-bg);
    box-shadow: var(--tblr-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tblr-shadow-md);
}

.gallery-media {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background-color: var(--tblr-bg-surface-secondary);
}

.gallery-image,
.gallery-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-video {
    background-color: #000;
}

.gallery-caption {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--tblr-body-color);
}

.gallery-time-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
}

.gallery-video-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.35);
}

.gallery-video-indicator .ti {
    font-size: 1.25rem;
}

.gallery-video-wrapper.is-playing .gallery-video-indicator {
    opacity: 0;
}

.gallery-card--zoomable .gallery-media {
    cursor: zoom-in;
}

.gallery-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(12px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-overlay.is-visible {
    opacity: 1;
}

.gallery-overlay.is-closing {
    pointer-events: none;
}

.gallery-overlay-content {
    position: relative;
    max-width: min(90vw, 960px);
    max-height: 80vh;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
}

.gallery-overlay-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-overlay-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-overlay-close:hover,
.gallery-overlay-close:focus-visible {
    background: rgba(15, 23, 42, 0.95);
    transform: scale(1.05);
    outline: none;
}

.gallery-overlay-close .ti {
    font-size: 1.125rem;
    line-height: 1;
}

body.gallery-overlay-open {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.page-wrapper > header.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(6px);
    background-color: rgba(15, 23, 42, 0.85);
    background-color: color-mix(in srgb, var(--tblr-navbar-bg, rgba(15, 23, 42, 0.85)) 92%, transparent);
}

.admin-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

.admin-section {
    display: grid;
    gap: 1.5rem;
}

.admin-section--top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    min-height: calc(100vh - 7rem);
}

.admin-section--bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-section--top .card,
.admin-section--bottom .card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.admin-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-card__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.admin-card__loader {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--tblr-primary);
}

.admin-card__loader.d-none {
    display: none !important;
}

.admin-player-list {
    flex: 1;
    overflow-y: auto;
    border-radius: 0.5rem;
}

.admin-player-list.list-group.d-none {
    display: none !important;
}

.admin-player {
    padding: 0.75rem 1rem;
}

.admin-player__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 1rem;
}

.admin-player__selection {
    display: flex;
    align-items: flex-start;
    padding-top: 0.25rem;
}

.admin-player__identity {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-player__username {
    font-weight: 600;
    font-size: 1rem;
}

.admin-player__character,
.admin-player__job {
    font-size: 0.875rem;
}

.admin-player__stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.admin-player__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.admin-player__actions .btn {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .admin-player__row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .admin-player__selection {
        order: -1;
        align-self: flex-start;
        padding-top: 0;
    }

    .admin-player__stats,
    .admin-player__actions {
        width: 100%;
        align-items: flex-start;
    }

    .admin-player__stats {
        align-items: flex-start;
    }

    .admin-player__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-player__actions .btn {
        flex: 1 1 45%;
    }
}

.admin-teleport__player {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.5rem;
}

.admin-teleport__player:last-child {
    margin-bottom: 0;
}

.admin-player__cash {
    font-size: 1rem;
}

.admin-player__bank,
.admin-player__gametime {
    font-size: 0.8125rem;
}

.admin-inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.admin-inventory-grid__slot { 
    border: 1px solid var(--tblr-border-color, rgba(0, 0, 0, 0.1));
    background-color: var(--tblr-bg-surface, rgba(0, 0, 0, 0.02));
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-inventory-grid__slot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-inventory-grid__slot-number {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tblr-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-inventory-grid__actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-inventory-grid__item-name {
    font-weight: 600;
    font-size: 1rem;
    word-break: break-word;
}

.admin-inventory-grid__item-count {
    font-size: 0.875rem;
    color: var(--tblr-muted, #6c757d);
}

.admin-inventory-grid__metadata {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
    word-break: break-word;
}

.admin-inventory-grid__metadata dt {
    font-weight: 600;
    color: var(--tblr-muted, #6c757d);
    margin: 0;
}

.admin-inventory-grid__metadata dd {
    margin: 0;
}

.admin-inventory-grid__slot--empty {
    color: var(--tblr-muted, #6c757d);
}

.admin-inventory-grid__empty-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.875rem;
    color: inherit;
}

.admin-inventory-grid__remove {
    color: var(--tblr-danger, #d63939);
    border-radius: 0.5rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.admin-inventory-grid__remove:hover,
.admin-inventory-grid__remove:focus {
    color: var(--tblr-danger, #d63939);
    background-color: rgba(214, 57, 57, 0.1);
}

.admin-inventory-grid__remove:disabled,
.admin-inventory-grid__remove.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.admin-inventory-grid__add {
    color: var(--tblr-primary, #206bc4);
    border-radius: 0.5rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.admin-inventory-grid__add:hover,
.admin-inventory-grid__add:focus {
    color: var(--tblr-primary, #206bc4);
    background-color: rgba(32, 107, 196, 0.1);
}

.admin-inventory-grid__add:disabled,
.admin-inventory-grid__add.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 1199.98px) {
    .admin-inventory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .admin-inventory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .admin-inventory-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.admin-map {
    width: 100%;
    height: 100%;
    min-height: 420px;
}

.admin-map__popup {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.admin-map__popup strong {
    font-size: 1rem;
}

@media (max-width: 1199.98px) {
    .admin-section--top,
    .admin-section--bottom {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }

    .admin-section--top {
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    .admin-section--top,
    .admin-section--bottom {
        grid-template-columns: 1fr;
    }
}

.markdown-body {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--tblr-body-color);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 1.5rem;
    font-weight: 600;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child,
.markdown-body h4:first-child,
.markdown-body h5:first-child,
.markdown-body h6:first-child {
    margin-top: 0;
}

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

.markdown-body table th,
.markdown-body table td {
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 0.5rem 0.75rem;
}

[data-bs-theme="dark"] .markdown-body table {
    border-color: rgba(148, 163, 184, 0.45);
}

[data-bs-theme="dark"] .markdown-body table th,
[data-bs-theme="dark"] .markdown-body table td {
    border-color: rgba(148, 163, 184, 0.45);
}

.markdown-body code,
.markdown-body pre {
    font-family: 'Fira Code', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.markdown-preview {
    background-color: var(--tblr-bg-surface-secondary);
}

[data-bs-theme="dark"] .markdown-preview {
    background-color: rgba(15, 23, 42, 0.35);
}
