/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo h1 {
    color: #667eea;
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: none;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* Content Sections */
.content-section {
    display: none;
    flex: 1;
}

.content-section.active {
    display: block;
}

/* Card */
.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.1);
    border: 1px solid #e2e8f0;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

/* Cards específicos para admin - mais largos */
.admin-panel .card {
    max-width: 100%;
    text-align: left;
}

/* Card de registro manual de ponto - máximo de largura */
#manualPunchCard {
    max-width: 1000px;
}

/* Cards de relatórios - mais largos */
.reports-grid .card {
    max-width: 100%;
}

/* Cards de configurações - mais largos */
.settings-grid .card {
    max-width: 100%;
}

/* Time Display */
.time-display {
    margin-bottom: 30px;
}

.current-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.current-time i {
    font-size: 2rem;
}

.current-date {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* Greeting */
.greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.3rem;
    color: #4a5568;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Section Title */
.section-title {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 30px;
    font-weight: 600;
}

/* Forms */
.punch-form, .admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

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

/* Buttons */
.punch-btn, .admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.punch-btn {
    background: #667eea;
    color: white;
}

.punch-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.admin-btn {
    background: #667eea;
    color: white;
}

.admin-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.punch-btn:disabled, .admin-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Messages */
.success-message, .error-message {
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.success-message {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.error-message {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
}

/* Sistema de Mensagens */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
    width: 90%;
    animation: slideInRight 0.3s ease;
}

.message {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.message.success {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

.message.error {
    border-left-color: #f56565;
    background: linear-gradient(135deg, #fed7d7 0%, #ffffff 100%);
}

.message.warning {
    border-left-color: #ed8936;
    background: linear-gradient(135deg, #fef5e7 0%, #ffffff 100%);
}

.message-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.message-icon i {
    font-size: 1.5rem;
    color: #667eea;
}

.message.success .message-icon i {
    color: #48bb78;
}

.message.error .message-icon i {
    color: #f56565;
}

.message.warning .message-icon i {
    color: #ed8936;
}

.message-content {
    flex: 1;
}

.message-content h4 {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
}

.message-content p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.message-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #4a5568;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* LGPD Notice */
.lgpd-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    z-index: 1000;
    display: none;
}

.lgpd-notice.show {
    display: block;
}

.lgpd-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.lgpd-content p {
    flex: 1;
    margin: 0;
}

.lgpd-content a {
    color: #667eea;
    text-decoration: none;
}

.lgpd-content a:hover {
    text-decoration: underline;
}

.lgpd-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.lgpd-btn:hover {
    background: #5a67d8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .card {
        padding: 30px 20px;
    }
    
    .current-time {
        font-size: 2rem;
    }
    
    .current-time i {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .nav-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .lgpd-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .current-time {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 20px 15px;
    }
    
    .form-group input {
        padding: 12px;
    }
    
    .punch-btn, .admin-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fade animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Pulse animation for time */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Admin Panel Styles */
.admin-panel {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #4a5568;
}

.admin-nav-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.admin-nav-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 5px 0;
}

.stat-content p {
    color: #718096;
    margin: 0;
    font-weight: 500;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form row específico para ponto manual - dar mais espaço ao campo de hora */
#manualPunchForm .form-row:last-of-type {
    grid-template-columns: 1fr 1.5fr;
}

/* Formulários em cards admin - usar melhor o espaço */
.admin-panel .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Formulário de funcionário - mais espaçado */
#employeeForm .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Campos específicos do atestado médico - tamanho menor */
#certificateForm .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#certificateForm .form-group input,
#certificateForm .form-group select {
    max-width: 200px;
    width: 100%;
}

#certificateForm .form-group textarea {
    max-width: 100%;
}

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

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

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

.data-table th {
    background: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.data-table tr:hover {
    background: #f7fafc;
}

.text-center {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}

/* Date Filter */
.date-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-filter input[type="date"] {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.settings-grid .card h4 {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-btn.edit {
    background: #4299e1;
    color: white;
}

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

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

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

/* Certificate Actions */
.certificate-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Reports Grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.reports-grid .card h4 {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.reports-grid .card p {
    color: #718096;
    margin: 0 0 20px 0;
    font-size: 0.9rem;
}

/* Date Input Styling */
input[placeholder="DD-MM-AAAA"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Time Input Styling - Aumentar largura */
input[type="time"] {
    min-width: 120px;
    width: 100%;
}

/* Custom Select Styling - Design Moderno */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px 45px 15px 15px;
    font-size: 1rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    min-height: 50px;
}

select:hover {
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

select:active {
    transform: translateY(1px);
}

/* Select options styling */
select option {
    padding: 12px 15px;
    background: white;
    color: #4a5568;
    font-weight: 500;
}

select option:hover {
    background: #f7fafc;
    color: #667eea;
}

select option:checked {
    background: #667eea;
    color: white;
    font-weight: 600;
}

/* Custom Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.modal-icon.success {
    background: #10b981;
}

.modal-icon.error {
    background: #ef4444;
}

.modal-icon.warning {
    background: #f59e0b;
}

.modal-icon.info {
    background: #3b82f6;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-body {
    padding: 20px 24px;
    color: #4b5563;
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-btn-primary {
    background: #667eea;
    color: white;
}

.modal-btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.modal-btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.modal-btn-danger {
    background: #ef4444;
    color: white;
}

.modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

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

/* Certificate Table */
#certificatesTable th,
#certificatesTable td {
    padding: 12px;
    font-size: 0.9rem;
}

#certificatesTable th:nth-child(3),
#certificatesTable td:nth-child(3) {
    min-width: 200px;
}

/* Responsive Design for Admin Panel */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .admin-nav {
        justify-content: center;
    }
    
    .admin-nav-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .certificate-actions {
        flex-direction: column;
        align-items: stretch;
    }

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