/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding: 2px 0;
    gap: 4px;
}
.nav-brand {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    white-space: nowrap;
}
.nav-brand:hover { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    padding: 3px 7px;
    border-radius: 5px;
    transition: all var(--transition);
    white-space: nowrap;
}
.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}
.user-name {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0 5px;
    border-right: 1px solid var(--border);
    text-decoration: none;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.user-name:hover { color: var(--accent); }
.nav-avatar, .nav-avatar-emoji {
    width: 20px; height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.nav-avatar-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
}
.profile-avatar-img {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.profile-avatar-emoji {
    width: 100px; height: 100px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 3px solid var(--border);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 auto;
}
.profile-avatar-emoji:has(span) {
    font-size: 1.2rem;
    line-height: 1.2;
    word-break: break-all;
}
.logout-form { display: inline; margin: 0; padding: 0; }
.logout-form button { font-family: inherit; cursor: pointer; }

/* Hamburger (hidden siempre) */
.hamburger { display: none !important; }
.btn-logout {
    background: transparent !important;
    border: 1px solid var(--border) !important;
    padding: 2px 8px !important;
    border-radius: 5px !important;
    color: var(--text-secondary) !important;
    font-size: 0.72rem !important;
}
.btn-logout:hover {
    border-color: var(--red) !important;
    color: var(--red) !important;
    background: rgba(248,81,73,0.1) !important;
}
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

/* Profile dropdown */
.profile-dropdown { position: relative; }
.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background var(--transition);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}
.profile-trigger:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.profile-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 200;
    backdrop-filter: blur(12px);
}
.profile-menu.open { display: block; }
.profile-menu a, .profile-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: 6px;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition);
}
.profile-menu a:hover, .profile-menu button:hover {
    background: rgba(255,255,255,0.06);
    color: var(--accent);
}
.profile-menu .menu-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}
.profile-menu .menu-danger { color: var(--red); }
.profile-menu .menu-danger:hover { background: rgba(248,81,73,0.1); color: var(--red); }

.ownership-badge {
    display: inline-block;
    font-size: 0.55rem;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ownership-badge.mia {
    background: rgba(63, 185, 80, 0.15);
    color: var(--green);
    border: 1px solid rgba(63, 185, 80, 0.3);
}
.ownership-badge.depto {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.3);
}
.notif-link { position: relative; }
.notif-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--red); color: white; font-size: 0.65rem;
    padding: 1px 6px; border-radius: 10px; font-weight: 700;
    box-shadow: 0 0 8px rgba(248,81,73,0.4);
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 8px rgba(248,81,73,0.4); }
    50% { box-shadow: 0 0 16px rgba(248,81,73,0.7); }
}

/* Messages */
.messages { margin: 16px 0; }
.message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    border: 1px solid transparent;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message.success {
    background: rgba(63,185,80,0.12);
    color: var(--green);
    border-color: rgba(63,185,80,0.25);
}
.message.error {
    background: rgba(248,81,73,0.12);
    color: var(--red);
    border-color: rgba(248,81,73,0.25);
}

/* Dashboard */
.dashboard h1 { margin: 28px 0 20px; font-size: 1.5rem; font-weight: 600; }
.dashboard h1 small { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
    transition: border-color var(--transition);
}
.section:hover { border-color: rgba(255,255,255,0.08); }
.section h2 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.2px;
}
.section h3 { font-size: 0.95rem; margin-bottom: 12px; color: var(--text-secondary); }

/* Back button */
.back-bar { margin-bottom: 6px; padding: 6px 0; }
.back-link {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.back-link:hover {
    color: var(--accent);
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.nav-admin {
    background: rgba(188,140,255,0.15) !important;
    color: var(--purple) !important;
    font-weight: 600 !important;
}
.nav-admin:hover { background: rgba(188,140,255,0.25) !important; }

/* Zen / Focus mode */
.zen-mode .navbar { display: none; }
.zen-mode .back-button { display: none; }
#zenToggle { cursor: pointer; }
