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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tela de Carregamento */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ff6b35;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

.loading-screen.active {
    display: flex;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: expandCircle 1.5s ease-out forwards;
}

.loading-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: showContent 0.8s ease 1.3s forwards;
}

.loading-logo {
    height: 150px;
    width: auto;
    margin-bottom: 40px;
    animation: logoFloat 2s ease-in-out 1.5s infinite;
}

.loading-title {
    color: #1e293b;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 50px;
    letter-spacing: 0.3px;
}

/* Spinner Animado */
.spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: #1e293b;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(2) {
    border-top-color: #ff6b35;
    animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
    border-top-color: #ff8c42;
    animation-delay: -1s;
}

/* Animações */
@keyframes expandCircle {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(50);
        opacity: 1;
    }
}

@keyframes showContent {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Tela de Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.6s ease;
}

.login-logo {
    height: 100px;
    width: auto;
    margin-bottom: 30px;
}

.login-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #64748b;
    font-size: 1em;
    margin-bottom: 40px;
}

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

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

.form-group label {
    display: block;
    color: #475569;
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group input::placeholder {
    color: #cbd5e1;
}

.login-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9em;
    font-weight: 600;
    border-left: 4px solid #ef4444;
    animation: shake 0.5s ease;
}

.btn-login {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    margin-top: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #e85a26 0%, #ff7a32 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Overlay de Importação */
.import-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 107, 53, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.import-overlay.active {
    display: flex;
}

.import-content {
    text-align: center;
}

.import-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

.import-text {
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* Controle de Telas */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Header Principal */
.main-header {
    background: white;
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.logo-image {
    height: 120px;
    width: auto;
    object-fit: contain;
}

.logo h1 {
    font-size: 2em;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.subtitle {
    color: #64748b;
    font-size: 0.95em;
    font-weight: 400;
}

.btn-import {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9em;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
    letter-spacing: 0.3px;
}

.btn-import svg {
    transition: transform 0.3s ease;
}

.btn-import:hover {
    background: linear-gradient(135deg, #e85a26 0%, #ff7a32 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.35);
}

.btn-import:hover svg {
    transform: translateY(2px);
}

.btn-import:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.month-badge {
    background: #0f172a;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
}

/* Conteúdo de Seleção */
.selection-content {
    padding: 20px 0;
}

/* Seletor de Período */
.period-selector {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.period-controls {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.period-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.period-group label {
    color: #64748b;
    font-size: 0.9em;
    font-weight: 600;
}

.period-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #0f172a;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
    min-width: 140px;
}

.period-select:hover {
    border-color: #ff6b35;
}

.period-select:focus {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.btn-delete {
    padding: 12px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-delete:active {
    transform: translateY(0);
}

.section-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    text-align: center;
}

.section-description {
    color: #64748b;
    font-size: 1.05em;
    text-align: center;
    margin-bottom: 40px;
}

/* Alertas Críticos */
.critical-alerts-container {
    margin-bottom: 30px;
}

.alerts-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.alerts-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.alerts-header h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.alert-count {
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 700;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

.alert-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-item.critical {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

.alert-item.warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.alert-item.info {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
}

.alert-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-content .alert-title {
    font-weight: 700;
    font-size: 1.05em;
    color: #0f172a;
    margin-bottom: 4px;
}

.alert-content .alert-description {
    color: #64748b;
    font-size: 0.95em;
    line-height: 1.5;
}

.alert-action {
    color: #ff6b35;
    font-weight: 600;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.no-alerts {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.no-alerts .icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.no-alerts h4 {
    font-size: 1.2em;
    color: #0f172a;
    margin-bottom: 8px;
}

/* Mensagem de Mês Vazio */
.empty-month-message {
    background: white;
    padding: 60px 40px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin: 40px 0;
    grid-column: 1 / -1; /* Ocupar todas as colunas do grid */
}

.empty-month-message .icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.empty-month-message h3 {
    font-size: 1.5em;
    color: #0f172a;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-month-message p {
    color: #64748b;
    font-size: 1.05em;
    line-height: 1.6;
}

/* Grid de Funcionários */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.employee-card-select {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.employee-card-select:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #0f172a;
}

.employee-card-select::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #ff6b35;
}

/* Badge de Status do Funcionário */
.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.status-badge.status-ok {
    background: #10b981;
    color: white;
}

.status-badge.status-warning {
    background: #f59e0b;
    color: white;
}

.status-badge.status-critical {
    background: #ef4444;
    color: white;
    animation: pulse-alert 2s ease-in-out infinite;
}

@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.employee-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    overflow: hidden;
}

.employee-avatar.has-photo {
    background: #e2e8f0;
    padding: 0;
}

.employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-info {
    text-align: center;
}

.employee-info h3 {
    font-size: 1.25em;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.employee-department {
    color: #64748b;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.employee-id-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    margin-top: 8px;
}

.employee-stats-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
}

.stat-preview {
    text-align: center;
}

.stat-preview-label {
    color: #64748b;
    font-size: 0.8em;
    margin-bottom: 4px;
}

.stat-preview-value {
    font-weight: 700;
    font-size: 1.1em;
    color: #0f172a;
}

/* Header do Relatório */
.report-header {
    background: white;
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.btn-back, .btn-export {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-back {
    background: #f1f5f9;
    color: #0f172a;
}

.btn-back:hover {
    background: #e2e8f0;
}

.btn-export {
    background: #0f172a;
    color: white;
}

.btn-export:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Relatório Individual */
.employee-report {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.report-employee-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f1f5f9;
}

.report-employee-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.report-employee-avatar.has-photo {
    background: #e2e8f0;
    padding: 0;
}

.report-employee-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-employee-info h2 {
    font-size: 2em;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.report-employee-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.meta-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Alerta de Horas Extras */
.overtime-alert {
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    font-size: 1.05em;
}

.overtime-alert-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.overtime-alert.positive {
    background: #dcfce7;
    border-left: 4px solid #22c55e;
    color: #166534;
}

.overtime-alert.negative {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.overtime-alert.neutral {
    background: #e0f2fe;
    border-left: 4px solid #0ea5e9;
    color: #075985;
}

/* Estatísticas do Relatório */
.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.report-stat-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.report-stat-label {
    color: #64748b;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 500;
}

.report-stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #0f172a;
}

.report-stat-value.positive {
    color: #22c55e;
}

.report-stat-value.negative {
    color: #ef4444;
}

/* Nota de Horário Especial */
.schedule-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    color: #92400e;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tabela */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: none;
}

.day-cell {
    font-weight: 700;
    color: #3b82f6;
}

.time-cell {
    font-weight: 500;
}

.time-cell.empty {
    color: #cbd5e1;
}

.time-cell.early {
    color: #22c55e;
}

.time-cell.late {
    color: #ef4444;
}

.overtime-cell {
    font-weight: 600;
}

.overtime-positive {
    color: #22c55e;
    background: #dcfce7;
    padding: 6px 10px;
    border-radius: 6px;
}

.overtime-negative {
    color: #ef4444;
    background: #fee2e2;
    padding: 6px 10px;
    border-radius: 6px;
}

.weekend {
    background: #fafafa;
}

/* Responsivo */
@media (max-width: 768px) {
    .loading-logo {
        height: 100px;
    }

    .loading-title {
        font-size: 1.2em;
        padding: 0 20px;
    }

    .loading-content {
        padding: 20px;
    }

    .login-card {
        padding: 40px 25px;
    }

    .login-logo {
        height: 80px;
    }

    .login-title {
        font-size: 1.5em;
    }

    .import-text {
        font-size: 1.4em;
        padding: 0 20px;
    }

    .container {
        padding: 15px;
    }

    .main-header {
        padding: 20px;
        text-align: center;
    }

    .header-info {
        flex-direction: column;
        width: 100%;
    }

    .btn-import {
        width: 100%;
        justify-content: center;
    }

    .logo h1 {
        font-size: 1.5em;
    }

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

    .report-employee-header {
        flex-direction: column;
        text-align: center;
    }

    .report-employee-info h2 {
        font-size: 1.5em;
    }

    .report-header {
        flex-direction: column;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 6px;
    }
}

@media print {
    body {
        background: white;
    }

    .btn-back,
    .btn-export {
        display: none;
    }

    .employee-report {
        box-shadow: none;
    }
}
