/* ======== PANEL DE ADMINISTRADOR ======== */

.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(5px);
}

.admin-modal-content {
    width: 94%;
    max-width: 1020px;
    height: 86vh;
    max-height: 860px;
    background: #0c0505;
    border: 2px solid #dc2626;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.25), 0 0 120px rgba(0,0,0,0.9);
    overflow: hidden;
}

/* --- Cabecera --- */
.admin-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: #1a0505;
    border-bottom: 1px solid #7f1d1d;
    flex-shrink: 0;
}

.admin-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.admin-title {
    font-size: 0.82rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    color: #fca5a5;
    flex: 1;
}

.admin-player-name {
    font-size: 0.78rem;
    color: #6b7280;
}

.admin-player-name b {
    color: #f87171;
}

.admin-tabs {
    display: flex;
    gap: 4px;
}

.admin-tab {
    background: transparent;
    border: 1px solid #7f1d1d;
    color: #9ca3af;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-tab:hover {
    border-color: #dc2626;
    color: #fca5a5;
}

.admin-tab.active {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
    font-weight: bold;
}

.admin-close-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.admin-close-btn:hover {
    color: #fff;
    background: rgba(220,38,38,0.25);
}

/* --- Cuerpo --- */
.admin-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.admin-tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
    padding: 20px 24px;
    overflow-y: auto;
    gap: 20px;
}

.admin-tab-content.active {
    display: flex;
}

/* --- Secciones --- */
.admin-section {
    background: rgba(69, 10, 10, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-section-title {
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    color: #f87171;
    text-transform: uppercase;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(220,38,38,0.2);
}

/* --- Fila de controles --- */
.admin-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-label {
    font-size: 0.8rem;
    color: #9ca3af;
    min-width: 90px;
}

.admin-input {
    background: #1a0505;
    border: 1px solid #7f1d1d;
    color: #fca5a5;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.85rem;
    width: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.admin-input:focus {
    border-color: #dc2626;
}

.admin-input-wide {
    width: 160px;
}

/* --- Botones --- */
.admin-btn {
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 0.04em;
    transition: all 0.18s;
    white-space: nowrap;
}

.admin-btn-primary {
    background: #dc2626;
    color: #fff;
    border: 1px solid #ef4444;
}

.admin-btn-primary:hover {
    background: #b91c1c;
    box-shadow: 0 0 10px rgba(220,38,38,0.4);
}

.admin-btn-secondary {
    background: transparent;
    color: #9ca3af;
    border: 1px solid #374151;
}

.admin-btn-secondary:hover {
    color: #fca5a5;
    border-color: #dc2626;
}

.admin-btn-sm {
    padding: 5px 10px;
    font-size: 0.72rem;
}

.admin-btn-danger {
    background: #1a0505;
    color: #f87171;
    border: 1px solid #7f1d1d;
}

.admin-btn-danger:hover {
    background: #450a0a;
    box-shadow: 0 0 8px rgba(248,113,113,0.2);
}

.admin-btn-success {
    background: #052e16;
    color: #4ade80;
    border: 1px solid #166534;
}

.admin-btn-success:hover {
    background: #14532d;
    box-shadow: 0 0 8px rgba(74,222,128,0.2);
}

/* --- Grupo de botones rápidos --- */
.admin-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* --- Stats grid --- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.admin-stat-card {
    background: rgba(26,5,5,0.6);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-stat-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.admin-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.admin-stat-name {
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-stat-current {
    font-size: 1rem;
    font-weight: bold;
    color: #fca5a5;
}

.admin-stat-input {
    width: 70px;
}

/* --- Tab Inventario: layout split --- */
.admin-inv-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    height: 100%;
    overflow: hidden;
}

.admin-inv-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.admin-inv-panel-title {
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.12em;
    color: #f87171;
    text-transform: uppercase;
    flex-shrink: 0;
}

.admin-inv-scroll {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

/* Catálogo: grid compacto */
.admin-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
}

.admin-catalog-item {
    background: rgba(26,5,5,0.5);
    border: 1px solid rgba(220,38,38,0.15);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.admin-catalog-item:hover {
    border-color: rgba(220,38,38,0.5);
    background: rgba(69,10,10,0.4);
}

.admin-catalog-item-sprite {
    background-image: url('../../assets/img/game/items/items.webp');
    background-size: 900% 500%;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.admin-catalog-item-name {
    font-size: 0.74rem;
    color: #d1d5db;
    line-height: 1.3;
}

.admin-catalog-item-rarity {
    font-size: 0.64rem;
    color: #4b5563;
}

/* Inventario actual del jugador */
.admin-inv-item {
    background: rgba(26,5,5,0.5);
    border: 1px solid rgba(220,38,38,0.12);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-inv-item-sprite {
    background-image: url('../../assets/img/game/items/items.webp');
    background-size: 900% 500%;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.admin-inv-item-info {
    flex: 1;
    min-width: 0;
}

.admin-inv-item-name {
    font-size: 0.78rem;
    color: #d1d5db;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-inv-item-rarity {
    font-size: 0.65rem;
    color: #4b5563;
}

.admin-inv-empty {
    font-size: 0.8rem;
    color: #4b5563;
    text-align: center;
    padding: 20px 0;
}

/* --- Status bar --- */
.admin-footer {
    padding: 8px 20px;
    border-top: 1px solid #1a0505;
    font-size: 0.78rem;
    color: #f87171;
    flex-shrink: 0;
    min-height: 34px;
    background: #0c0505;
}

/* --- Responsive --- */
@media (max-width: 700px) {
    .admin-modal-content { width: 99%; height: 97vh; }
    .admin-inv-layout { grid-template-columns: 1fr; }
    .admin-tabs { overflow-x: auto; }
    .admin-stats-grid { grid-template-columns: 1fr; }
}
