/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.login-box h2 {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    font-size: 18px;
    font-weight: normal;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a67d8;
}

.btn-success {
    background-color: #48bb78;
    color: white;
}

.btn-success:hover {
    background-color: #38a169;
}

.btn-secondary {
    background-color: #a0aec0;
    color: white;
}

.btn-secondary:hover {
    background-color: #718096;
}

.btn-danger {
    background-color: #f56565;
    color: white;
}

.btn-danger:hover {
    background-color: #e53e3e;
}

.btn-warning {
    background-color: #ed8936;
    color: white;
}

.btn-warning:hover {
    background-color: #dd6b20;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* Header */
header {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 18px;
}

.card .number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.card .number.active {
    color: #48bb78;
}

.card .number.warning {
    color: #ed8936;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f7fafc;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    font-weight: 600;
    color: #4a5568;
}

tbody tr:hover {
    background-color: #f7fafc;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Navegação */
.main-nav {
    background: #2d3748;
    margin-bottom: 30px;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-content ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: #cbd5e0;
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background-color: #4a5568;
    border-bottom-color: #667eea;
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: #c6f6d5;
    border-color: #48bb78;
    color: #22543d;
}

.alert-error,
.alert-danger {
    background-color: #fed7d7;
    border-color: #f56565;
    color: #742a2a;
}

.alert-warning {
    background-color: #feebc8;
    border-color: #ed8936;
    color: #744210;
}

.alert-info {
    background-color: #bee3f8;
    border-color: #4299e1;
    color: #2a4365;
}

/* Ações da tabela */
.actions {
    white-space: nowrap;
}

.actions .btn {
    margin: 2px;
    padding: 5px 10px;
    font-size: 12px;
}

/* Classes para status */
.status-ativo {
    background-color: #c6f6d5;
    color: #22543d;
}

.status-inativo {
    background-color: #fed7d7;
    color: #742a2a;
}

.status-pendente {
    background-color: #feebc8;
    color: #744210;
}

/* Linhas da tabela com vencimento próximo */
.proximo-vencimento {
    background-color: #feebc8 !important;
}

.proximo-vencimento:hover {
    background-color: #fbd38d !important;
}

.vencido {
    background-color: #fed7d7 !important;
}

.vencido:hover {
    background-color: #fc8181 !important;
}

/* Filtros */
.filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filter-form input,
.filter-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.filter-form input {
    flex: 1;
}

.filter-form select {
    min-width: 150px;
}

/* Página de cadastro */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.form-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Responsividade */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .nav-content ul {
        flex-direction: column;
    }
    
    .nav-link {
        padding: 10px 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form input,
    .filter-form select,
    .filter-form button {
        width: 100%;
    }
}

/* Estilos para envio manual */
.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-info:hover {
    background-color: #138496;
    color: white;
}

.btn-info:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.checkbox-column {
    width: 40px;
    text-align: center;
}

.cliente-selecionado {
    background-color: #e8f4fd !important;
}

/* Modal para seleção de mensagem */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: white;
    border-radius: 10px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

/* Formulário dentro do modal */
.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-form textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.modal-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-checkbox input[type="checkbox"] {
    width: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}