/* ... todo o seu CSS existente ... */
/* --- FONTES E VARIÁVEIS GLOBAIS --- */
@font-face { font-family: 'TOTVS'; src: url('fonts/TOTVS-Regular.ttf') format('truetype'); font-weight: 400; }
@font-face { font-family: 'TOTVS'; src: url('fonts/TOTVS-Bold.ttf') format('truetype'); font-weight: 700; }

:root {
    --glow-blue: rgba(0, 219, 255, 0.25);
    --glow-purple: rgba(164, 77, 255, 0.25);
}

/* --- RESET E ESTILOS GLOBAIS DO BODY --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Verdana, sans-serif;
    font-weight: 400;
    background-color: #002233;
    color: #FFFFFF;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Prevenir scroll horizontal */
}

h1, h2, h3, h4, h5, h6,
.card-text,
.header-title,
button,
.tool-button,
.back-button,
.tool-notification,
.switch-form a,
.link-copy,
.tab-button,
.asset-card h3, /* Adicionado */
.asset-tags .more-tags /* Adicionado */ {
    font-family: 'TOTVS', sans-serif;
    font-weight: 700; /* Negrito */
}

input, select, textarea {
    font-family: Verdana, sans-serif;
    font-weight: 400;
}


/* --- FUNDO ANIMADO (AURORA) --- */
.aurora-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden;
}
.aurora-blob {
    position: absolute; border-radius: 50%; filter: blur(150px);
}
.aurora-blob:nth-child(1) {
    width: 600px; height: 600px; background: var(--glow-blue);
    top: -20%; left: -15%; animation: moveAurora1 15s infinite alternate;
}
.aurora-blob:nth-child(2) {
    width: 550px; height: 550px; background: var(--glow-purple);
    bottom: -25%; right: -20%; animation: moveAurora2 20s infinite alternate-reverse;
}
@keyframes moveAurora1 { 50% { transform: translate(30vw, 40vh) scale(1.2); } }
@keyframes moveAurora2 { 50% { transform: translate(-35vw, -30vh) scale(1.3); } }


/* --- ESTRUTURA PRINCIPAL (INDEX.PHP) --- */
.app-shell {
    display: flex; flex-direction: column; height: 100vh;
    overflow: hidden; opacity: 0; visibility: hidden;
    transition: opacity 0.5s ease-in-out;
}
.app-shell.visible { opacity: 1; visibility: visible; }

.main-header {
    width: 100%; padding: 1.5rem 3rem; display: flex;
    justify-content: space-between; align-items: center;
    background: rgba(10, 25, 40, 0.5); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.header-title { font-size: 1.8rem; }
.header-title .dn-span { color: #00DBFF; }
.user-actions { display: flex; align-items: center; gap: 1.5rem; }
/* #user-greeting removido - estava no profile dropdown */
/* #logout-button removido - agora está no profile dropdown */
#content-area {
    flex-grow: 1; overflow-y: auto; padding: 3rem 2rem;
    position: relative; min-height: 0;
}
#content-area::-webkit-scrollbar { width: 5px; }
#content-area::-webkit-scrollbar-track { background: transparent; }
#content-area::-webkit-scrollbar-thumb { background: rgba(0, 219, 255, 0.5); border-radius: 10px; }


/* --- ESTILOS PARA PÁGINAS DE FORMULÁRIO (LOGIN/REGISTO) --- */
.form-body {
    display: flex; justify-content: center; align-items: center; padding: 2rem;
    height: 100vh; /* Garante altura total */
}
.form-container {
    width: 100%; max-width: 400px; padding: 3rem; border-radius: 24px;
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; gap: 1.5rem;
}
.form-container h1 { font-size: 2.5rem; text-align: center; margin-bottom: 1rem; color: #00DBFF; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-container input { width: 100%; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.1); color: #FFFFFF; font-size: 1rem; transition: border-color 0.3s, box-shadow 0.3s; }
.form-container input:focus { outline: none; border-color: #00DBFF; box-shadow: 0 0 15px rgba(0, 219, 255, 0.3); }
.form-container button { width: 100%; padding: 0.9rem 1.5rem; border-radius: 12px; border: none; background-color: #00DBFF; color: #002233; font-size: 1.1rem; cursor: pointer; transition: background-color 0.3s, transform 0.2s; }
.form-container button:hover { background-color: #80f1ff; transform: scale(1.02); }
.switch-form-container { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem;}
.switch-form { text-align: center; }
.switch-form a { color: #00DBFF; text-decoration: none; }
.switch-form a:hover { text-decoration: underline; }
.error-message { color: #ff8a8a; text-align: center; min-height: 1.2em; display: none; font-family: Verdana, sans-serif; font-weight: 700;}


/* --- ESTILOS DOS CARDS (DASHBOARD) --- */
.main-container-content {
    display: flex; flex-direction: column; align-items: center; gap: 2rem;
}
.cards-container {
    display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
    perspective: 1000px; width: 100%; max-width: 1250px;
}
.card {
    width: 220px; height: 180px; /* Altura fixa */
    border-radius: 24px; position: relative;
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(20px);
    transform-style: preserve-3d; transition: transform 0.1s ease-out, box-shadow 0.3s ease-out;
    display: flex; flex-direction: column; align-items: center; justify-content: center; /* Centraliza verticalmente */
    gap: 1rem; text-decoration: none; color: #FFFFFF; padding: 1.5rem;
    overflow: hidden; /* Garante que o conteúdo não vaze */
}

.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 24px; z-index: -1; border: 1px solid transparent; background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05)) border-box; -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.card:hover { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); }
.card:hover::before { animation: shine 1.5s infinite; }
@keyframes shine { 50% { background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.4)) border-box; } }
.card-icon { transform: translateZ(20px); }
.card-icon svg { width: 50px; height: 50px; color: #FFFFFF; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2)); }
.card-content { transform: translateZ(20px); text-align: center; }
.card-text { font-size: 1.2rem; margin-bottom: 0.5rem; /* Ajuste espaço */ }
.card-description { font-size: 0.8rem; color: #a0c3d2; line-height: 1.3; }


/* --- ESTILOS GENÉRICOS DE FERRAMENTAS --- */
.back-button {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: #00DBFF; text-decoration: none;
    position: absolute; top: 3rem; left: 2rem; z-index: 10; /* Garante que fica acima */
}
.back-button svg { width: 1.2em; }
.tool-header { text-align: center; margin-bottom: 2rem; position: relative; /* Para z-index funcionar */ z-index: 5; }
.tool-header h1 { font-size: 2.5rem; }
.tool-header p { color: #a0c3d2; }
.tool-notification { padding: 1rem; border-radius: 12px; margin: 0 auto 2rem auto; max-width: 800px; text-align: center; }
.tool-notification.success { background: rgba(45, 211, 111, 0.1); border: 1px solid rgba(45, 211, 111, 0.2); color: #2dd36f; }
.tool-notification.error { background: rgba(255, 100, 100, 0.1); border: 1px solid rgba(255, 100, 100, 0.2); color: #ff8a8a; }
.tool-notification .link-display { background: rgba(0,0,0,0.2); padding: 0.5rem; border-radius: 8px; margin-top: 0.5rem; font-family: monospace; font-size: 0.9rem; word-break: break-all; }


/* --- ESTILOS DA FERRAMENTA DN CAPTURE --- */
.capture-form-container { padding: 1.5rem; border-radius: 1rem; width: 100%; max-width: 800px; margin: 0 auto; }
.capture-form-container .input-wrapper { display: flex; gap: 1rem; }
.capture-form-container input { flex-grow: 1; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.2); color: #FFFFFF; font-size: 1rem; transition: border-color 0.3s, box-shadow 0.3s; }
.capture-form-container input:focus { outline: none; border-color: #00DBFF; box-shadow: 0 0 15px rgba(0, 219, 255, 0.3); }
.capture-form-container button { padding: 0.8rem 1.5rem; border-radius: 12px; border: none; background-color: #00DBFF; color: #002233; font-size: 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; transition: background-color 0.3s, transform 0.2s; white-space: nowrap; }
.loader { border: 4px solid rgba(0, 0, 0, 0.2); border-left-color: #002233; border-radius: 50%; width: 20px; height: 20px; animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } .hidden { display: none !important; }
#results-area { width: 100%; margin-top: 2rem; } .loading-results { text-align: center; padding: 3rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; } .error-message-box { padding: 1rem; background: rgba(255, 100, 100, 0.1); border: 1px solid rgba(255, 100, 100, 0.2); text-align: center; border-radius: 1rem; } .results-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; background: rgba(0,0,0,0.2); border-radius: 1rem; margin-bottom: 1rem; }
.results-controls .selection-group button, .results-controls .filter-group select { padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.05); color: #FFFFFF; cursor: pointer; transition: background-color 0.3s, border-color 0.3s; }
.results-controls .selection-group button:hover, .results-controls .filter-group select:hover { background-color: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.4); }
.results-controls .filter-group select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%23ffffff' class='w-6 h-6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 1em; padding-right: 2.5rem; }
.results-controls .filter-group { display: flex; align-items: center; gap: 0.5rem; } .results-controls .selection-group { display: flex; gap: 0.5rem; }
#image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; } .image-card { border-radius: 12px; background: rgba(255,255,255,0.05); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: transform 0.2s; } .image-card:hover { transform: scale(1.03); } .image-card.selected { border-color: #00DBFF; } .image-preview { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.1); } .image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; } .checkbox-overlay { position: absolute; top: 0.5rem; left: 0.5rem; width: 1.5rem; height: 1.5rem; background: #00DBFF; color: #002233; border-radius: 6px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; } .image-card.selected .checkbox-overlay { opacity: 1; } .checkbox-overlay svg { width: 1rem; height: 1rem; } .extension-tag { position: absolute; top: 0.5rem; right: 0.5rem; background: rgba(0,0,0,0.5); padding: 0.2rem 0.5rem; font-size: 0.75rem; border-radius: 6px; } .image-actions { display: flex; gap: 0.5rem; padding: 0.5rem; } .image-actions button, .image-actions a { flex-grow: 1; text-align: center; background: rgba(255,255,255,0.1); padding: 0.5rem; border-radius: 8px; font-size: 0.8rem; border: none; color: white; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; } .image-actions a svg { width: 1rem; height: 1rem; } .fixed-action-bar { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); padding: 1rem; display: flex; gap: 1rem; align-items: center; background: rgba(0, 219, 255, 0.9); backdrop-filter: blur(10px); color: #002233; border-radius: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.3); z-index: 20; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; } .fixed-action-bar.visible { opacity: 1; visibility: visible; } .fixed-action-bar button { background: #002233; color: white; }

/* --- ESTILOS DA FERRAMENTA DN REDIRECT --- */
.tool-card {
    background: rgba(0, 0, 0, 0.2); border-radius: 1rem;
    padding: 2rem; width: 100%; max-width: 1100px; margin: 0 auto 2rem auto;
}
.tool-card h2 { font-size: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 1rem; }
.tool-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.tool-form .form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.tool-form label { font-family: Verdana, sans-serif; font-weight: 700; font-size: 0.9rem; color: #a0c3d2; }
.tool-form input, .tool-form select, .tool-form textarea { width: 100%; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.2); color: #FFFFFF; font-size: 1rem; transition: border-color 0.3s, box-shadow 0.3s; }
.tool-form input:focus, .tool-form select:focus, .tool-form textarea:focus { outline: none; border-color: #00DBFF; box-shadow: 0 0 15px rgba(0, 219, 255, 0.3); }
.tool-form textarea { min-height: 100px; resize: vertical; }
.tool-form .custom-code-wrapper { display: flex; align-items: center; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 12px; padding-left: 1rem; }
.tool-form .custom-code-wrapper span { color: #a0c3d2; opacity: 0.7; }
.tool-form .custom-code-wrapper input { background: transparent; border: none; padding-left: 0.5rem; }
.tool-form .custom-code-wrapper input:focus { box-shadow: none; }
.tool-form .form-actions { margin-top: 1.5rem; display: flex; gap: 1rem; }
.tool-button { padding: 0.8rem 1.5rem; border-radius: 12px; border: none; font-size: 1rem; cursor: pointer; text-decoration: none; display: inline-block; transition: background-color 0.3s, transform 0.2s, color 0.3s; white-space: nowrap; }
.tool-button.small { padding: 0.6rem 1rem; font-size: 0.9rem; } /* Botão pequeno */
.tool-button.primary { background-color: #00DBFF; color: #002233; }
.tool-button.primary:hover { background-color: #80f1ff; transform: scale(1.02); }
.tool-button.secondary { background-color: transparent; border: 1px solid rgba(255, 255, 255, 0.2); color: white; }
.tool-button.secondary:hover { background-color: rgba(255, 255, 255, 0.1); }
.tool-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; } /* Estado desabilitado */
.table-container { overflow-x: auto; }
.tool-table { width: 100%; border-collapse: collapse; }
.tool-table th, .tool-table td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.tool-table th { font-size: 0.8rem; text-transform: uppercase; color: #a0c3d2; }
.tool-table td { font-size: 0.9rem; }
.tool-table .link-copy { color: #00DBFF; cursor: pointer; }
.tool-table .action-buttons { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; }
.tool-table .action-buttons a, .tool-table .action-buttons button, .action-btn { background: none; border: none; color: #a0c3d2; cursor: pointer; transition: color 0.3s; padding: 0.25rem; }
.tool-table .action-buttons a:hover, .tool-table .action-buttons button:hover, .action-btn:hover { color: white; }
.tool-table .action-buttons svg, .action-btn svg { width: 1.25rem; height: 1.25rem; }
.action-btn { font-size: 1.5rem; line-height: 1; } /* Para botões X, etc */


/* --- ESTILOS DOS MODAIS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    overflow-y: auto; /* Permite scroll no overlay se o modal for maior que a tela */
    padding: 2rem 0; /* Espaçamento para o scroll */
}
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal-content {
    background: rgba(10, 25, 40, 0.8); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem; padding: 2rem; width: 90%; max-width: 500px; /* Ajustado para mobile */
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: scale(0.95); transition: transform 0.3s;
    position: relative;
    margin: auto; /* Centraliza verticalmente quando há scroll */
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-content.large { max-width: 750px; }
.modal-content h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.modal-content p { color: #a0c3d2; margin-bottom: 1.5rem; }
.modal-content .form-actions { justify-content: flex-end; flex-wrap: wrap; /* Quebra linha em mobile */ }
.modal-content .form-group { margin-bottom: 1rem; }
.modal-close-button {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; color: #a0c3d2;
    font-size: 2rem; cursor: pointer; line-height: 1;
    transition: color 0.3s;
}
.modal-close-button:hover { color: white; }
.modal-subtitle { margin-top: -1rem; font-size: 1rem; }
.modal-cards-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap; /* Quebra linha em mobile */
}

/* --- ESTILOS DA PÁGINA DE ADMINISTRAÇÃO --- */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    overflow-x: auto; /* Permite scroll horizontal em mobile */
    -webkit-overflow-scrolling: touch; /* Melhora scroll em iOS */
}
.tab-button {
    background: none;
    border: none;
    color: #a0c3d2;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
    white-space: nowrap; /* Impede quebra de linha */
    flex-shrink: 0; /* Impede que encolham */
}
.tab-button:hover {
    color: #FFFFFF;
}
.tab-button.active {
    color: #00DBFF;
    border-bottom-color: #00DBFF;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.admin-badge {
    background-color: #00DBFF;
    color: #002233;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'TOTVS', sans-serif;
    font-weight: 700;
}
.uid-cell {
    font-family: monospace;
    font-size: 0.8rem;
    color: #a0c3d2;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tool-table .action-buttons .action-btn:disabled {
    color: #556a74;
    cursor: not-allowed;
    opacity: 0.5;
}
.tool-button.danger {
    background: #e53e3e;
    color: white;
}
.tool-button.danger:hover {
    background: #c53030;
}

/* --- NOVOS ESTILOS - GESTÃO DE CARDS (Admin) --- */
#cards-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}
.card-manage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-manage-item.disabled {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.4);
}
.card-drag-handle {
    cursor: grab;
    color: #a0c3d2;
}
.card-drag-handle:active {
    cursor: grabbing;
}
.card-manage-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.card-manage-icon svg {
    width: 100%;
    height: 100%;
}
.card-manage-info {
    flex-grow: 1;
}
.card-manage-info strong {
    font-size: 1.1rem;
}
.card-manage-info p {
    font-size: 0.9rem;
    color: #a0c3d2;
}
.card-manage-actions {
    display: flex;
    gap: 0.5rem;
}
/* Estilo para o item a ser arrastado (ghost) */
.sortable-ghost {
    background: rgba(0, 219, 255, 0.2);
    opacity: 0.7;
}
.sortable-chosen {
    cursor: grabbing;
}

/* --- NOVOS ESTILOS - GESTÃO DE CATEGORIAS (Admin) --- */
#add-category-form { /* Estilo para o form inline */
    display: flex;
    gap: 1rem;
    align-items: flex-end; /* Alinha botão com input */
    margin-bottom: 1.5rem;
}
#add-category-form .form-group {
    flex-grow: 1; /* Input ocupa espaço */
    margin-bottom: 0; /* Remove margem padrão */
}
#add-category-form .form-actions {
    margin-top: 0; /* Remove margem padrão */
    align-self: flex-end; /* Alinha botão */
}
#categories-list {
    list-style: none;
    margin-top: 1rem;
}
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.category-item span {
    color: #e0e0e0;
}
.category-item-loading, .category-item-error {
    color: #a0c3d2;
    padding: 1rem;
    text-align: center;
}
.category-item-error {
    color: #ff8a8a;
    background: rgba(255, 100, 100, 0.05);
    border-radius: 8px;
}

/* --- NOVOS ESTILOS - UPLOAD DE ASSETS (Admin) --- */
.asset-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
    margin-bottom: 2rem;
}
.asset-upload-zone:hover, .asset-upload-zone.highlight {
    border-color: #00DBFF;
    background-color: rgba(0, 219, 255, 0.05);
}
.asset-upload-zone .upload-icon svg {
    width: 50px;
    height: 50px;
    color: #a0c3d2;
    margin-bottom: 1rem;
}
.asset-upload-zone p {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}
.asset-upload-zone .upload-hint {
    color: #a0c3d2;
    font-size: 0.9rem;
}
.asset-upload-zone .upload-hint.small {
    font-size: 0.8rem;
    margin-top: 1rem;
}
.asset-upload-zone button {
    margin-top: 1rem;
}
.asset-upload-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}
.progress-bar-container {
    flex-grow: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #00DBFF;
    border-radius: 5px;
    transition: width 0.3s ease;
}
#progress-text {
    font-size: 0.9rem;
    color: #a0c3d2;
    white-space: nowrap;
}
#cancel-upload-btn {
    color: #ff8a8a; /* Vermelho para cancelar */
}
#cancel-upload-btn:hover {
    color: #ffc2c2;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .main-header { padding: 1rem 1.5rem; }
    .header-title { font-size: 1.5rem; }
    .user-actions { gap: 0.75rem; }
    #content-area { padding: 2rem 1rem; }
    .cards-container { gap: 1rem; }
    .card { width: clamp(140px, 40vw, 160px); height: auto; aspect-ratio: 1 / 1; padding: 1rem; gap: 0.5rem; } /* Ajuste altura e aspect-ratio */
    .card-icon svg { width: 40px; height: 40px; }
    .card-text { font-size: 1rem; }
    .back-button { top: 1.5rem; left: 1rem; }
    .tool-header h1 { font-size: 2rem; }
    .tool-form .form-grid { grid-template-columns: 1fr; }
    .tool-table { display: block; } .tool-table thead { display: none; }
    .tool-table tbody, .tool-table tr, .tool-table td { display: block; width: 100%; }
    .tool-table tr { border-bottom: 1px solid rgba(255, 255, 255, 0.2); margin-bottom: 1rem; padding-bottom: 1rem; }
    .tool-table td { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; }
    .tool-table td::before { content: attr(data-label); font-weight: 700; color: #a0c3d2; padding-right: 1rem; flex-basis: 30%; /* Ajuste largura label */ text-align: left; }
    .tool-table td > *:last-child { flex-basis: 65%; text-align: right; } /* Alinha conteúdo à direita */
    .tool-table .action-buttons { justify-content: flex-end; /* Mantém ações à direita */ } /* Ajustado */
    .modal-content { width: 90%; }
    .modal-cards-container { flex-direction: column; align-items: center; }
    .admin-tabs { gap: 0; }
    .tab-button { padding: 0.8rem 1rem; font-size: 0.9rem;}

    /* Responsividade para a lista de cards de gestão */
    .card-manage-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-manage-info {
        width: 100%;
        margin: 0.5rem 0;
    }
    .card-manage-actions {
        width: 100%;
        justify-content: flex-start;
    }
     /* Formulário de add categoria */
    #add-category-form {
        flex-direction: column;
        align-items: stretch; /* Ocupa largura total */
    }
    #add-category-form .form-actions {
        align-self: auto; /* Reseta alinhamento */
        margin-top: 0.5rem;
    }
     #add-category-form button {
        width: 100%; /* Botão ocupa largura total */
    }
    .category-item span {
        flex-grow: 1; /* Permite que o nome ocupe mais espaço */
        margin-right: 0.5rem; /* Espaço antes do botão */
    }

}


/* =========================================
 ESTILOS - PERFIL DE UTILIZADOR
=========================================
*/

/* --- Cabeçalho (Header) --- */
.user-profile-container {
    position: relative;
    cursor: pointer;
}

.profile-picture-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.3s;
}

.profile-picture-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Garante que a imagem cubra o círculo */
}

/* Estado de hover/ativo */
.user-profile-container:hover .profile-picture-wrapper,
.user-profile-container.active .profile-picture-wrapper {
    border-color: #00DBFF;
}

/* O menu flutuante (dropdown) */
.profile-dropdown {
    display: none; /* Começa escondido */
    position: absolute;
    top: 120%; /* Abaixo da foto de perfil */
    right: 0;
    width: 220px;
    background: rgba(10, 25, 40, 0.8); /* Fundo escuro */
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mostra o dropdown quando o container está ativo */
.user-profile-container.active .profile-dropdown {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.dropdown-user-name {
    font-family: 'TOTVS', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-email {
    font-size: 0.85rem;
    color: #a0c3d2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-menu-list {
    list-style: none;
    padding: 0.5rem;
}

.dropdown-menu-list li a,
.dropdown-menu-list li button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: #E0E0E0;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

.dropdown-menu-list li a:hover,
.dropdown-menu-list li button:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
}

.dropdown-menu-list li svg {
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.8;
}

/* --- Página de Perfil --- */
/* .profile-page-card renomeado para .tool-card para consistência */

/* Secção de upload de foto */
.profile-pic-uploader {
    display: flex;
    flex-direction: column; /* Altera para coluna */
    align-items: center; /* Centraliza */
    gap: 1rem; /* Ajusta espaço */
    margin-bottom: 2rem;
}

.profile-pic-preview { /* Estilo unificado para preview */
        width: 120px;
        height: 120px;
        border-radius: 50%;
        overflow: hidden;
        background-color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }

#preview-img,
#profile-pic-placeholder {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: opacity 0.3s;
    }

#profile-pic-placeholder {
        padding: 25%;
        width: 100%;
        height: 100%;
        color: rgba(255, 255, 255, 0.5);
    }

.profile-pic-uploader .form-hint { /* Hint abaixo do botão */
    font-size: 0.85rem;
    color: #a0c3d2;
    text-align: center;
    margin-top: 0.5rem;
}


/* =========================================
 NOVOS ESTILOS - DN ASSETS (Interface Usuário)
=========================================
*/
.assets-container {
    max-width: 1400px; /* Largura maior para a biblioteca */
    margin: 0 auto;
    padding: 0 1rem; /* Padding lateral */
}

.assets-controls {
    display: flex;
    flex-wrap: wrap; /* Quebra linha em mobile */
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    flex-grow: 1; /* Ocupa espaço disponível */
    position: relative;
    min-width: 250px; /* Largura mínima */
}

.search-bar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #a0c3d2;
    pointer-events: none; /* Não interfere no clique */
}

.search-bar input[type="search"] {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem; /* Espaço para o ícone */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: #FFFFFF;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.search-bar input[type="search"]:focus {
    outline: none;
    border-color: #00DBFF;
    box-shadow: 0 0 15px rgba(0, 219, 255, 0.3);
}
/* Remove X do search input no Chrome/Edge */
.search-bar input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}


.filter-category select {
    padding: 0.8rem 2.5rem 0.8rem 1rem; /* Espaço para seta */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: #FFFFFF;
    font-size: 1rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2.5' stroke='%23a0c3d2' class='w-6 h-6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1.2em;
    min-width: 200px; /* Largura mínima */
    transition: border-color 0.3s, box-shadow 0.3s;
}
.filter-category select:focus {
     outline: none;
    border-color: #00DBFF;
    box-shadow: 0 0 15px rgba(0, 219, 255, 0.3);
}

#assets-grid {
    display: grid;
    /* Grid responsiva: Mínimo 200px, máximo 1fr (ocupa espaço igual) */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.asset-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.asset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.asset-preview {
    position: relative;
    height: 150px; /* Altura fixa para preview */
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Garante que a imagem não vaze */
}

.asset-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mostra imagem inteira, pode ter barras */
}

.asset-icon-preview {
    width: 60px; /* Tamanho do ícone */
    height: 60px;
    color: #a0c3d2;
}
.asset-icon-preview svg {
    width: 100%;
    height: 100%;
}


.asset-type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 700;
}

.asset-info {
    padding: 1rem;
    flex-grow: 1; /* Ocupa espaço restante */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.asset-info h3 {
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Adiciona '...' se o nome for muito longo */
    margin-bottom: 0.2rem;
}

.asset-category {
    font-size: 0.8rem;
    color: #a0c3d2;
}

.asset-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto; /* Empurra tags para baixo se houver espaço */
}

.asset-tags span {
    background: rgba(0, 219, 255, 0.1);
    color: #00DBFF;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}
/* Estilo para o +X tags */
.asset-tags .more-tags {
    background: rgba(160, 195, 210, 0.2); /* Cor cinza-azulada */
    color: #a0c3d2;
    cursor: default; /* Indica que não é clicável (ainda) */
}


.asset-actions {
    padding: 0.5rem 1rem 1rem 1rem; /* Padding inferior maior */
    display: flex;
    gap: 0.5rem;
}

.asset-actions .tool-button {
    width: 100%; /* Botões ocupam largura total */
}

.assets-feedback {
    display: flex; /* Usar flex para centralizar */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #a0c3d2;
    gap: 1rem;
}
.assets-feedback span {
    font-size: 1.1rem;
}
.error-loading { /* Mensagem de erro dentro da grid */
    grid-column: 1 / -1; /* Ocupa todas as colunas */
    text-align: center;
    padding: 2rem;
    color: #ff8a8a;
}


/* Ajustes Responsivos para DN Assets */
@media (max-width: 768px) {
    .assets-controls {
        flex-direction: column; /* Empilha controles */
        align-items: stretch; /* Ocupa largura total */
    }
     .search-bar, .filter-category, .filter-category select {
        width: 100%; /* Ocupa largura total */
        min-width: 0; /* Remove largura mínima */
    }
     #assets-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Cards menores */
        gap: 1rem;
    }
    .asset-preview { height: 120px; } /* Preview menor */
    .asset-info h3 { font-size: 1rem; }
}

