/* --- Contenedor principal --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
.dashboard-cliente {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: #333;
    line-height: 1.6;
}

/* --- Títulos --- */
.dashboard-cliente h1 {
    font-size: 34px;
    text-align: center;
    margin-bottom: 35px;
    color: #1c1c1c;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.card h2 {
    font-size: 22px;
    color: #2271b1;
    margin-bottom: 20px;
    border-left: 5px solid #2271b1;
    padding-left: 12px;
    font-weight: 600;
}

/* --- Tarjetas --- */
.card {
    background: #fff;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    margin-bottom: 30px;
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden; /* Previene desbordes */
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}
.card input,
.card select,
.card textarea {
    width: 100%;           /* Ajusta al contenedor */
    max-width: 100%;       /* Nunca se pasa del card */
    box-sizing: border-box;
    display: block;
}

/* --- Formularios --- */
.formulario-cliente-interna,
.form-seguimiento {
    display: grid;
    gap: 18px;
}
.formulario-cliente-interna .form-group,
.form-seguimiento .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
label {
    font-weight: 600;
    color: #444;
    font-size: 14px;
}
input, select, textarea {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 15px;
    width: 100%;
    transition: .3s;
    background: #fafafa;
}
input:focus, select:focus, textarea:focus {
    border-color: #2271b1;
    box-shadow: 0 0 6px rgba(34,113,177,0.3);
    outline: none;
    background: #fff;
}

/* --- Botones --- */
.btn-success, .btn-danger {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all .3s ease;
    display: inline-block;
    text-align: center;
}
.btn-success {
    background: #28a745;
    color: #fff;
}
.btn-success:hover {
    background: #218838;
}
.btn-danger {
    background: #dc3545;
    color: #fff;
}
.btn-danger:hover {
    background: #c82333;
}

/* --- Tablas --- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 15px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
th {
    background: #2271b1;
    color: #fff;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}
td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}
tbody tr:nth-child(even) {
    background: #f9f9f9;
}
tbody tr:hover {
    background: #f1f1f1;
}

/* --- Diferencia de peso --- */
.resumen-semanal td:nth-child(3) {
    font-weight: bold;
}
.resumen-semanal td.positivo { color: #28a745; }
.resumen-semanal td.negativo { color: #dc3545; }
.diferencia-positiva { color: #28a745; font-weight: bold; }
.diferencia-negativa { color: #dc3545; font-weight: bold; }

/* --- Pagos --- */
.resumen-pagos thead th {
    background: #ff9800;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
}
.resumen-pagos .total-row {
    background: #2271b1;
    color: #fff;
    font-weight: bold;
}

/* --- Próximo control --- */
.proximo-control {
    margin-top: 20px;
    padding: 16px;
    background: #f0f8ff;
    border-left: 5px solid #2271b1;
    border-radius: 10px;
    font-weight: bold;
    font-size: 15px;
}

/* --- Alertas --- */
.alert.success {
    background: #d4edda;
    color: #155724;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: bold;
    animation: fadeOut 5s forwards;
}

/* --- Animación fade --- */
@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; display: none; }
}

/* --- Links de dieta --- */
.resumen-semanal a {
    color: #2271b1;
    text-decoration: none;
    font-weight: bold;
}
.resumen-semanal a:hover {
    text-decoration: underline;
}

/* --- Responsive --- */
@media(max-width: 992px) {
    .dashboard-cliente {
        padding: 15px;
    }
    .card {
        padding: 20px;
    }
    table {
        font-size: 13px;
    }
    th, td {
        padding: 10px;
    }
}
@media(max-width: 600px) {
    .dashboard-cliente h1 {
        font-size: 26px;
    }
    .card h2 {
        font-size: 18px;
    }
    input, select, textarea {
        font-size: 14px;
        padding: 10px;
    }
    .btn-success, .btn-danger {
        width: 100%;
        text-align: center;
    }
    table {
        font-size: 12px;
    }
    th, td {
        padding: 8px;
    }
}

.btn--download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #4CAF50, #43A047);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.btn--download:hover {
  background: linear-gradient(135deg, #43A047, #388E3C);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

.btn--download:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn--download:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.4);
}


/* --- Generador Dietas/Entrenamientos --- */
.acciones-generador {
    display: flex;
    gap: 20px;
    justify-content: center; /* centra horizontal */
    flex-wrap: wrap; /* permite que bajen en móviles */
    margin: 30px 0;
}

.btn-generador {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 28px;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    min-width: 220px; /* equilibrio */
    text-align: center;
}

/* Colores */
.btn-generador.dieta {
    background: linear-gradient(135deg, #28a745, #218838);
}
.btn-generador.dieta:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-3px);
}

.btn-generador.entrenamiento {
    background: linear-gradient(135deg, #007bff, #0056b3);
}
.btn-generador.entrenamiento:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-3px);
}

.btn-generador i {
    font-size: 18px;
}

/* 🔹 Responsive para móviles */
@media (max-width: 768px) {
    .acciones-generador {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .btn-generador {
        width: 100%;
        max-width: 320px; /* ancho bonito en móvil */
    }
}
/* --- Generador Dietas/Entrenamientos --- */



/* --- Resumen Cliente --- */
.resumen-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.resumen-card h2 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: #2c3e50;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.resumen-cliente {
    width: 100%;
    border-collapse: collapse;
}

.resumen-cliente th {
    text-align: left;
    background: #2271B1;
    color: #ffffffff;
    font-weight: 600;
    padding: 10px 12px;
    width: 35%;
    border-bottom: 1px solid #ececec;
}

.resumen-cliente td {
    padding: 10px 12px;
    border-bottom: 1px solid #ececec;
    color: #000000ff;
}

.resumen-cliente tr:nth-child(even) td {
    background: #fcfcfc;
}
        
.btn-logout {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}
.btn-logout:hover {
    background: #c82333;
}
