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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header h1 {
    color: #4a5568;
    font-size: 2rem;
    margin-bottom: 10px;
}

header h1 i {
    color: #667eea;
    margin-right: 10px;
}

nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.nav-btn i {
    margin-right: 8px;
}

.section {
    display: none;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.section h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.section h2 i {
    color: #667eea;
    margin-right: 10px;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.quantidade-info {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 500;
}

#quantidade-disponivel {
    font-weight: bold;
    color: #667eea;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.btn-scan {
    padding: 12px 20px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.btn-scan:hover {
    background: #38a169;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.btn-primary {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    padding: 12px 30px;
    background: #718096;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-success {
    padding: 12px 20px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-success:hover {
    background: #38a169;
}

.btn-info {
    padding: 12px 20px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-info:hover {
    background: #3182ce;
}

.search-container {
    margin-bottom: 25px;
}

.search-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-filters input,
.search-filters select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.search-filters input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-weight: 600;
    position: sticky;
    top: 0;
}

tbody tr:hover {
    background: #f7fafc;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-retirado {
    background: #fed7d7;
    color: #c53030;
}

.status-instalado {
    background: #c6f6d5;
    color: #276749;
}

.status-devolvido {
    background: #bee3f8;
    color: #2c5282;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s ease;
}

.btn-edit {
    background: #ed8936;
    color: white;
}

.btn-edit:hover {
    background: #dd6b20;
}

.btn-delete {
    background: #e53e3e;
    color: white;
}

.btn-delete:hover {
    background: #c53030;
}

.relatorios-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.relatorio-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.relatorio-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.relatorio-card h3 i {
    color: #667eea;
    margin-right: 8px;
}

.relatorio-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.relatorio-filters input {
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9rem;
}

.relatorio-filters button {
    white-space: nowrap;
}

.relatorio-result {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    color: #4a5568;
    font-size: 1.3rem;
}

.modal-header h3 i {
    color: #667eea;
    margin-right: 10px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #4a5568;
}

.modal-body {
    padding: 20px;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}

.scan-result {
    margin-top: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-weight: 500;
    color: #4a5568;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.empty-state i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filters input[type="text"] {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .relatorios-container {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
    
    .section {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

footer {
    background: white;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

footer p {
    color: #4a5568;
    font-size: 0.9rem;
    margin: 0;
}

.config-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.config-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.config-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.config-card h3 i {
    color: #667eea;
    margin-right: 8px;
}

.storage-options {
    margin-bottom: 20px;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #667eea;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.option-content {
    flex: 1;
}

.option-content strong {
    display: block;
    color: #4a5568;
    margin-bottom: 5px;
}

.option-content p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.storage-actions,
.sync-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sync-options {
    margin-bottom: 20px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
}

.status-info {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f7fafc;
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: #718096;
    font-size: 0.9rem;
}

.status-value {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Estilos para Controle de Estoque */
.estoque-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.estoque-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.estoque-card h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.estoque-card h3 i {
    color: #667eea;
    margin-right: 10px;
}

.resumo-estoque {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.resumo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.resumo-label {
    color: #718096;
    font-size: 0.9rem;
}

.resumo-valor {
    color: #4a5568;
    font-weight: bold;
    font-size: 1.1rem;
}

.estoque-por-tipo h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1rem;
}

#estoque-tipos {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tipo-estoque-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.tipo-estoque-nome {
    color: #4a5568;
    font-weight: 500;
}

.tipo-estoque-quantidade {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.estoque-table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.table-filters input,
.table-filters select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.table-filters input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.btn-warning {
    padding: 12px 20px;
    background: #ed8936;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.btn-warning:hover {
    background: #dd6b20;
}

.btn-danger {
    padding: 12px 20px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.btn-danger:hover {
    background: #c53030;
}

.relatorio-filters button {
    white-space: nowrap;
}

.estoque-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-disponivel {
    background: #c6f6d5;
    color: #276749;
}

.status-baixo {
    background: #feebc8;
    color: #975a16;
}

.status-esgotado {
    background: #fed7d7;
    color: #c53030;
}

.quantidade-estoque-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.estoque-quantidade-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (max-width: 768px) {
    .estoque-container {
        grid-template-columns: 1fr;
    }
    
    .table-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-filters input[type="text"] {
        min-width: auto;
    }
}

/* Estilos para Relatórios Avançados */
.relatorio-estatisticas {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.estatistica-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.estatistica-card h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.numero-destaque {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

.relatorio-graficos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.grafico-section {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.grafico-section h5 {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 1rem;
}

.tipo-stats,
.setor-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-label {
    flex: 1;
    font-size: 0.9rem;
    color: #4a5568;
}

.stat-value {
    font-weight: bold;
    color: #667eea;
    min-width: 30px;
    text-align: right;
}

.stat-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    min-width: 50px;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.registro-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.registro-status.valido {
    background: #c6f6d5;
    color: #276749;
}

.registro-status.invalido {
    background: #fed7d7;
    color: #c53030;
}

.relatorio-resumo {
    margin-top: 20px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.relatorio-resumo h5 {
    margin: 0 0 15px 0;
    color: #4a5568;
}

.qualidade-overview {
    margin-bottom: 20px;
}

.qualidade-indicador {
    display: flex;
    align-items: center;
    gap: 20px;
}

.qualidade-circular {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.qualidade-circular::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.qualidade-percent {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a5568;
}

.qualidade-texto h6 {
    margin: 0 0 5px 0;
    color: #4a5568;
}

.qualidade-texto p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.qualidade-detalhes {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.qualidade-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.qualidade-item.valido {
    background: #c6f6d5;
    color: #276749;
}

.qualidade-item.invalido {
    background: #fed7d7;
    color: #c53030;
}

.campos-problemas h6 {
    margin: 0 0 10px 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.problemas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.problema-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.problema-campo {
    font-size: 0.85rem;
    color: #4a5568;
}

.problema-quant {
    font-size: 0.85rem;
    font-weight: 500;
    color: #e53e3e;
}

@media (max-width: 768px) {
    .relatorio-graficos {
        grid-template-columns: 1fr;
    }
    
    .relatorio-estatisticas {
        flex-direction: column;
    }
    
    .qualidade-indicador {
        flex-direction: column;
        text-align: center;
    }
    
    .qualidade-detalhes {
        flex-direction: column;
    }
}

.print-only {
    display: none;
}

@media print {
    /* Ocultar apenas elementos específicos da interface principal */
    .no-print header,
    .no-print nav, 
    .no-print footer,
    .no-print .section,
    .no-print .modal {
        display: none !important;
    }
    
    /* Permitir que qualquer elemento sem classe no-print seja impresso */
    body:not(.no-print),
    body:not(.no-print) * {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Estilos gerais de impressão */
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    table {
        page-break-inside: auto;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}
