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

:root {
    --primary-color: #1e3c72;
    --primary-dark: #162b5a;
    --secondary-color: #2a5298;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.admin-header {
    background: var(--dark-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-actions span {
    color: var(--light-color);
}

/* Formulários */
form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 60, 114, 0.2);
}

small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* Botões */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--dark-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: var(--info-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Preview da imagem */
.preview-container {
    margin-top: 1rem;
}

.preview-container img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

/* Mensagens */
.mensagem {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.mensagem.sucesso {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensagem.erro {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mensagem.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Página de Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Estatísticas */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-muted {
    color: var(--gray-color) !important;
}

/* Seção de pesquisa */
.search-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

/* Tabela */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
}

tr:hover {
    background: var(--light-color);
}

/* Badges de status */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-ativo {
    background: #d4edda;
    color: #155724;
}

.status-inativo {
    background: #fff3cd;
    color: #856404;
}

/* Botões de ação */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* Detalhes do parceiro */
.partner-details {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.details-grid {
    display: grid;
    gap: 2rem;
}

.detail-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.detail-row {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.detail-row label {
    font-weight: 600;
    width: 200px;
    margin: 0;
}

.detail-row span {
    flex: 1;
}

.vehicle-photo {
    max-width: 300px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.current-photo {
    margin-bottom: 1rem;
}

.current-photo p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-fields {
        grid-template-columns: 1fr;
    }
    
    .admin-header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-row label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }
    
    form {
        padding: 1rem;
    }
    
    .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .partner-details {
        padding: 1rem;
    }
}