@import url("../input.css");
@import url("../Dashboard/dashboard.css");
@import url("../Sidebar/sidebar.css");

/* TABLE / LISTA */
.table-wrapper {
    background: var(--cor-);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    box-shadow: 0 1px 3px var(--cor-preto-sombra);
}

.table-title {
    font-size: 18px;
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 10px 8px;
    text-align: left;
}

th {
    background: var(--cor-cinza-background);
    color: #555;
}

tr:nth-child(even) {
    background: var(--cor-cinza-background);
}

/* BOTÃO NOVO ITEM */
.new-btn {
    padding: 10px 16px;
    background: var(--cor-verde-logo);
    border: none;
    color: var(--cor-branco-primary);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
}

.new-btn:hover {
    background:var(--cor-verde-logo);
}

/* POPUP DE FORM */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: var(--cor-preto-sombra);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 900;
}

.popup-content {
    background: var(--cor-branco-primary);
    padding: 35px;
    border-radius: 8px;
    width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 12px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
}

.popup-content input,
.popup-content select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.popup-content input:focus,
.popup-content select:focus {
    border-color: #0077ff;
}

.save-btn {
    width: 100%;
    padding: 12px;
    background: #0077ff;
    border: none;
    border-radius: 6px;
    color: var(--cor-branco-primary);
    cursor: pointer;
}

.save-btn:hover {
    background: #0059c9;
}

/* Fundo escurecido */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:var(--cor-preto-sombra);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Caixa do modal */
.popup-content {
    background: var(--cor-branco-primary);
    padding: 32px;
    border-radius: 10px;
    width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Título */
.popup-content h2 {
    margin-bottom: 10px;
    color: #222;
    font-size: 22px;
}

/* Inputs */
.popup-content input,
.popup-content textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0 16px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border 0.2s;
}

.popup-content input:focus,
.popup-content textarea:focus {
    border-color: #0077ff;
}

/* Preview */
#preview {
    width: 120px;
    height: 120px;
    object-fit: contain;
    background:var(--cor-cinza-background);
    border-radius: 6px;
    margin: 10px 0;
}

/* Botões */
.save-btn {
    width: 100%;
    background: var(--cor-verde-logo);
    color: var(--cor-branco-primary);
    padding: 12px;
    margin-top: 10px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

.save-btn:hover {
    background: var(--cor-verde-logo);
}

.close-btn {
    position: absolute;
    right: 15px;
    top: 12px;
    font-size: 26px;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--cor-red-erro);
}


/* GRID DE CARDS */
.categoria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

/* CARD */
.categoria-card {
    background: var(--cor-branco-primary);
    border-radius: 10px;
    padding: 18px 15px;
    text-align: center;
    box-shadow: 0 2px 5px var(--cor-preto-sombra);
    transition: transform .15s ease, box-shadow .2s ease;
    cursor: pointer;
}

.categoria-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px var(--cor-preto-sombra);
}

/* Ícone */
.categoria-card img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Nome */
.categoria-card .cat-nome {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--cor-azul-fundo);
}

/* Descrição reduzida */
.categoria-card .cat-desc {
    font-size: 12px;
    color: #6d7a83;
    height: 30px;
    overflow: hidden;
}

/* Ações */
.categoria-card .cat-actions {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
}

.cat-actions button {
    font-size: 11px;
    padding: 6px 9px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}

/* Botões */
.btn-edit {
    background: #0077ff;
    color:var(--cor-branco-primary);
}

.btn-edit:hover {
    background: #005fcc;
}

.btn-del {
    background: var(--cor-red-erro);
    color: var(--cor-branco-primary);
}

.btn-del:hover {
    background: var(--cor-red-erro);
}

.alert-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
    display: none;
}

.alert-message {
    background: var(--cor-red-erro);
    color:var(--cor-branco-primary);
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 15px;
    min-width: 220px;
    box-shadow: 0 3px 10px var(--cor-preto-sombra);
    animation: slideIn .35s ease;
}

.alert-error { background:var(--cor-red-erro) !important; }
.alert-warning { background: #f4a261 !important; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(25px); }
    to   { opacity: 1; transform: translateX(0); }
}

.save-btn.red { background:var(--cor-red-erro); }
.save-btn.red:hover { background:var(--cor-red-erro); }


/* GRID DE MARCAS */
.marca-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    padding-top: 10px;
}

/* CARD DAS MARCAS */
.marca-card {
    background:var(--cor-branco-primary);
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: .2s ease;
    box-shadow: 0 2px 6px var(--cor-preto-sombra);
}

.marca-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px var(--cor-preto-sombra);
}

/* Metade superior -> imagem */
.marca-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* Nome e descrição */
.marca-nome {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin-top: 12px;
}

.marca-desc {
    font-size: 13px;
    text-align: center;
    color: #666;
    margin: 4px 10px 10px;
}

/* Ações */
.marca-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-bottom: 14px;
}

.btn-edit,
.btn-del {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    border: none;
    color: var(--cor-branco-primary);
}

.btn-edit {
    background: #0077ff;
}

.btn-edit:hover {
    background: #005fcc;
}

.btn-del {
    background: var(--cor-red-erro);
}

.btn-del:hover {
    background: var(--cor-red-erro);
}
