/**
 * NEWENDO — SISTEMA DE AUTENTICACIÓN & PERFIL FISIOLÓGICO
 * Visual Aesthetics: Dark Mode Luxury, Deep OLED, Warm Gold & Amber Accents
 */

:root {
    --auth-bg: #080706;
    --auth-surface: #141210;
    --auth-surface-raised: #1c1916;
    --auth-surface-border: rgba(211, 176, 106, 0.22);
    --auth-surface-border-focus: rgba(211, 176, 106, 0.65);
    --auth-gold: #d3b06a;
    --auth-gold-light: #f3dfaa;
    --auth-gold-glow: rgba(211, 176, 106, 0.35);
    --auth-text-primary: #f5efe6;
    --auth-text-muted: #a69e94;
    --auth-text-dim: #70685e;
    --auth-danger: #e06c75;
    --auth-success: #98c379;
    --auth-info: #61afef;
    --auth-font-serif: 'Cinzel', 'EB Garamond', Georgia, serif;
    --auth-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --auth-radius-sm: 8px;
    --auth-radius-md: 14px;
    --auth-radius-lg: 20px;
    --auth-shadow-card: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(211, 176, 106, 0.08);
}

/* ═══════════════════════════════════════════════════════════════
   1. WIDGET DE NAVEGACIÓN (NAV AUTH WIDGET)
   ═══════════════════════════════════════════════════════════════ */
.nav-auth-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin-left: 0.5rem;
}

.nav-auth-container:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.95rem;
    background: linear-gradient(135deg, rgba(211, 176, 106, 0.12), rgba(211, 176, 106, 0.04));
    border: 1px solid var(--auth-surface-border);
    border-radius: 999px;
    color: var(--auth-gold-light);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.nav-auth-btn:hover {
    background: linear-gradient(135deg, rgba(211, 176, 106, 0.25), rgba(211, 176, 106, 0.1));
    border-color: var(--auth-gold);
    color: #fff;
    box-shadow: 0 0 16px var(--auth-gold-glow);
    transform: translateY(-1px);
}

.nav-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.8rem 0.3rem 0.35rem;
    background: rgba(26, 23, 20, 0.85);
    border: 1px solid var(--auth-surface-border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
}

.nav-user-pill:hover,
.nav-user-pill.open {
    border-color: var(--auth-gold);
    box-shadow: 0 0 14px rgba(211, 176, 106, 0.2);
}

.nav-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-gold), #8a6c38);
    color: #080706;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-user-name {
    font-size: 0.82rem;
    color: var(--auth-text-primary);
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.nav-user-chevron {
    font-size: 0.65rem;
    color: var(--auth-text-muted);
    transition: transform 0.2s ease;
}

.nav-user-pill.open .nav-user-chevron {
    transform: rotate(180deg);
}

/* Nav User Dropdown Menu */
.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: rgba(18, 16, 14, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-md);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 20px rgba(211, 176, 106, 0.1);
    padding: 0.6rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.nav-user-dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown-header {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 0.4rem;
}

.nav-dropdown-email {
    font-size: 0.72rem;
    color: var(--auth-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-dropdown-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--auth-gold);
    margin-top: 0.3rem;
}

.nav-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #52c41a;
    box-shadow: 0 0 8px #52c41a;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    color: var(--auth-text-primary);
    font-size: 0.82rem;
    border-radius: var(--auth-radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.nav-dropdown-item:hover {
    background: rgba(211, 176, 106, 0.12);
    color: var(--auth-gold-light);
    transform: translateX(3px);
}

.nav-dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--auth-gold);
    font-size: 0.85rem;
}

.nav-dropdown-item.danger:hover {
    background: rgba(224, 108, 117, 0.15);
    color: var(--auth-danger);
}

.nav-dropdown-item.danger i {
    color: var(--auth-danger);
}

/* ═══════════════════════════════════════════════════════════════
   2. PÁGINA DE AUTENTICACIÓN (AUTH.HTML)
   ═══════════════════════════════════════════════════════════════ */
.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 3rem;
    background: radial-gradient(circle at 50% 25%, rgba(211, 176, 106, 0.08) 0%, transparent 55%),
                linear-gradient(180deg, #060504 0%, #0c0b09 100%);
    position: relative;
    overflow: hidden;
}

.auth-page-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(211, 176, 106, 0.06) 0%, transparent 70%);
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(18, 16, 14, 0.9);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.5rem 2.2rem;
    position: relative;
    z-index: 10;
    transition: border-color 0.3s ease;
}

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

.auth-brand-logo {
    max-height: 48px;
    width: auto;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 2px 8px rgba(211, 176, 106, 0.2));
}

.auth-card-title {
    font-family: var(--auth-font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--auth-gold-light);
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.auth-card-subtitle {
    font-size: 0.88rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

/* Tabs switcher */
.auth-tabs {
    display: flex;
    background: rgba(10, 9, 8, 0.7);
    padding: 0.3rem;
    border-radius: var(--auth-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 1.8rem;
    position: relative;
}

.auth-tab-btn {
    flex: 1;
    padding: 0.65rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--auth-text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 2;
}

.auth-tab-btn.active {
    color: var(--auth-gold-light);
    background: rgba(211, 176, 106, 0.16);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 10px rgba(211, 176, 106, 0.15);
    border: 1px solid rgba(211, 176, 106, 0.3);
}

/* Social Google Button */
.auth-social-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.75rem 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--auth-radius-md);
    color: var(--auth-text-primary);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 1.5rem;
}

.auth-social-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(211, 176, 106, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.auth-social-btn svg {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--auth-text-dim);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    padding: 0 0.8rem;
}

/* Form Groups & Inputs */
.auth-form-group {
    margin-bottom: 1.2rem;
    position: relative;
}

.auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    margin-bottom: 0.45rem;
    letter-spacing: 0.02em;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper i.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: var(--auth-text-dim);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input {
    width: 100%;
    padding: 0.78rem 1rem 0.78rem 2.6rem;
    background: rgba(10, 9, 8, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text-primary);
    font-size: 0.92rem;
    font-family: var(--auth-font-sans);
    transition: all 0.25s ease;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-gold);
    background: rgba(16, 14, 12, 0.85);
    box-shadow: 0 0 16px rgba(211, 176, 106, 0.2);
}

.auth-input:focus + i.auth-input-icon,
.auth-input-wrapper:focus-within i.auth-input-icon {
    color: var(--auth-gold);
}

.auth-toggle-pwd {
    position: absolute;
    right: 0.9rem;
    background: transparent;
    border: none;
    color: var(--auth-text-dim);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem;
    transition: color 0.2s ease;
}

.auth-toggle-pwd:hover {
    color: var(--auth-gold);
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: linear-gradient(135deg, var(--auth-gold), #b89349);
    border: none;
    border-radius: var(--auth-radius-md);
    color: #080706;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 18px rgba(211, 176, 106, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.auth-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #dfc282, #c9a456);
    box-shadow: 0 6px 24px rgba(211, 176, 106, 0.4);
    transform: translateY(-1px);
}

.auth-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(8, 7, 6, 0.3);
    border-top-color: #080706;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
    display: none;
}

.auth-submit-btn.loading .auth-spinner {
    display: inline-block;
}

.auth-submit-btn.loading .auth-btn-text {
    opacity: 0.7;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-helper-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
    font-size: 0.78rem;
}

.auth-link {
    color: var(--auth-gold);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.auth-link:hover {
    color: var(--auth-gold-light);
    text-decoration: underline;
}

/* Toast Notifications */
.auth-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    max-width: 380px;
    padding: 0.9rem 1.2rem;
    background: rgba(18, 16, 14, 0.95);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--auth-text-primary);
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

.auth-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.auth-toast.error {
    border-color: rgba(224, 108, 117, 0.4);
}

.auth-toast.error i {
    color: var(--auth-danger);
}

.auth-toast.success {
    border-color: rgba(152, 195, 121, 0.4);
}

.auth-toast.success i {
    color: var(--auth-success);
}

/* ═══════════════════════════════════════════════════════════════
   3. TABLERO DE PERFIL DEL USUARIO (PERFIL.HTML)
   ═══════════════════════════════════════════════════════════════ */
.profile-page-wrapper {
    min-height: 100vh;
    padding: 6.5rem 1.5rem 4rem;
    background: radial-gradient(circle at 50% 10%, rgba(211, 176, 106, 0.05) 0%, transparent 60%),
                #080706;
}

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

/* Header de Perfil */
.profile-header-card {
    background: rgba(20, 18, 16, 0.85);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2.2rem;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.profile-header-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: radial-gradient(circle at right center, rgba(211, 176, 106, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.profile-user-identity {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.profile-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--auth-gold), #8f7038);
    border: 2px solid rgba(211, 176, 106, 0.4);
    box-shadow: 0 0 20px rgba(211, 176, 106, 0.25);
    color: #080706;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name-group h1 {
    font-family: var(--auth-font-serif);
    font-size: 1.85rem;
    font-weight: 600;
    color: var(--auth-gold-light);
    margin: 0 0 0.35rem;
    letter-spacing: 0.02em;
}

.profile-email-tag {
    font-size: 0.88rem;
    color: var(--auth-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-badge-tier {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem;
    background: rgba(211, 176, 106, 0.12);
    border: 1px solid rgba(211, 176, 106, 0.3);
    border-radius: 999px;
    font-size: 0.72rem;
    color: var(--auth-gold);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-left: 0.4rem;
}

.profile-actions-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.15rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-md);
    color: var(--auth-text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.profile-action-btn:hover {
    background: rgba(211, 176, 106, 0.14);
    border-color: var(--auth-gold);
    color: var(--auth-gold-light);
    box-shadow: 0 0 15px rgba(211, 176, 106, 0.15);
}

.profile-action-btn.primary {
    background: linear-gradient(135deg, var(--auth-gold), #b89349);
    border-color: transparent;
    color: #080706;
    font-weight: 600;
}

.profile-action-btn.primary:hover {
    background: linear-gradient(135deg, #e3c788, #caa355);
    color: #000;
    box-shadow: 0 4px 18px rgba(211, 176, 106, 0.35);
}

/* KPI Summary Ribbon */
.profile-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.profile-kpi-card {
    background: rgba(20, 18, 16, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--auth-radius-md);
    padding: 1.3rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.25s ease;
}

.profile-kpi-card:hover {
    border-color: rgba(211, 176, 106, 0.35);
    background: rgba(24, 21, 18, 0.85);
    transform: translateY(-2px);
}

.profile-kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(211, 176, 106, 0.1);
    color: var(--auth-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 1px solid rgba(211, 176, 106, 0.2);
    flex-shrink: 0;
}

.profile-kpi-meta h3 {
    margin: 0 0 0.2rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-text-primary);
    font-family: var(--auth-font-sans);
}

/* Grid de Herramientas del Usuario */
.profile-section-title {
    font-family: var(--auth-font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--auth-gold-light);
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

.tool-telemetry-card {
    background: rgba(18, 16, 14, 0.85);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-telemetry-card:hover {
    border-color: rgba(211, 176, 106, 0.45);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(211, 176, 106, 0.1);
    transform: translateY(-3px);
}

.tool-card-header {
    padding: 1.3rem 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(25, 22, 19, 0.4);
}

.tool-card-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.tool-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(211, 176, 106, 0.12);
    color: var(--auth-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    border: 1px solid rgba(211, 176, 106, 0.25);
}

.tool-card-titles h4 {
    margin: 0;
    font-family: var(--auth-font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--auth-gold-light);
}

.tool-card-titles span {
    font-size: 0.75rem;
    color: var(--auth-text-muted);
}

.tool-card-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: var(--auth-text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-card-status-badge.synced {
    background: rgba(82, 196, 26, 0.12);
    border-color: rgba(82, 196, 26, 0.3);
    color: #95de64;
}

.tool-card-body {
    padding: 1.5rem 1.6rem;
    flex: 1;
}

.tool-metrics-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.metric-stat-box {
    background: rgba(10, 9, 8, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--auth-radius-sm);
    padding: 0.8rem 1rem;
}

.metric-stat-label {
    font-size: 0.72rem;
    color: var(--auth-text-muted);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--auth-text-primary);
}

.metric-stat-unit {
    font-size: 0.78rem;
    color: var(--auth-gold);
    font-weight: 500;
    margin-left: 0.25rem;
}

.tool-card-footer {
    padding: 1.1rem 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(14, 12, 11, 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-last-updated {
    font-size: 0.74rem;
    color: var(--auth-text-dim);
}

.tool-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--auth-gold);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tool-action-link:hover {
    color: var(--auth-gold-light);
    transform: translateX(3px);
}

/* Empty state for tools */
.tool-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--auth-text-muted);
}

.tool-empty-state i {
    font-size: 2.2rem;
    color: rgba(211, 176, 106, 0.3);
    margin-bottom: 0.8rem;
}

.tool-empty-state p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0 0 1rem;
}

/* Session History Table (HRV) */
.history-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin-top: 0.8rem;
}

.history-mini-table th {
    text-align: left;
    padding: 0.45rem 0.5rem;
    color: var(--auth-text-dim);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.68rem;
}

.history-mini-table td {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--auth-text-primary);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .profile-header-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }

    .profile-user-identity {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9rem;
    }

    .profile-actions-group {
        width: 100%;
        justify-content: stretch;
    }

    .profile-actions-group .profile-action-btn {
        flex: 1;
        justify-content: center;
    }

    .profile-tools-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   8. PUERTA DE ACCESO RESTRINGIDO & SOLICITUD DE INVITACIÓN
   ═══════════════════════════════════════════════════════════════ */
.profile-gate-card {
    max-width: 620px;
    margin: 2.5rem auto 4rem;
    padding: 3rem 2.5rem;
    background: linear-gradient(135deg, rgba(26, 23, 20, 0.96) 0%, rgba(15, 13, 11, 0.98) 100%);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-lg);
    box-shadow: var(--auth-shadow-card), 0 0 50px rgba(211, 176, 106, 0.06);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.profile-gate-card::before {
    content: '';
    position: absolute;
    top: -90px;
    right: -90px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(211, 176, 106, 0.14) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.gate-lock-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(211, 176, 106, 0.15), rgba(211, 176, 106, 0.05));
    border: 1px solid rgba(211, 176, 106, 0.35);
    border-radius: 50%;
    color: var(--auth-gold);
    font-size: 1.8rem;
    box-shadow: 0 0 30px rgba(211, 176, 106, 0.2);
}

.gate-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.8rem;
    background: rgba(211, 176, 106, 0.1);
    border: 1px solid rgba(211, 176, 106, 0.3);
    border-radius: 999px;
    color: var(--auth-gold-light);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.gate-title {
    font-family: var(--auth-font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--auth-text-primary);
    margin: 0 0 0.75rem;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.gate-desc {
    color: var(--auth-text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 auto 2rem;
    max-width: 480px;
}

.gate-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.3rem;
    border-radius: var(--auth-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 1.8rem;
    gap: 0.3rem;
}

.gate-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gate-tab-btn:hover {
    color: var(--auth-text-primary);
}

.gate-tab-btn.active {
    background: rgba(211, 176, 106, 0.15);
    color: var(--auth-gold-light);
    border: 1px solid rgba(211, 176, 106, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.gate-tab-panel {
    text-align: left;
}

.gate-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.gate-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.gate-form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--auth-text-primary);
}

.gate-input,
.gate-select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    background: rgba(10, 9, 8, 0.85);
    border: 1px solid var(--auth-surface-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gate-input:focus,
.gate-select:focus {
    outline: none;
    border-color: var(--auth-gold);
    box-shadow: 0 0 0 3px rgba(211, 176, 106, 0.2);
}

.gate-select option {
    background: #141210;
    color: #f5efe6;
}

.gate-code-wrapper {
    display: flex;
    gap: 0.5rem;
}

.gate-input-code {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    font-family: monospace, sans-serif;
    font-size: 1rem;
}

.gate-code-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--auth-gold) 0%, #b8954f 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    color: #0a0908;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gate-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(211, 176, 106, 0.4);
}

.gate-hint {
    font-size: 0.76rem;
    color: var(--auth-text-dim);
    margin-top: 0.2rem;
}

.gate-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, var(--auth-gold) 0%, #b8954f 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    color: #0a0908;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gate-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 176, 106, 0.45);
}

.gate-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gate-success-box {
    padding: 1.5rem;
    background: rgba(152, 195, 121, 0.1);
    border: 1px solid rgba(152, 195, 121, 0.35);
    border-radius: var(--auth-radius-sm);
    text-align: center;
    color: #e5f4d8;
}

.gate-success-box i {
    font-size: 2.2rem;
    color: var(--auth-success);
    margin-bottom: 0.75rem;
}

.gate-success-box h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    color: #fff;
    font-family: var(--auth-font-serif);
}

.gate-success-box p {
    margin: 0 0 1rem;
    font-size: 0.86rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.gate-code-preview {
    font-size: 0.82rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    display: inline-block;
}

.gate-error-box {
    margin-top: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: rgba(224, 108, 117, 0.12);
    border: 1px solid rgba(224, 108, 117, 0.35);
    border-radius: var(--auth-radius-sm);
    font-size: 0.82rem;
    color: #f87171;
}

.gate-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.84rem;
    color: var(--auth-text-muted);
    flex-wrap: wrap;
}

.gate-login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--auth-gold-light);
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.gate-login-link:hover {
    color: #fff;
}

