/* ============================================================================
   SISTEMA DE COFRES E ARMAZÉNS (PERSISTENTE)
============================================================================ */
#cofre-master-container {
    position: fixed;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 900px; /* Largura ajustada para caber a sidebar */
    max-height: 85vh;
    background: #110a05 url('https://www.transparenttextures.com/patterns/wood-pattern.png');
    border: 4px solid #5a3c22;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.95), inset 0 0 30px rgba(0,0,0,0.8);
    z-index: 10000;
    display: none;
    flex-direction: column;
    font-family: 'Georgia', serif;
    color: #e0d8c8;
    overflow: hidden;
}

/* NOVO: CORPO COM SIDEBAR */
#cofre-body-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#cofre-sidebar {
    width: 220px;
    background: rgba(0,0,0,0.6);
    border-right: 2px solid #3a2514;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: inset -5px 0 15px rgba(0,0,0,0.5);
}

#cofre-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
}

/* BUSCA INTELIGENTE */
.cofre-search-container {
    padding: 10px 20px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid #3a2514;
    display: flex;
    align-items: center;
    gap: 10px;
}

#cofre-search-input {
    flex: 1;
    background: #000;
    border: 1px solid #444;
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: 0.3s;
    border: 1px solid #5a3c22;
}

#cofre-search-input:focus {
    border-color: #ffca28;
    box-shadow: 0 0 12px rgba(255, 202, 40, 0.2);
}

/* ABAS DE PRATELEIRAS (SHELVES) */
.shelf-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
}

.shelf-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: linear-gradient(to bottom, #2b180d, #1a110a);
    border: 1px solid #5a3c22;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #d4af37;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s ease-in-out;
    position: relative;
    box-shadow: 0 3px 5px rgba(0,0,0,0.3);
}

.shelf-item:hover {
    background: #3a2514;
    border-color: #ffca28;
    color: #fff;
    transform: translateX(3px);
}

.shelf-item.active {
    background: linear-gradient(to bottom, #d4af37, #b8860b);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.shelf-item.active::after {
    content: '▶';
    position: absolute;
    right: 10px;
    font-size: 10px;
}

.shelf-item.dragover {
    border: 2px solid #00e676 !important;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.5) !important;
    transform: scale(1.05);
}

.btn-add-shelf {
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    margin-top: auto;
    font-size: 11px;
    text-transform: uppercase;
    transition: 0.2s;
}
.btn-add-shelf:hover { background: #388e3c; }

.cofre-header {
    background: linear-gradient(to bottom, #3a2514, #110a05);
    padding: 15px;
    border-bottom: 2px solid #d4af37;
    text-align: center;
    position: relative;
    cursor: grab; /* Mostra a mãozinha avisando que pode mover */
    user-select: none; /* Impede que o texto fique azul ao arrastar */
}
.cofre-header:active {
    cursor: grabbing; /* A mãozinha "fecha" quando segura */
}

.cofre-header h2 { margin: 0; color: #ffca28; text-shadow: 1px 1px 3px #000; font-size: 24px; }
.cofre-header small { color: #aaa; font-style: italic; font-size: 12px; }

.cofre-grid {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
    padding: 20px; overflow-y: auto; background: rgba(0,0,0,0.5); flex: 1;
}

.cofre-slot {
    border: 2px dashed #5a3c22; min-height: 70px; background: #1a110a;
    border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; transition: 0.2s;
}
.cofre-slot.dragover { border-color: #4caf50; background: #2e3b2e; }

/* Indicador de Permissão */
.cofre-permission-banner {
    padding: 8px; text-align: center; font-weight: bold; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
}
.perm-total { background: #1b5e20; color: #fff; } /* Adicionar e Tirar */
.perm-add { background: #e65100; color: #fff; } /* Só Adicionar */
.perm-read { background: #424242; color: #aaa; } /* Só ver */

.cofre-settings {
    padding: 15px; background: #000; border-top: 1px solid #5a3c22; display: none;
}

/* Painel Financeiro do Baú */
.cofre-moedas-container {
    display: flex; gap: 8px; padding: 10px 15px;
    background: linear-gradient(to bottom, #110a05, #000);
    border-bottom: 2px dashed #5a3c22; justify-content: space-between;
}
.cofre-moeda { display: flex; flex-direction: column; align-items: center; flex: 1; }
.cofre-moeda small { font-weight: bold; color: #ffca28; font-size: 11px; margin-bottom: 3px; letter-spacing: 1px; }
.cofre-moeda input { width: 100%; background: rgba(0,0,0,0.6); color: #fff; border: 1px solid #444; border-radius: 4px; text-align: center; padding: 6px 2px; font-weight: bold; font-family: monospace; font-size: 14px; transition: 0.2s; box-sizing: border-box; }
.cofre-moeda input:focus { border-color: #ffca28; outline: none; background: #000; }
.cofre-moeda input:disabled { color: #666; border-color: #222; background: #111; cursor: not-allowed; }

