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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 20px;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.btn-container {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.search-container {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
}

.search-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: #667eea;
}

.search-container button {
    padding: 12px 24px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.search-container button:hover {
    background-color: #5568d3;
}

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

table thead {
    background-color: #667eea;
    color: white;
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #ddd;
}

table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    color: #333;
}

table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tbody tr:hover {
    background-color: #f0f0f0;
    transition: background-color 0.3s ease;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons a,
.action-buttons button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.action-buttons .btn-edit {
    background-color: #f39c12;
    color: white;
}

.action-buttons .btn-edit:hover {
    background-color: #d68910;
}

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

.action-buttons .btn-delete:hover {
    background-color: #c0392b;
}

.form-container {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid #667eea;
}

.form-container h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

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

.form-row-full {
    grid-column: 1 / -1;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left-color: #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: #bee5eb;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #5568d3;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #667eea;
    color: white;
}

.pagination .active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

	    /* Responsividade da Tabela */
	    table {
	        display: block;
	        overflow-x: auto; /* Permite rolagem horizontal */
	        white-space: nowrap;
	        font-size: 0.9em;
	    }
	
	    table th,
	    table td {
	        padding: 8px;
	    }
	    
	    /* Esconder colunas menos importantes em telas pequenas */
	    table th:nth-child(2), /* Telefone */
	    table td:nth-child(2),
	    table th:nth-child(6), /* Data Inicial */
	    table td:nth-child(6),
	    table th:nth-child(8), /* Observação */
	    table td:nth-child(8) {
	        display: none;
	    }

	    .action-buttons {
	        flex-direction: column; /* Empilha os botões verticalmente */
	        gap: 5px; /* Reduz o espaçamento entre os botões */
	    }

	    .action-buttons a,
	    .action-buttons button {
	        padding: 6px 10px; /* Reduz o padding dos botões */
	        font-size: 0.8em; /* Reduz o tamanho da fonte dos botões */
	        width: 100%; /* Faz os botões ocuparem a largura total da célula */
	        text-align: center; /* Centraliza o texto dos botões */
	    }
	
	    .btn-container {
	        flex-direction: column;
	    }
	
	    .btn {
	        width: 100%;
	        text-align: center;
	    }
	
	    .search-container {
	        flex-direction: column;
	    }
	    
	    /* Ajuste para o grid de estatísticas */
	    .container > div:nth-child(4) { /* O div das estatísticas */
	        grid-template-columns: 1fr;
	    }
}


/* Estilo para clientes vencidos */
.cliente-vencido {
    background-color: #ffcccc !important;
    color: #8b0000;
    font-weight: bold;
}

.cliente-vencido:hover {
    background-color: #ff9999 !important;
}

.cliente-vencido td {
    color: #8b0000;
}


/* Estilos para o seletor de filtro */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='currentColor' 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 10px center;
    background-size: 1.5em;
    padding-right: 2.5em;
}

select:hover {
    border-color: #667eea;
}

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

/* Estilos para clientes ativos */
.cliente-ativo {
    background-color: #e8f5e9 !important;
}

.cliente-ativo:hover {
    background-color: #c8e6c9 !important;
}

.cliente-ativo td {
    color: #2e7d32;
}

/* Estilo para cliente que venceu HOJE (destaque por 24h) */
.venceu-hoje {
    background-color: #ffeb3b !important; /* Amarelo vibrante */
    border-left: 5px solid #fbc02d; /* Borda lateral para destaque */
    animation: pulse 1.5s infinite; /* Animação sutil */
}

.venceu-hoje:hover {
    background-color: #fdd835 !important;
}

.venceu-hoje td {
    font-weight: bold;
    color: #333;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 235, 59, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 235, 59, 0);
    }
}
