/* ============================================
   CSS GERAL - CSV Dashboard
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   CONTAINER E LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    color: white;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.header .btn {
    display: inline-block;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
}

.card h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.upload-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.05));
    border-left: 4px solid var(--primary-color);
}

.info-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
}

.action-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(249, 115, 22, 0.05));
}

/* ============================================
   FORMULÁRIOS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-input-wrapper .file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 40px;
    background-color: var(--light-bg);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.file-input-wrapper input[type="file"]:focus ~ .file-label,
.file-input-wrapper:hover .file-label {
    background-color: rgba(37, 99, 235, 0.05);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   BOTÕES
   ============================================ */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #475569;
    transform: translateY(-2px);
}

/* ============================================
   ALERTAS
   ============================================ */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
    border-color: var(--success-color);
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: var(--danger-color);
}

/* ============================================
   GRID DE ESTATÍSTICAS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-content p {
    margin: 0;
    color: var(--text-secondary);
}

/* ============================================
   GRID DE GRÁFICOS
   ============================================ */

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    min-height: 400px;
}

/* ============================================
   FILTROS
   ============================================ */

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.search-input,
.select-filter {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--light-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus,
.select-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input {
    flex: 1;
    min-width: 200px;
}

.select-filter {
    min-width: 150px;
}

.filter-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.filter-count {
    font-weight: 600;
    color: var(--text-primary);
}

.filter-active {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* ============================================
   TABELAS
   ============================================ */

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

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

.data-table thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: var(--light-bg);
}

/* ============================================
   BADGES
   ============================================ */

.status-badge,
.prioridade-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
}

.status-aberto {
    background-color: rgba(37, 99, 235, 0.1);
    color: #1e40af;
}

.status-resolvido {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.status-fechado {
    background-color: rgba(100, 116, 139, 0.15);
    color: #334155;
}

.status-em-andamento {
    background-color: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.status-concluído {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.prioridade-high {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.prioridade-normal {
    background-color: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.prioridade-low {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.prioridade-alta {
    background-color: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.prioridade-média {
    background-color: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.prioridade-baixa {
    background-color: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

/* ============================================
   INFO TABLE
   ============================================ */

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.info-table tr {
    border-bottom: 1px solid var(--border-color);
}

.info-table td {
    padding: 12px 15px;
}

.info-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    width: 30%;
}

/* ============================================
   LISTAS
   ============================================ */

.columns-list {
    list-style: none;
    columns: 2;
    gap: 20px;
    padding: 0;
}

.columns-list li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
}

.columns-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .card {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-input,
    .select-filter {
        width: 100%;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .columns-list {
        columns: 1;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-content h3 {
        font-size: 1.5rem;
    }
}

/* ============================================
   PROGRESSO
   ============================================ */

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--light-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background-color: var(--primary-color);
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 100%; }
}

#progressText {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* ============================================
   LINKS
   ============================================ */

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
