* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 900px;
            margin: 0 auto;
        }

        .header {
            text-align: center;
            color: white;
            margin-bottom: 30px;
        }

        .header h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        }

        .header p {
            font-size: 1.1em;
            opacity: 0.95;
        }

        .card {
            background: white;
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            margin-bottom: 20px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #333;
            font-size: 0.95em;
        }

        .form-group input {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 1em;
            transition: all 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 8px;
            font-size: 1.1em;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 10px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .loading {
            display: none;
            text-align: center;
            padding: 30px;
        }

        .loading.active {
            display: block;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .loading-text {
            color: #666;
            font-size: 1em;
        }

        .results {
            display: none;
        }

        .results.active {
            display: block;
        }

        .status-badge {
            display: inline-block;
            padding: 10px 20px;
            border-radius: 25px;
            font-weight: 700;
            font-size: 1.3em;
            margin-bottom: 20px;
        }

        .status-badge.success {
            background: #d4edda;
            color: #155724;
        }

        .status-badge.warning {
            background: #fff3cd;
            color: #856404;
        }

        .status-badge.danger {
            background: #f8d7da;
            color: #721c24;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin: 20px 0;
        }

        .stat-card {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
        }

        .stat-card .value {
            font-size: 2em;
            font-weight: 700;
            color: #667eea;
            margin-bottom: 5px;
        }

        .stat-card .label {
            font-size: 0.9em;
            color: #666;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .status-breakdown {
            margin: 20px 0;
        }

        .status-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #e0e0e0;
        }

        .status-item:last-child {
            border-bottom: none;
        }

        .status-name {
            font-weight: 600;
            color: #333;
            text-transform: capitalize;
        }

        .status-count {
            font-weight: 700;
            color: #667eea;
        }

        .anomalies-section {
            margin-top: 30px;
        }

        .anomaly-card {
            background: #fff;
            border-left: 4px solid #dc3545;
            padding: 15px;
            margin-bottom: 15px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        .anomaly-card.warning {
            border-left-color: #ffc107;
        }

        .anomaly-card.critical {
            border-left-color: #dc3545;
        }

        .anomaly-header {
            display: flex;
            align-items: center;
            margin-bottom: 10px;
        }

        .anomaly-icon {
            font-size: 1.5em;
            margin-right: 10px;
        }

        .anomaly-type {
            font-weight: 700;
            text-transform: uppercase;
            font-size: 0.9em;
            color: #333;
        }

        .anomaly-message {
            color: #666;
            line-height: 1.5;
            margin-left: 35px;
        }

        .no-anomalies {
            text-align: center;
            padding: 30px;
            color: #28a745;
            font-size: 1.2em;
        }

        .no-anomalies::before {
            content: "✅";
            display: block;
            font-size: 3em;
            margin-bottom: 10px;
        }

        .section-title {
            font-size: 1.3em;
            font-weight: 700;
            margin: 25px 0 15px;
            color: #333;
        }

        .error-message {
            background: #f8d7da;
            color: #721c24;
            padding: 15px;
            border-radius: 8px;
            margin: 20px 0;
            border-left: 4px solid #dc3545;
        }

        .help-text {
            font-size: 0.85em;
            color: #666;
            margin-top: 5px;
        }

        .btn-secondary {
            background: #6c757d;
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 8px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: all 0.2s;
            margin: 15px 0;
        }

        .btn-secondary:hover {
            background: #5a6268;
        }

        /* Modal de Lista de Serviços */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: white;
            border-radius: 15px;
            max-width: 1000px;
            width: 100%;
            max-height: 85vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .modal-header {
            padding: 20px 30px;
            border-bottom: 2px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h2 {
            margin: 0;
            color: #333;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 2em;
            color: #999;
            cursor: pointer;
            line-height: 1;
            padding: 0;
            width: 40px;
            height: 40px;
        }

        .modal-close:hover {
            color: #333;
        }

        .modal-body {
            padding: 20px 30px;
            overflow-y: auto;
            flex: 1;
        }

        .services-search {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 1em;
            margin-bottom: 20px;
        }

        .services-search:focus {
            outline: none;
            border-color: #667eea;
        }

        .category-group {
            margin-bottom: 25px;
        }

        .category-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 12px 15px;
            border-radius: 8px;
            font-weight: 700;
            font-size: 1em;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .category-icon {
            font-size: 1.2em;
        }

        .service-item {
            background: #f8f9fa;
            padding: 12px 15px;
            border-radius: 6px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .service-item:hover {
            background: #e9ecef;
            border-color: #667eea;
        }

        .service-item.selected {
            background: #e7f0ff;
            border-color: #667eea;
        }

        .service-item-left {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .service-id {
            font-weight: 700;
            color: #667eea;
            font-size: 0.95em;
            min-width: 50px;
        }

        .service-name {
            font-weight: 500;
            color: #333;
            font-size: 0.9em;
        }

        .service-rate {
            font-weight: 700;
            color: #28a745;
            font-size: 0.95em;
            white-space: nowrap;
        }

        .selected-services {
            background: #e7f0ff;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
        }

        .selected-services h4 {
            margin: 0 0 10px 0;
            color: #333;
        }

        .selected-tag {
            display: inline-block;
            background: #667eea;
            color: white;
            padding: 5px 10px;
            border-radius: 15px;
            margin: 5px;
            font-size: 0.9em;
        }

        .modal-footer {
            padding: 20px 30px;
            border-top: 2px solid #e0e0e0;
            display: flex;
            gap: 10px;
        }

        .modal-footer .btn {
            flex: 1;
            margin: 0;
        }

        .btn-show-more {
            background: #6c757d;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            font-size: 0.9em;
            font-weight: 600;
            cursor: pointer;
            margin-top: 10px;
            transition: all 0.2s;
        }

        .btn-show-more:hover {
            background: #5a6268;
        }

        .anomaly-hidden {
            display: none;
        }

        @media (max-width: 768px) {
            .header h1 {
                font-size: 1.8em;
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .card {
                padding: 20px;
            }

            .modal {
                max-height: 90vh;
            }
        }

/* Barra de Progresso */
.progress-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: white;
    font-weight: 600;
    font-size: 1em;
}

.progress-current {
    text-align: center;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
    font-style: italic;
}