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

:root {
    --primary-color: #1F4E78;
    --secondary-color: #00B0F0;
    --success-color: #00B050;
    --warning-color: #FFC000;
    --danger-color: #FF0000;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --bg-light: #F8F9FA;
    --border-color: #E0E0E0;
    --white: #FFFFFF;
    --star-empty: #D3D3D3;
    --star-1: #FF0000;
    --star-2: #FF6600;
    --star-3: #FFFF00;
    --star-4: #90EE90;
    --star-5: #00B050;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

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

.header {
    text-align: center;
    color: var(--white);
    margin-bottom: 30px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

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

.navigation {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    flex: 1;
    min-width: 200px;
    padding: 15px 25px;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav-btn span {
    font-size: 1.5rem;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.page {
    display: none;
}

.page.active {
    display: block;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 {
    color: var(--text-dark);
    font-size: 1.4rem;
    margin: 25px 0 15px;
}

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

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

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 78, 120, 0.1);
}

.info-text {
    background: #E3F2FD;
    padding: 12px;
    border-radius: 8px;
    color: #1565C0;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.criterios-section {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.criterio-item {
    background: var(--white);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 0;
    border: 2px solid var(--border-color);
}

.criterio-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Sistema de Estrelas CORRETO (1=ruim, 5=excelente) */
.star-rating {
    display: flex;
    gap: 5px;
    font-size: 1.5rem;
}

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

.star-rating label {
    cursor: pointer;
    color: var(--star-empty);
    transition: all 0.2s ease;
    user-select: none;
    margin-bottom: 0 !important;
}

/* Estrela 1 = Muito Ruim (Vermelho) */
.star-rating input[value="1"]:checked ~ label:nth-of-type(1),
.star-rating input[value="1"]:checked + label {
    color: var(--star-1);
}

/* Estrela 2 = Ruim (Laranja) */
.star-rating input[value="2"]:checked ~ label:nth-of-type(1),
.star-rating input[value="2"]:checked ~ label:nth-of-type(2),
.star-rating input[value="2"]:checked + label {
    color: var(--star-2);
}

/* Estrela 3 = Regular (Amarelo) */
.star-rating input[value="3"]:checked ~ label:nth-of-type(1),
.star-rating input[value="3"]:checked ~ label:nth-of-type(2),
.star-rating input[value="3"]:checked ~ label:nth-of-type(3),
.star-rating input[value="3"]:checked + label {
    color: var(--star-3);
}

/* Estrela 4 = Bom (Verde claro) */
.star-rating input[value="4"]:checked ~ label:nth-of-type(1),
.star-rating input[value="4"]:checked ~ label:nth-of-type(2),
.star-rating input[value="4"]:checked ~ label:nth-of-type(3),
.star-rating input[value="4"]:checked ~ label:nth-of-type(4),
.star-rating input[value="4"]:checked + label {
    color: var(--star-4);
}

/* Estrela 5 = Excelente (Verde escuro) */
.star-rating input[value="5"]:checked ~ label,
.star-rating input[value="5"]:checked + label {
    color: var(--star-5);
}

/* Efeito hover para indicar seleção */
.star-rating label:hover,
.star-rating:has(label:nth-of-type(1):hover) label:nth-of-type(1),
.star-rating:has(label:nth-of-type(2):hover) label:nth-of-type(1),
.star-rating:has(label:nth-of-type(2):hover) label:nth-of-type(2),
.star-rating:has(label:nth-of-type(3):hover) label:nth-of-type(1),
.star-rating:has(label:nth-of-type(3):hover) label:nth-of-type(2),
.star-rating:has(label:nth-of-type(3):hover) label:nth-of-type(3),
.star-rating:has(label:nth-of-type(4):hover) label:nth-of-type(1),
.star-rating:has(label:nth-of-type(4):hover) label:nth-of-type(2),
.star-rating:has(label:nth-of-type(4):hover) label:nth-of-type(3),
.star-rating:has(label:nth-of-type(4):hover) label:nth-of-type(4),
.star-rating:has(label:nth-of-type(5):hover) label {
    color: #FFD700 !important;
}

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

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex: 1;
    min-width: 150px;
}

.btn span {
    font-size: 1.2rem;
}

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

.btn-primary:hover {
    background: #00963E;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 176, 80, 0.3);
}

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

.btn-secondary:hover {
    background: #5A6268;
}

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

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    color: var(--white);
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 700;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.ranking-table th,
.ranking-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ranking-table th {
    background: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.ranking-table tr:hover {
    background: var(--bg-light);
}

.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-color);
    color: var(--white);
}

.badge-warning {
    background: var(--warning-color);
    color: var(--text-dark);
}

.badge-danger {
    background: var(--danger-color);
    color: var(--white);
}

.chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

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

    .nav-btn {
        min-width: 100%;
    }

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

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .star-rating {
        font-size: 1.5rem;
    }
}

/* Alert Messages */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.alert-error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.alert-info {
    background: #D1ECF1;
    color: #0C5460;
    border: 1px solid #BEE5EB;
}

/* Progress Indicator */
.progress-indicator {
    background: #F8F9FA;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 2px solid var(--border-color);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #E0E0E0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00B050, #00D563);
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.progress-percent {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Funcionário Section - COMPACTO */
.funcionario-section {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.funcionario-section.completed {
    border-color: var(--success-color);
    background: #E8F5E9;
}

.funcionario-title {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.funcionario-number {
    background: var(--primary-color);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.funcionario-section.completed .funcionario-number {
    background: var(--success-color);
}

.check-icon {
    margin-left: auto;
    font-size: 1.2rem;
}

.funcionario-section.completed .check-icon::before {
    content: '✅';
}

/* Criterios Grid - FORMATO LISTA VERTICAL */
.criterios-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.criterio-item {
    background: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.criterio-item label {
    font-weight: 600;
    margin-bottom: 0 !important;
    color: var(--text-dark);
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sistema de Estrelas CORRETO (1=ruim, 5=excelente) - COMPACTO */
.star-rating {
    display: flex;
    gap: 3px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.star-rating label {
    cursor: pointer;
    color: var(--star-empty);
    transition: all 0.2s ease;
    user-select: none;
    margin-bottom: 0 !important;
    padding: 5px;
    line-height: 1;
    display: inline-block;
}

@media (max-width: 768px) {
    .criterios-grid {
        gap: 5px;
    }
    
    .criterio-item {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .criterio-item label {
        font-size: 0.85rem;
        min-width: 0;
        flex-basis: 100%;
        max-width: 100%;
        margin-bottom: 5px;
    }
    
    .progress-text {
        flex-direction: column;
        gap: 5px;
    }
    
    .star-rating {
        font-size: 1.8rem;
        gap: 8px;
        flex-basis: 100%;
        justify-content: center;
    }
    
    .funcionario-section {
        padding: 12px;
    }
    
    .funcionario-title {
        font-size: 0.95rem;
    }
}

/* Telas muito pequenas (celulares) */
@media (max-width: 480px) {
    .criterio-item {
        padding: 10px;
        gap: 6px;
    }
    
    .criterio-item label {
        font-size: 0.9rem;
        font-weight: 700;
    }
    
    .star-rating {
        font-size: 2rem;
        gap: 10px;
    }
    
    .funcionario-section {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header p {
        font-size: 0.9rem;
    }
}

/* Submit button disabled state */
.btn:disabled {
    background: #CCCCCC;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Login Card */
.login-card {
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
}

.login-card h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-card form {
    text-align: left;
}

.login-card code {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #856404;
}
