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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f7f6;
    color: #333;
}

.app {
    display: flex;
    min-height: 100vh;
}

/* MENÚ LATERAL */

.menu-lateral {
    width: 240px;
    min-width: 240px;
    background-color: #198754;
    color: white;
    padding: 20px 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 35px;
}

.logo img {
    width: 55px;
    height: 35px;
    object-fit: contain;
}

.logo h2 {
    font-size: 20px;
}

.menu-titulo {
    font-size: 11px;
    font-weight: bold;
    opacity: 0.7;
    margin: 25px 10px 10px;
}

.nav-btn {
    display: block;
    width: 100%;
    padding: 12px 10px;
    margin-bottom: 5px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: white;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.nav-btn:hover,
.nav-btn.activo {
    background-color: rgba(255, 255, 255, 0.2);
}

/* CONTENIDO */

.contenido {
    flex: 1;
    min-width: 0;
}

/* BARRA SUPERIOR */

.barra-superior {
    height: 75px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.barra-superior input {
    width: 350px;
    max-width: 60%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 14px;
}

.acciones-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.acciones-header button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.acciones-header img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* PANTALLAS */

.contenido-principal {
    padding: 35px;
}

.vista {
    display: none;
}

.vista.activa {
    display: block;
}

.vista h1 {
    color: #198754;
    margin-bottom: 12px;
    font-size: 28px;
}

.vista > p {
    color: #666;
    margin-bottom: 30px;
}

.vista h2 {
    margin: 30px 0 20px;
}

/* PRODUCTOS */

.productos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.producto {
    width: 210px;
    padding: 15px;
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    text-align: center;
}

.producto img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}

.producto h3 {
    margin: 12px 0 8px;
}

.producto p {
    color: #198754;
    font-weight: bold;
    margin-bottom: 12px;
}

.producto button {
    width: 100%;
    padding: 10px;
    background-color: #198754;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.producto button:hover {
    background-color: #146c43;
}

/* ADAPTACIÓN A PANTALLAS PEQUEÑAS */

@media (max-width: 750px) {
    .menu-lateral {
        width: 180px;
        min-width: 180px;
        padding: 15px 8px;
    }

    .contenido-principal {
        padding: 20px;
    }

    .barra-superior {
        padding: 0 15px;
    }
}

/* BOTÓN DEL MENÚ */

.boton-menu {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    margin-bottom: 20px;
}

/* MENÚ CONTRAÍDO */

.menu-lateral {
    position: relative;
    transition: width 0.3s ease, min-width 0.3s ease;
}

.menu-lateral.contraido {
    width: 75px;
    min-width: 75px;
}

.menu-lateral.contraido .logo h2,
.menu-lateral.contraido .menu-titulo,
.menu-lateral.contraido .nav-btn {
    display: none;
}

.menu-lateral.contraido .logo {
    justify-content: center;
}

.menu-lateral.contraido .logo img {
    width: 45px;
}


/* MODO OSCURO */

body.modo-oscuro {
    background-color: #171b19;
    color: #f1f1f1;
}

body.modo-oscuro .contenido {
    background-color: #171b19;
}

body.modo-oscuro .barra-superior {
    background-color: #222925;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.modo-oscuro .barra-superior input {
    background-color: #303a34;
    color: white;
    border-color: #46534a;
}

body.modo-oscuro .barra-superior input::placeholder {
    color: #bbb;
}

body.modo-oscuro .acciones-header button {
    color: white;
}

body.modo-oscuro .producto {
    background-color: #222925;
    border-color: #39453e;
}

body.modo-oscuro .producto h3 {
    color: white;
}

body.modo-oscuro .producto p {
    color: #55c58a;
}

body.modo-oscuro .vista > p {
    color: #bbb;
}

body.modo-oscuro .vista h2 {
    color: white;
}


/*PERFIL*/

.acciones-header img {
    border-radius: 50%;
    object-fit: cover;
}

.perfil-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 25px;
    align-items: start;
    max-width: 1000px;
}

.tarjeta {
    background-color: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 25px;
}

.perfil-resumen {
    text-align: center;
}

.perfil-foto {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #198754;
}

.perfil-resumen h3 {
    margin: 12px 0 4px;
    overflow-wrap: anywhere;
}

.perfil-resumen p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    overflow-wrap: anywhere;
}

.perfil-accesos {
    margin-top: 20px;
    border-top: 1px solid #e5e5e5;
    padding-top: 10px;
}

.perfil-accesos button {
    display: block;
    width: 100%;
    padding: 10px;
    background: none;
    border: none;
    border-radius: 5px;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.perfil-accesos button:hover {
    background-color: rgba(25, 135, 84, 0.12);
}

#camposPerfil {
    border: none;
    min-width: 0;
}

#camposPerfil legend,
#camposPerfil h4 {
    font-size: 17px;
    font-weight: bold;
    margin-bottom: 15px;
}

#camposPerfil h4 {
    margin-top: 25px;
}

.campos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.campo span {
    display: block;
    font-size: 13px;
    margin-bottom: 5px;
}

.campo input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background-color: white;
    color: #333;
    font: inherit;
    font-size: 14px;
}

.campo input:disabled,
#camposPerfil:disabled input {
    background-color: #f1f3f2;
    color: #555;
}

.campo-ancho {
    grid-column: 1 / -1;
}

/*botone*/
.perfil-botones {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.perfil-botones button {
    min-width: 100px;
}

.boton {
    display: inline-block;
    padding: 10px 18px;
    background-color: #198754;
    color: white;
    border: 1px solid #198754;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

.boton:hover {
    background-color: #146c43;
}

.boton[hidden],
.perfil-botones button[hidden] {
    display: none;
}

.boton-secundario {
    background-color: transparent;
    color: #198754;
}

.boton-secundario:hover {
    color: white;
    background-color: #146c43;
}

.boton:focus-within {
    outline: 3px solid #55c58a;
}

/* Oculta el selector de archivos sin perder el acceso con teclado */

.solo-lector {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.perfil-mensaje {
    min-height: 20px;
    margin: 15px 0 8px;
    font-size: 14px;
    color: #198754;
}

.perfil-mensaje.error {
    color: #c0392b;
}

/* MODO OSCURO */

body.modo-oscuro .tarjeta {
    background-color: #222925;
    border-color: #39453e;
}

body.modo-oscuro .perfil-resumen p {
    color: #bbb;
}

body.modo-oscuro .perfil-accesos {
    border-color: #39453e;
}

body.modo-oscuro .campo input {
    background-color: #303a34;
    border-color: #46534a;
    color: white;
    color-scheme: dark;
}

body.modo-oscuro #camposPerfil:disabled input {
    background-color: #29312c;
    color: #ccc;
}

body.modo-oscuro .boton-secundario {
    color: #55c58a;
}

body.modo-oscuro .boton-secundario:hover {
    color: white;
    background-color: #146c43;
}

body.modo-oscuro .perfil-mensaje {
    color: #55c58a;
}

body.modo-oscuro .perfil-mensaje.error {
    color: #ff8a80;
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .perfil-grid,
    .campos {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* CONTRASEÑA */

.contenedor-password {
    display: flex;
    gap: 10px;
    align-items: center;
}

.contenedor-password input {
    flex: 1;
    min-width: 0;
}

.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    padding: 0 8px;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container {
    display: none !important;
}
