/* ==========================================================================
   Painel Administrativo Simplificado & Ultra-Intuitivo
   ========================================================================== */

:root {
    --admin-sidebar-width: 250px;
    --card-bg-subtle: rgba(255, 255, 255, 0.03);
    --border-accent: rgba(245, 158, 11, 0.3);
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - 65px);
}

/* Sidebar Moderna e Limpa */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.admin-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.admin-nav-item.active {
    background: var(--accent-gold-soft);
    color: var(--accent-gold);
    border-color: var(--border-accent);
    font-weight: 600;
}

.admin-nav-item i {
    font-size: 1.2rem;
}

/* Conteúdo Principal */
.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: 1200px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

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

/* Banner de Destaque / Importador Rápido */
.hero-import-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(17, 24, 39, 0.9) 100%);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.hero-import-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.5rem;
}

.hero-import-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* Cartões Informativos & Estatísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.stat-icon.folders { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon.materials { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.users { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.logs { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Painéis de Seção */
.card-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.panel-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel-header h2, .panel-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Árvore Visual de Pastas */
.folder-tree-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.folder-tree-node {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--transition);
}

.folder-tree-node:hover {
    border-color: var(--border-color-hover);
}

.folder-tree-node.subfolder {
    margin-left: 2.25rem;
    border-left: 4px solid var(--accent-gold);
    background: rgba(31, 41, 55, 0.5);
}

.folder-node-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
}

.folder-node-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Caixas de Texto Grandes para Importação em Lote */
.smart-import-area {
    width: 100%;
    min-height: 180px;
    background: #0b0f19;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #e5e7eb;
    line-height: 1.6;
    resize: vertical;
}

.smart-import-area:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* Tabelas */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.9rem 1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Modais */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.admin-modal.active {
    display: flex;
}

.admin-modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.admin-modal-header {
    background: var(--bg-primary);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.admin-modal-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Responsivo */
@media (max-width: 850px) {
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        overflow-x: auto;
    }
    .admin-content {
        padding: 1rem;
    }
}
