/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    color: #667eea;
}

h2 {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 30px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.85rem;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

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

.error-message {
    display: none;
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    margin-top: 15px;
    font-size: 0.9rem;
}

.error-message.show {
    display: block;
}

.success-message {
    display: none;
    padding: 12px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 8px;
    color: #3c3;
    margin-top: 15px;
    font-size: 0.9rem;
}

.success-message.show {
    display: block;
}

.register-link {
    text-align: center;
    margin-top: 25px;
    color: #666;
    font-size: 0.9rem;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}




/* ========== DASHBOARD STYLES ========== */

.dashboard-body {
    background: #f5f7fa;
}

.dashboard-container {
    min-height: 100vh;
    padding: 0;
    width: 100%;
    max-width: 1080px;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header h1 {
    margin: 0;
    color: white;
    font-size: 1.8rem;
}



.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
}

.user-email {
    font-size: 0.85rem;
    opacity: 0.9;
}

.user-department {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Atualiza o responsive também */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .user-info {
        flex-direction: column;
        width: 100%;
    }
    
    .user-details {
        align-items: center;
        text-align: center;
    }
    
    .btn-logout {
        width: 100%;
    }
}

.user-info span {
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.dashboard-main {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Garantir que a tabela não estoure */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    width: 100%;
}

.records-table {
    width: 100%;
    min-width: 600px; /* Garante largura mínima para não quebrar o layout */
    border-collapse: collapse;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Timer Display */
.timer-display {
    text-align: center;
}

.timer {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.timer-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-play, .btn-stop {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-play {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 153, 142, 0.4);
}

.btn-stop {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(235, 51, 73, 0.4);
}

/* Overtime Notice */
.overtime-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.overtime-notice small {
    color: #856404;
    font-size: 0.9rem;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-section label {
    font-weight: 500;
    color: #666;
}

.filter-section input[type="date"] {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
}

.btn-secondary {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

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

/* Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table thead {
    background: #f8f9fa;
}

.records-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.records-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
}

.records-table tbody tr:hover {
    background: #f8f9fa;
}

.no-records {
    text-align: center;
    color: #999;
    padding: 30px !important;
}

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

.badge-work {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-overtime {
    background: #fff3e0;
    color: #f57c00;
}

.badge-running {
    background: #fff9c4;
    color: #f57f17;
}

.badge-completed {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-pending {
    background: #ffe0b2;
    color: #e65100;
}

/* Day Total */
.day-total {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

.day-total strong {
    color: #333;
}

.day-total span {
    color: #667eea;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .timer {
        font-size: 2rem;
    }
    
    .timer-buttons {
        flex-direction: column;
    }
    
    .btn-play, .btn-stop {
        width: 100%;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-section input[type="date"],
    .btn-secondary {
        width: 100%;
    }
    
    .records-table {
        font-size: 0.85rem;
    }
    
    .records-table th,
    .records-table td {
        padding: 10px 8px;
    }
}






/* ========== ADMIN DASHBOARD STYLES ========== */

.admin-badge {
    background: rgba(255, 215, 0, 0.3) !important;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Filter Section - Admin */
.filter-section {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    margin: 0;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 150px;
}

/* Action Buttons */
.btn-approve, .btn-reject {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 8px;
}

.btn-approve {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-approve:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.btn-reject {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.btn-reject:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 51, 73, 0.4);
}

/* Icon Buttons */
.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

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

/* Additional Badges */
.badge-department {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-admin {
    background: #fff3e0;
    color: #f57c00;
}

.badge-employee {
    background: #e8f5e9;
    color: #388e3c;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
}

/* Form adjustments for modal */
.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content input[type="datetime-local"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}


.modal-content input[type="datetime-local"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive - Admin */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select,
    .filter-group input[type="date"] {
        width: 100%;
    }
    
    .btn-approve, .btn-reject {
        display: block;
        width: 100%;
        margin-bottom: 8px;
        margin-right: 0;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
        padding: 20px;
    }
}




/* Payment filters */
.payment-filters {
    margin-bottom: 20px;
}

.payment-filters .btn-primary {
    width: auto;
    padding: 12px 30px;
}




/* ========== CALENDÁRIO DE ESCALAS ========== */

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-controls h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.calendar-grid {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.calendar-day-name {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    padding: 10px;
    font-size: 0.9rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.calendar-day:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
    pointer-events: none;
}

.calendar-day.today {
    border-color: #667eea;
    border-width: 3px;
    background: #f0f4ff;
}

.calendar-day.has-schedule {
    background: #f8fff8;
}

.day-number {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.calendar-day .badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    align-self: flex-start;
}

/* Badges específicos do calendário */
.badge-afternoon {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-night {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-dayoff {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-unavailable {
    background: #fff3e0;
    color: #f57c00;
}

/* Legend */
.schedule-legend {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.schedule-legend h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #666;
}

/* Radio Group no Modal */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
}

.radio-option input[type="radio"]:checked + .radio-label {
    font-weight: 600;
}

.radio-option:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.radio-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.radio-label small {
    color: #999;
    font-size: 0.8rem;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .calendar-controls h3 {
        font-size: 1.1rem;
    }
    
    .calendar-day {
        min-height: 60px;
        padding: 8px;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .calendar-day .badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 10px;
    }
}




/* ========== ESCALAS ADMIN ========== */

.schedule-calendar-grid {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.schedule-calendar-grid .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.schedule-calendar-grid .calendar-day {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 8px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.3s;
}

.schedule-calendar-grid .calendar-day:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.day-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.day-badges .badge {
    font-size: 0.7rem;
    padding: 3px 6px;
    text-align: center;
}

/* Day Summary */
.day-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.day-summary h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.summary-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Employee Schedule List */
.employee-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.employee-schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.employee-schedule-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.employee-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.employee-info strong {
    color: #333;
    font-size: 1rem;
}

.schedule-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.schedule-notes {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    max-width: 200px;
    display: block;
}

.badge-not-set {
    background: #e0e0e0;
    color: #999;
}

.btn-add {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    color: #667eea;
}

.btn-add:hover {
    background: #f0f4ff;
    transform: scale(1.2);
}

/* Modal Large */
.modal-large {
    max-width: 700px;
}

.day-details-container {
    max-height: 60vh;
    overflow-y: auto;
}

/* Scrollbar customizado */
.employee-schedule-list::-webkit-scrollbar,
.day-details-container::-webkit-scrollbar {
    width: 8px;
}

.employee-schedule-list::-webkit-scrollbar-track,
.day-details-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.employee-schedule-list::-webkit-scrollbar-thumb,
.day-details-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.employee-schedule-list::-webkit-scrollbar-thumb:hover,
.day-details-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Responsive - Escalas Admin */
@media (max-width: 768px) {
    .schedule-calendar-grid .calendar-day {
        min-height: 80px;
        padding: 8px 5px;
    }
    
    .day-badges .badge {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
    
    .employee-schedule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .schedule-actions {
        align-items: flex-start;
        width: 100%;
    }
    
    .modal-large {
        max-width: 95%;
    }
    
    .schedule-notes {
        max-width: 100%;
    }
}

/* Ajustes para não quebrar layout */
.calendar-controls .btn-secondary {
    white-space: nowrap;
    padding: 10px 15px;
}

@media (max-width: 480px) {
    .calendar-controls .btn-secondary {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .calendar-controls h3 {
        font-size: 1rem;
    }
}