/* admin/admin.css - VERSÃO FINAL CORRIGIDA */
* { box-sizing:border-box; }
body { margin:0; font-family:Arial, Helvetica, sans-serif; background:#f4f6f8; color:#333; }

/* MENU E LAYOUT */
.admin-menu {
  width:260px; background:#263238; color:#fff;
  padding:20px 0; position:fixed; top:0; bottom:0; left:0;
  overflow-y: auto; z-index: 100;
}
.admin-menu a { display:block; padding:12px 20px; color:#cfd8dc; text-decoration:none; font-size:14px; border-left: 4px solid transparent; }
.admin-menu a:hover { background:#37474f; color:#fff; border-left-color: #0277bd; }
.admin-content { margin-left:260px; padding:24px; width:calc(100% - 260px); }

/* COMPONENTES */
.card { background:#fff; border-radius:12px; padding:20px; margin-bottom:20px; box-shadow:0 2px 6px rgba(0,0,0,.05); }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:10px 16px; border:none; border-radius:6px; background:#cfd8dc; color:#37474f; cursor:pointer; font-size:14px; text-decoration:none; }
.btn-primary { background: #0277bd; color: white; }
.btn-danger { background: #ef5350; color: white; }

/* === CORREÇÃO DO GRID DE FOTOS === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}
.foto {
    border: 1px solid #eee; border-radius: 8px; padding: 8px; background: #fafafa;
    display: flex; flex-direction: column; height: 100%;
}
.foto img {
    width: 100%; height: 140px; object-fit: cover; border-radius: 6px; display: block;
}
.foto .nome {
    font-size: 12px; margin-top: 8px; color: #555;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.foto-acoes { margin-top: auto; padding-top: 8px; }
.foto-acoes .btn { width: 100%; padding: 6px; font-size: 12px; }

/* UPLOAD E MODAL */
.drop-zone { border: 2px dashed #cfd8dc; border-radius: 8px; padding: 30px; text-align: center; background: #fafafa; cursor: pointer; margin-bottom: 20px; }
.drop-zone:hover { background: #e1f5fe; border-color: #0277bd; }
.upload-list { margin-top:10px; border-top:1px solid #eee; padding-top:10px; max-height: 200px; overflow-y: auto; }
.upload-item { display:flex; align-items:center; gap:8px; font-size:12px; padding:6px; border-bottom:1px solid #f2f2f2; }

/* MODAL DE SELEÇÃO */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; justify-content: center; align-items: center; z-index: 2000; }
.modal-box { background: #fff; padding: 25px; border-radius: 12px; width: 90%; max-width: 800px; max-height: 90vh; display: flex; flex-direction: column; }
.grid-selecao { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; overflow-y: auto; padding: 10px; background: #f9f9f9; border: 1px solid #eee; margin-top: 15px; min-height: 200px; }
.item-sel { position: relative; cursor: pointer; border: 3px solid transparent; border-radius: 6px; overflow: hidden; background: #fff; }
.item-sel img { width: 100%; height: 100px; object-fit: cover; display: block; }
.item-sel.selected { border-color: #0277bd; }
.item-sel.selected::after { content: '✓'; position: absolute; top:0; right:0; background:#0277bd; color:#fff; padding:2px 6px; font-size:10px; }