/**
 * Estilos para página de verificação de limite anual de pedidos
 * Sistema de Materiais de Expediente - SENAC
 * Layout minimalista com fundo branco
 */

/* === VARIÁVEIS CSS - TEMA LIMPO COM DARK MODE === */
:root {
    /* Cores principais - tema claro e limpo */
    --bg-primary: #ffffff;
    --bg-secondary: #fafbfc;
    --bg-tertiary: #f4f6f8;
    --bg-card: #ffffff;
    
    /* Texto */
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --text-inverse: #ffffff;
    
    /* Cores de destaque */
    --accent-primary: #4285f4;
    --accent-secondary: #34a853;
    --accent-warning: #fbbc04;
    --accent-danger: #ea4335;
    
    /* Bordas e sombras suaves */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.08);
}

/* === DARK MODE VARIABLES === */
[data-tema="escuro"], 
.tema-escuro {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #161b22;
    
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --text-inverse: #0d1117;
    
    --border-light: #30363d;
    --border-medium: #21262d;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}
    
    /* Raios de borda */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 50px;
    
    /* Espaçamentos */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 5rem;
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* === RESET BÁSICO === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* === CABEÇALHO === */
.cabecalho {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-light);
}

.cabecalho .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin: 0;
}

.menu ul {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
    margin: 0;
    padding: 0;
}

.menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-sm) 0;
    position: relative;
    transition: var(--transition-normal);
}

.menu a:hover {
    color: var(--accent-primary);
}

.menu li.active a {
    color: var(--accent-primary);
}

.menu li.active a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.tema-toggle {
    width: 48px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-normal);
    overflow: hidden;
}

.tema-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: var(--transition-normal);
}

/* Dark mode - mover toggle para direita */
[data-tema="escuro"] .tema-toggle::before,
.tema-escuro .tema-toggle::before {
    transform: translateX(24px);
}

.tema-toggle .icon-sol,
.tema-toggle .icon-lua {
    position: absolute;
    top: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition-normal);
}

.tema-toggle .icon-sol {
    left: 0;
    opacity: 1;
}

.tema-toggle .icon-lua {
    right: 0;
    opacity: 0.5;
}

/* Dark mode - trocar visibilidade dos ícones */
[data-tema="escuro"] .tema-toggle .icon-sol,
.tema-escuro .tema-toggle .icon-sol {
    opacity: 0.5;
}

[data-tema="escuro"] .tema-toggle .icon-lua,
.tema-escuro .tema-toggle .icon-lua {
    opacity: 1;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-normal);
}

/* === HERO SECTION === */
.hero-section {
    background: var(--bg-primary);
    padding: var(--space-4xl) 0;
    text-align: center;
}

.hero-section h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.text-accent {
    color: var(--accent-primary);
    font-weight: 600;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 120px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    font-weight: 500;
}

/* === SEÇÃO PRINCIPAL === */
.verificar-section {
    background: var(--bg-secondary);
    padding: var(--space-4xl) 0;
}

.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    margin-bottom: var(--space-3xl);
    box-shadow: var(--shadow-sm);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* === GRID DE SETORES === */
.setores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.setor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.setor-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.setor-card.selected {
    border-color: var(--accent-primary);
    background: rgba(66, 133, 244, 0.05);
    box-shadow: var(--shadow-md);
}

.setor-card.selected::after {
    content: '✓';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.setor-card {
    position: relative;
}

.setor-card-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.setor-card.selected .setor-card-icon {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.setor-card-content {
    flex: 1;
}

.setor-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.setor-card-code {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    background: var(--bg-tertiary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.setor-card.selected .setor-card-code {
    background: rgba(66, 133, 244, 0.1);
    color: var(--accent-primary);
}

/* === FILTROS === */
.filtros-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    align-items: end;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) 2.5rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-select {
    padding-left: var(--space-md);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    background-size: 16px;
}

/* === TABELA === */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.produtos-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.produtos-table th {
    background: var(--bg-tertiary);
    padding: var(--space-lg);
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    white-space: nowrap;
}

.produtos-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.produtos-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.produtos-table .status-normal {
    border-left: 3px solid var(--accent-secondary);
}

.produtos-table .status-low {
    border-left: 3px solid var(--accent-warning);
}

.produtos-table .status-zero {
    border-left: 3px solid var(--accent-danger);
}

.product-code-cell {
    font-family: monospace;
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.product-name-cell {
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quantity-cell {
    font-weight: 600;
    text-align: center;
    font-family: monospace;
}

.quantity-cell.completo {
    color: var(--accent-secondary);
}

.quantity-cell.zero {
    color: var(--accent-danger);
}

.quantity-cell.low {
    color: var(--accent-warning);
}

/* === STATUS === */
.status-cell {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-normal {
    background: rgba(52, 168, 83, 0.1);
    color: var(--accent-secondary);
}

.status-badge.status-low {
    background: rgba(251, 188, 4, 0.1);
    color: var(--accent-warning);
}

.status-badge.status-zero {
    background: rgba(234, 67, 53, 0.1);
    color: var(--accent-danger);
}

.progress-container {
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    width: 100px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--accent-secondary);
    border-radius: var(--radius-sm);
    transition: width 1s ease;
}

.progress-bar.warning {
    background: var(--accent-warning);
}

.progress-bar.danger {
    background: var(--accent-danger);
}

/* === BOTÕES === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition-normal);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.9rem;
    background: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: #3367d6;
    border-color: #3367d6;
    text-decoration: none;
    color: var(--text-inverse);
}

.btn-outline {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--border-medium);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    text-decoration: none;
    color: var(--accent-primary);
}

/* === ESTADOS VAZIOS === */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin: var(--space-xl) 0;
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.empty-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* === BANNERS === */
.erro-banner {
    background: rgba(234, 67, 53, 0.05);
    color: var(--accent-danger);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    border: 1px solid rgba(234, 67, 53, 0.2);
    border-left: 4px solid var(--accent-danger);
    font-weight: 500;
}

/* === SEÇÃO DE DICAS === */
.tips-section {
    background: var(--bg-primary);
    padding: var(--space-4xl) 0;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.tip-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tip-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto var(--space-md);
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.tip-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.tip-content p {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* === RODAPÉ === */
.rodape {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-2xl) 0;
    margin-top: var(--space-3xl);
}

.rodape .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.rodape-info {
    flex: 1;
}

.rodape-links ul {
    display: flex;
    list-style: none;
    gap: var(--space-md);
    margin: 0;
    padding: 0;
}

.rodape-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-normal);
}

.rodape-links a:hover {
    color: var(--accent-primary);
}

/* === LOADING === */
.loading-spinner {
    text-align: center;
    padding: var(--space-xl);
}

.loading-spinner .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === RESPONSIVIDADE === */
@media (max-width: 1024px) {
    .setores-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--space-md);
    }
    
    .filtros-container {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: 0;
        overflow: hidden;
        background: var(--bg-primary);
        transition: height 0.3s ease;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-light);
    }
    
    .menu.ativo {
        height: auto;
        padding: var(--space-md) 0;
    }
    
    .menu ul {
        flex-direction: column;
        padding: 0 var(--space-lg);
        gap: 0;
    }
    
    .menu li {
        width: 100%;
    }
    
    .menu a {
        display: block;
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .hero-section {
        padding: var(--space-2xl) 0;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .section-card {
        padding: var(--space-xl);
        margin-bottom: var(--space-xl);
    }
    
    .setores-grid {
        grid-template-columns: 1fr;
    }
    
    .produtos-table {
        font-size: 0.85rem;
    }
    
    .produtos-table th,
    .produtos-table td {
        padding: var(--space-sm);
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .rodape .container {
        flex-direction: column;
        text-align: center;
    }
    
    .rodape-links ul {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .section-card {
        padding: var(--space-md);
    }
    
    .setor-card {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
        padding: var(--space-md);
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .tip-card {
        padding: var(--space-md);
    }
    
    .form-input {
        padding-left: 2.5rem;
    }
    
    .input-icon {
        left: var(--space-sm);
    }
}

/* === ANIMAÇÕES === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* === UTILITÁRIOS === */
.text-center { text-align: center; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.w-100 { width: 100%; }