/* ========== VARIABLES GLOBALES ========== */
:root {
    --bg-color: #f5f0eb;        /* Fondo general cálido beige claro */
    --card-bg: #fef9e6;          /* Fondo de tarjetas crema cálido */
    --table-bg: #fffef7;         /* Fondo de tablas */
    --border-color: #e0d6cc;     /* Color de bordes suave */
    --primary-color: #667eea;    /* Color principal */
    --primary-dark: #5a67d8;     /* Color principal oscuro */
    --secondary-color: #2c3e50;  /* Color secundario */
    --success-color: #27ae60;    /* Verde éxito */
    --danger-color: #e74c3c;     /* Rojo peligro */
    --warning-color: #f39c12;    /* Naranja advertencia */
    --info-color: #3498db;       /* Azul información */
}

/* ========== GENERAL ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
}

/* ========== HEADER ========== */
.header {
    background: var(--secondary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
}

.user-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.logout-btn {
    background: var(--danger-color);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* ========== CONTENEDORES ========== */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.welcome {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

/* ========== TARJETAS CON COLOR CÁLIDO ========== */
.card, .busqueda-card, .resultados-card, .form-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e8dcc8;
}

.card-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card-header h2 {
    color: var(--secondary-color);
    font-size: 20px;
}

/* ========== MENÚ GRID ========== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.menu-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: #333;
    border: 1px solid #e8dcc8;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.menu-card h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.menu-card p {
    font-size: 14px;
    color: #666;
}

/* ========== TABLAS ========== */
.table-container {
    overflow-x: auto;
    background: transparent;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--table-bg);
}

.data-table th, .data-table td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

.data-table th {
    background: var(--primary-color);
    color: white;
}

.data-table tr:hover {
    background: #f5efe5;
}

/* ========== FORMULARIOS ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: #fffef7;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 3px rgba(102, 126, 234, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========== RADIO BUTTONS ========== */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

/* ========== BOTONES ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ========== BOTONES DE ACCIÓN EN TABLAS ========== */
.acciones-botones {
    white-space: nowrap;
    text-align: center;
    min-width: 200px;
}

.btn-action {
    padding: 6px 10px;
    font-size: 14px;
    display: inline-block;
    text-decoration: none;
    border-radius: 6px;
    margin: 2px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e0e0e0;
    color: #333;
}

.btn-action:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    color: white !important;
}

.btn-edit:hover { background: var(--info-color); }
.btn-ficha:hover { background: var(--success-color); }
.btn-consulta:hover { background: #9b59b6; }
.btn-cirugia:hover { background: #e67e22; }
.btn-hosp:hover { background: #1abc9c; }
.btn-receta:hover { background: var(--warning-color); }
.btn-delete:hover { background: var(--danger-color); }

/* ========== LOGIN ========== */
.login-body {
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 400px;
    padding: 40px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-container h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

/* ========== MENSAJES ========== */
.error {
    background: #fed7d7;
    color: #c53030;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #c53030;
}

.success {
    background: #c6f6d5;
    color: #276749;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #276749;
}

/* ========== FICHA CLÍNICA ========== */
.ficha-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alertas {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.seccion {
    margin-bottom: 30px;
}

.seccion h3 {
    background: var(--secondary-color);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* ========== RESULTADO DE BÚSQUEDA ========== */
.resultado-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s;
}

.resultado-item:hover {
    background: #f5efe5;
}

.resultado-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

/* ========== LOGO ========== */
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-icon {
    font-size: 32px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .logo-title {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
}

.logo-text .logo-pets {
    font-size: 11px;
    color: var(--warning-color);
}

.logo-img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

/* ========== GALERÍA DE IMÁGENES ========== */
.galeria-imagenes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.imagen-item {
    background: white;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 200px;
}

.imagen-item img {
    max-width: 180px;
    max-height: 120px;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.imagen-item img:hover {
    transform: scale(1.05);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    cursor: pointer;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-caption {
    margin: auto;
    display: block;
    text-align: center;
    color: white;
    padding: 10px 0;
    position: absolute;
    bottom: 20px;
    width: 100%;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #bbb;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        width: 90%;
        margin: 20px;
    }

    .container {
        padding: 0 15px;
    }

    .data-table th, .data-table td {
        padding: 6px;
        font-size: 12px;
    }

    .btn-action {
        padding: 4px 6px;
        font-size: 12px;
    }

    .imagen-item {
        width: 150px;
    }

    .imagen-item img {
        max-width: 130px;
        max-height: 90px;
    }
}

/* ========== UTILIDADES ========== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

/* ========== BADGES ========== */
.badge-alergia {
    background: var(--warning-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.badge-cronica {
    background: var(--danger-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.badge-cirugia {
    background: #9b59b6;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

/* ========== PESO DESTACADO ========== */
.peso-destacado {
    background: var(--warning-color);
    color: var(--secondary-color);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
    font-size: 18px;
}

/* Botón cambiar contraseña (mismo tamaño que logout) */
.btn-password {
    background: #f39c12;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    display: inline-block;
    font-size: 14px;
}
.btn-password:hover {
    background: #e67e22;
}