* {
    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;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.logo h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #f0f0f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.tab.active {
    background: #667eea;
    color: white;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border 0.3s;
}

.form-group select.contract-select {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border 0.3s;
    background: white;
    cursor: pointer;
}

.form-group select.contract-select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.role-selector {
    display: flex;
    gap: 10px;
}

.role-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.role-option input {
    display: none;
}

.role-option input:checked + span {
    color: #667eea;
    font-weight: 600;
}

.role-option:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

.btn-primary {
    padding: 14px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px;
    font-size: 14px;
    margin-top: -10px;
}

.btn-link:hover {
    color: #5568d3;
}

.btn-secondary {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    padding: 10px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-success:hover {
    background: #059669;
}

.message {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    margin-top: 10px;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* App Container */
.app-container {
    min-height: 100vh;
    background: #f5f5f5;
}

.app-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon-small {
    font-size: 32px;
}

.header-left h2 {
    font-size: 20px;
    color: #333;
}

.header-left p {
    font-size: 14px;
    color: #666;
}

.btn-logout {
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #dc2626;
}

.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

/* Ponto Buttons */
.ponto-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.btn-ponto {
    padding: 25px 15px;
    border: 3px solid;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-ponto.entrada {
    border-color: #10b981;
}

.btn-ponto.entrada:hover:not(.disabled) {
    background: #d1fae5;
    transform: translateY(-2px);
}

.btn-ponto.almoco {
    border-color: #f59e0b;
}

.btn-ponto.almoco:hover:not(.disabled) {
    background: #fef3c7;
    transform: translateY(-2px);
}

.btn-ponto.saida {
    border-color: #ef4444;
}

.btn-ponto.saida:hover:not(.disabled) {
    background: #fee2e2;
    transform: translateY(-2px);
}

.btn-ponto.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ponto .icon {
    font-size: 40px;
}

.btn-ponto .label {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.btn-ponto .status {
    font-size: 12px;
    color: #10b981;
}

/* Banco de Horas */
.banco-horas {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.banco-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.saldo {
    font-size: 36px;
    font-weight: bold;
}

.saldo.positive {
    color: #10b981;
}

.saldo.negative {
    color: #ef4444;
}

/* Dashboard Simples */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dash-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
}

.dash-item:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dash-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dash-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.dash-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.dash-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.dash-value.positive {
    color: #10b981;
}

.dash-value.negative {
    color: #ef4444;
}

/* Histórico */
.historico-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.historico-item {
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.historico-date {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    text-transform: capitalize;
}

.historico-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    align-items: center;
}

.horas-trabalhadas {
    color: #667eea;
    font-weight: 600;
    grid-column: 1 / -1;
    margin-top: 5px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.3s;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 36px;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* Colaboradores */
.colaboradores-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.colaborador-item {
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.colaborador-item:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.colaborador-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.colaborador-info {
    flex: 1;
}

.colaborador-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.contract-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.colaborador-email {
    font-size: 14px;
    color: #666;
}

.colaborador-status {
    display: flex;
    gap: 10px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.filter-group input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

/* Registros */
.registros-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.registro-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.registro-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.registro-badge.entrada {
    background: #d1fae5;
    color: #065f46;
}

.registro-badge.saida {
    background: #fee2e2;
    color: #991b1b;
}

.registro-badge.saida_almoco,
.registro-badge.retorno_almoco {
    background: #fef3c7;
    color: #92400e;
}

.registro-info {
    flex: 1;
}

.registro-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.registro-date {
    font-size: 14px;
    color: #666;
}

.registro-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    border-radius: 6px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: #e5e7eb;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.large {
    max-width: 800px;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
}

.btn-close:hover {
    background: #e5e7eb;
}

.detail-actions {
    display: flex;
    gap: 5px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

/* Utility */
.loading, .empty {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

/* Alertas */
.alert-card {
    background: #fef3c7;
    border: 2px solid #f59e0b;
}

.alert-value {
    color: #f59e0b !important;
}

.alert-section {
    border-left: 4px solid #f59e0b;
}

.alertas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alerta-item {
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alerta-item.warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.alerta-item.info {
    background: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.alerta-icon {
    font-size: 20px;
}

.alerta-message {
    flex: 1;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .app-main {
        padding: 20px 15px;
    }

    .card {
        padding: 20px;
    }

    .ponto-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group input {
        width: 100%;
    }

    .colaborador-item {
        flex-wrap: wrap;
    }

    .colaborador-status {
        width: 100%;
        justify-content: flex-start;
    }

    .historico-details {
        grid-template-columns: 1fr;
    }
}