/* PORTAL CLIENTES */
.portal-layout {
    display: flex;
    min-height: calc(100vh - 70px);
    background: #f0f4f3;
    align-items: flex-start;
}

.portal-sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, #f8fffe 0%, #fff 100%);
    border-right: 1px solid #e0eeea;
    padding: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 10;
    transition: transform 0.3s;
    flex-shrink: 0;
    padding-top: 56px;
}

.portal-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0eeea;
    margin-bottom: 12px;
}

.portal-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #1a8a6e, #145f4d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(26,138,110,0.3);
    border: 3px solid rgba(255,255,255,0.3);
}

.portal-nombre {
    font-weight: 800;
    font-size: 15px;
    color: #222;
}

.portal-email {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    margin: 2px 8px;
    border-radius: 10px;
}

.portal-nav-link:hover {
    background: #e8f5f1;
    color: #1a8a6e;
    border-left-color: #1a8a6e;
    transform: translateX(4px);
}

.portal-nav-link.active {
    background: linear-gradient(135deg, #1a8a6e, #145f4d);
    color: #fff;
    border-left-color: transparent;
    box-shadow: 0 4px 12px rgba(26,138,110,0.3);
}

.portal-nav-link.active .portal-nav-icon {
    filter: brightness(10);
}

.portal-nav-icon { font-size: 18px; }

.portal-nav-divider {
    border-top: 1px solid #e0eeea;
    margin: 10px 0;
}

.portal-main {
    margin-left: 260px;
    flex: 1;
    padding: 32px 28px;
}

.portal-page-title {
    font-size: 24px;
    font-weight: 900;
    color: #1a8a6e;
    margin-bottom: 24px;
}

.portal-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid rgba(26,138,110,0.08);
}

.portal-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mascota-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 2px solid #e0eeea;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    color: inherit;
}

.mascota-card:hover {
    border-color: #1a8a6e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,138,110,0.12);
}

.mascota-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1a8a6e;
}

.mascota-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a8a6e, #145f4d);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.mascota-nombre {
    font-size: 18px;
    font-weight: 800;
    color: #222;
    margin-top: 12px;
}

.mascota-especie {
    font-size: 13px;
    color: #1a8a6e;
    font-weight: 600;
    margin-top: 2px;
}

.badge-notif {
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

/* AUTH PAGES */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #e8f5f0, #f0faf6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 40px;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 8px 40px rgba(26,138,110,0.12);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo img { height: 60px; }
.auth-logo-text { font-size: 26px; font-weight: 900; color: #1a8a6e; }
.auth-title { font-size: 22px; font-weight: 800; color: #222; margin-bottom: 6px; text-align: center; }
.auth-subtitle { font-size: 14px; color: #888; text-align: center; margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { font-size: 13px; font-weight: 700; color: #555; display: block; margin-bottom: 6px; }
.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: 'GEInspira', 'Nunito', sans-serif;
    outline: none;
    transition: border 0.2s;
}
.auth-form input:focus { border-color: #1a8a6e; }
.auth-btn {
    width: 100%;
    padding: 14px;
    background: #1a8a6e;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'GEInspira', 'Nunito', sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
.auth-btn:hover { background: #145f4d; }
.auth-link { text-align: center; font-size: 14px; color: #888; margin-top: 16px; }
.auth-link a { color: #1a8a6e; font-weight: 700; text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }
.auth-alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.auth-alert-error { background: #fce4ec; color: #c62828; border: 1px solid #f5c6cb; }
.auth-alert-success { background: #e8f5f1; color: #1a8a6e; border: 1px solid #a8d5c5; }

/* MOBILE */
@media (max-width: 768px) {
    .portal-layout { display: block; }
    .portal-sidebar {
        position: fixed;
        top: 70px;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        z-index: 200;
        padding-top: 16px;
        height: calc(100vh - 70px);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .portal-sidebar.open { transform: translateX(0); }
    .portal-main {
        width: 100%;
    }
    .auth-card { padding: 28px 20px; }
    .portal-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 199;
    }
    .portal-overlay.open { display: block; }
}

/* FIX sidebar y footer */
.portal-layout {
    min-height: calc(100vh - 70px);
}

.portal-main {
    min-height: calc(100vh - 70px);
}

/* Footer empuja hacia abajo correctamente */
body {
    display: flex;
    flex-direction: column;
}

.portal-layout {
    flex: 1;
}

/* Fix sidebar no tapa footer */
.portal-sidebar {
    height: calc(100vh - 70px);
    overflow-y: auto;
}

/* Centrado del contenido portal */
.portal-main {
    max-width: 1100px;
}

@media (min-width: 769px) {
    .portal-main {
        padding: 32px 40px;
    }
}

/* FIX sidebar header visible */
.portal-sidebar-header {
    padding: 20px 20px 16px !important;
    border-bottom: 1px solid #e0eeea;
    margin-bottom: 12px;
}

.portal-avatar {
    margin-bottom: 10px;
}


/* ===== MOBILE FIRST PORTAL - OVERRIDE ===== */
@media screen and (max-width: 768px) {
    .portal-layout {
        display: block !important;
        flex-direction: column !important;
    }
    .portal-sidebar {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 80% !important;
        max-width: 280px !important;
        height: 100vh !important;
        padding-top: 70px !important;
        z-index: 9999 !important;
        transform: none !important;
        min-width: unset !important;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2) !important;
    }
    .portal-sidebar.open {
        display: block !important;
    }
    .portal-main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px !important;
        max-width: 100% !important;
        margin-top: 90px !important;
    }
    .portal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    .portal-overlay.open {
        display: block !important;
    }
    #portalMobileBar {
        display: flex !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        padding: 10px 16px !important;
        border-bottom: 1px solid #e0eeea !important;
        z-index: 100 !important;
        align-items: center !important;
        gap: 12px !important;
    }
}
