/* =============================================================
   Admin Entity Index Layout - Shared between NPCs, Mobs, etc.
   ============================================================= */

.admin-index-container {
    display: flex;
    gap: 1rem;
    position: relative;
    min-height: calc(100vh - 220px);
    flex-wrap: wrap;
}

.admin-filter-panel {
    width: 280px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    position: sticky;
    top: 1rem;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.admin-filter-panel.collapsed {
    width: 50px;
    padding: 0.5rem;
}

.admin-filter-panel.collapsed .admin-filter-content {
    display: none;
}

.admin-filter-toggle {
    cursor: pointer;
    font-size: 1.1rem;
    text-align: center;
    padding: 0.45rem;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.admin-filter-panel.collapsed .admin-filter-toggle {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin-bottom: 0;
}

.admin-filter-group {
    margin-bottom: 1.35rem;
}

.admin-filter-group__title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--bs-secondary);
    letter-spacing: 0.05em;
}

.admin-main-content {
    flex: 1;
    min-width: 0;
}

.admin-actions-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.admin-search-box {
    flex: 1;
    min-width: 260px;
}

.admin-results-info {
    margin-bottom: 0.5rem;
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.entity-stat-card {
    border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
    border-radius: 0.85rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.05), var(--bs-body-bg));
    height: 100%;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.entity-stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bs-secondary);
}

.entity-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.entity-stat-subtext {
    font-size: 0.85rem;
    color: var(--bs-secondary);
}

.admin-entity-table {
    background: var(--bs-body-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
}

.admin-entity-table table {
    margin-bottom: 0;
}

.admin-entity-table tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.admin-entity-table tbody tr:hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
}

.admin-entity-table tbody tr[data-hidden="true"] {
    display: none;
}

.npc-row-badges {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.npc-role-pill {
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    font-weight: 600;
}

.npc-role-pill--merchant {
    background: rgba(25, 135, 84, 0.18);
    color: #198754;
}

.npc-role-pill--quest {
    background: rgba(255, 193, 7, 0.2);
    color: #c57a00;
}

.npc-faction-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.25);
    font-weight: 600;
}

.npc-boolean-icon {
    font-size: 1.1rem;
}

.admin-world-cell {
    min-width: 160px;
}

.admin-world-cell .area-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.admin-world-cell .room-subtext {
    font-size: 0.82rem;
    color: var(--bs-secondary);
    display: block;
}

.admin-world-cell .room-subtext a {
    color: inherit;
    border-bottom: 1px dashed transparent;
    text-decoration: none;
}

.admin-world-cell .room-subtext a:hover {
    border-bottom-color: currentColor;
    color: var(--bs-primary);
}

.admin-flyout-preview {
    position: fixed;
    top: 80px;
    width: 350px;
    max-height: calc(100vh - 110px);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
    padding: 1.25rem;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.admin-flyout-preview.left {
    left: -370px;
}

.admin-flyout-preview.left.active {
    transform: translateX(370px);
}

.admin-flyout-preview.right {
    right: -370px;
}

.admin-flyout-preview.right.active {
    transform: translateX(-370px);
}

.admin-flyout-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    background: transparent;
    border: none;
    font-size: 1.35rem;
    color: var(--bs-secondary);
    cursor: pointer;
}

.admin-flyout-close:hover {
    color: var(--bs-danger);
}

.admin-flyout-image,
.flyout-image,
.admin-flyout-placeholder {
    width: 100%;
    max-width: 100%;
    max-height: 260px;
    height: auto;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    object-fit: cover;
    background: var(--bs-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary);
}

.flyout-image,
.admin-flyout-preview img.flyout-image {
    display: block;
    width: 100%;
    max-width: 100%;
    object-fit: contain;
    background: var(--bs-body-bg);
}

.admin-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bs-body-bg);
    border-radius: 0.75rem;
    border: 1px solid var(--bs-border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.admin-stat-badge.health {
    background: rgba(220, 53, 69, 0.18);
    color: #dc3545;
}

.admin-stat-badge.attack {
    background: rgba(255, 193, 7, 0.18);
    color: #ff9800;
}

.admin-stat-badge.defense {
    background: rgba(13, 110, 253, 0.18);
    color: #0d6efd;
}

.admin-filter-helper {
    font-size: 0.8rem;
    color: var(--bs-secondary);
}

/* =============================================================
   Inventory Grid Styling
   ============================================================= */

.admin-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.9rem;
}

.admin-inventory-slot {
    position: relative;
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    padding: 1rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.admin-inventory-slot:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 45px rgba(15, 23, 42, 0.24);
}

.admin-inventory-slot__icon {
    width: 78px;
    height: 78px;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: linear-gradient(145deg, rgba(148, 163, 184, 0.15), rgba(15, 23, 42, 0.35));
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.admin-inventory-slot__icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.35));
}

.admin-inventory-slot__badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-weight: 700;
    font-size: 0.78rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.admin-inventory-slot__name {
    font-weight: 600;
    font-size: 0.92rem;
}

.admin-inventory-slot__tags {
    margin-top: 0.55rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.admin-inventory-slot__tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    border: 1px dashed var(--bs-border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-inventory-remove {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 2;
}

@media (max-width: 992px) {
    .admin-index-container {
        flex-direction: column;
    }

    .admin-filter-panel {
        width: 100%;
        position: relative;
        max-height: none;
    }

    .admin-filter-panel.collapsed {
        width: 100%;
    }
}
